Popen (split_cmd+split_str, shell = True, stdout = subprocess. ![]() "'" print "About to run: "+split_cmd+split_str Split_str + = " -ss "+ str (split_start )+ " -t "+ str (split_length ) + \ Split_cmd = "ffmpeg -i '"+filename+ "' " for n in range ( 0, split_count ): Print "Clip length is less then the target split length." raise SystemExit # -acodec copy and -vcodec copy will not give accurate results so do not use them ceil (clip_length/ float (split_length ) ) ) if (split_count = 1 ): Print "Can't determine clip length." raise SystemExit group ( 3 ) ) print "Clip length in seconds: "+ str (clip_length ) else: search (output ) if matches:Ĭlip_length = int (matches. (filename, split_length ) = parse_options ( ) if split_length &1 | grep 'Duration'" , ![]() # Original version can be found at Antarctic Nest of Icephoenix at: # -equal-chunks-with-ffmpeg-and-python/ #!/usr/bin/env python import subprocess import re import math from optparse import OptionParser # Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 # Please see: for legal details, # rights of fair usage, the disclaimer and warranty conditions. Where N represents the number of seconds that each segment will have. Then, clips can be split using the command: To use, save the file as ffmpeg-split.py and then run: ![]() The following code is an adaptation from Antarctic Nest of Icephoenix and will split clips into equal segments of a given size.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |