polewseo.blogg.se

Python ffmpeg cut video
Python ffmpeg cut video




python ffmpeg cut video

All the runs say the correct start and endpoints (0-400 400-800 800-1200). after the first run through, to make sure the start and endpoints are correct, it prints the start and end points. Now, it runs a loop for the number of parts, to convert a video with the start point (denoted in the ffmpeg command as -ss) originally 0, and the end point ( -t), originally the length of 1 part (in our case 400). Then, it takes that number of parts and divides the length of the video (in our case 20 mins = 1200 seconds) by the number of parts (the variable set previously as parts) which would get us (1200 seconds divided by 3 parts = ) 400 which is the length each part should be (partlength). I defined start to be 0 originally, and the end marker to be the length of each part.įor example, if the video file is 139 mb and 20 mins long, it takes the size divided by 64 turns it into an integer plus 1 in order to add a third part for any amount of video after the last 64 mb marker.

python ffmpeg cut video python ffmpeg cut video

This is my for loop that convert each chunk of broken up video: for part in range(parts): I am trying to write a python script that breaks a video into chunks of less than 64 mb each.






Python ffmpeg cut video