If you don’t want to get a value error, then you have to specify the codecs. Then use concatenate_videoclips() to merge the files together here, note that the files must be placed in a list! In order to save the merged file, once again, we’ll be using write_videofile() however, here, you must be careful. Here, once again, choose three segments that you’d like to merge with subclip(). Now, let’s merge the three chunks that we created in the previous section. It will take “video.mp4” and cut it up and then save it as cut_video_1.m4, cut_video_2.mp4, and cut_video_3.mp4. The latter will create three videos from the main video file called “video.mp4”. write_videofile ( "cut_video_2.mp4" )Ĭut_video_3. write_videofile ( "cut_video_1.mp4" )Ĭut_video_2. subclip ( 40, 50 )Ĭut_video_3 = VideoFileClip ( "video.Mp4" ). subclip ( 20, 30 )Ĭut_video_2 = VideoFileClip ( "video.Mp4" ). # use subclip() to specify the time frame you wantĬut_video_1 = VideoFileClip ( "video.mp4" ). Write Python Script: Now the fun part, writing the code from .ffmpegtools import ffmpegextractsubclip Replace the filename below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |