Created
February 12, 2016 17:49
-
-
Save staybuzz/6a56abcb34d179355240 to your computer and use it in GitHub Desktop.
分割されたtsファイルをffmpegを使って結合するための準備スクリプト。get_maaya.pyを実行したディレクトリで使うと良い。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import commands | |
for i in range(216): | |
arg = [] | |
num = commands.getoutput("ls "+"{0:03d}".format(i+1)+"-*|wc -l") | |
if (num[0]=='l'): continue | |
for j in range(int(num)): | |
arg.append("{0:03d}".format(i+1)+"-"+str((j+1))+".ts") | |
args = "concat:"+"|".join(arg) | |
print "ffmpeg -i \"" +args + "\" -c copy -y \"" + "{0:03d}".format(i+1) + ".ts\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment