Created
December 11, 2020 11:12
Star
You must be signed in to star a gist
tsファイルをつなぎ合わせてひとつのmp4にする
This file contains 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
#! python3 | |
#tsファイルをつなぎ合わせてひとつのmp4にする | |
import os | |
import subprocess | |
tmp_list = [i for i in os.listdir() if i.endswith('.ts')] | |
tmp_list.sort() | |
with open('./ts_list.txt', 'w') as ts_list: | |
for l in tmp_list: | |
ts_list.write(f'file {l}\n') | |
subprocess.run('/usr/local/bin/ffmpeg -f concat -safe 0 -i ts_list.txt -c copy output.mp4', shell=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment