Skip to content

Instantly share code, notes, and snippets.

@staybuzz
Created February 12, 2016 17:49
Show Gist options
  • Save staybuzz/6a56abcb34d179355240 to your computer and use it in GitHub Desktop.
Save staybuzz/6a56abcb34d179355240 to your computer and use it in GitHub Desktop.
分割されたtsファイルをffmpegを使って結合するための準備スクリプト。get_maaya.pyを実行したディレクトリで使うと良い。
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