Skip to content

Instantly share code, notes, and snippets.

@KenshoFujisaki
Last active September 19, 2020 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KenshoFujisaki/f3026fba0e4ba4f8fd8fdac6b7ef8ffa to your computer and use it in GitHub Desktop.
Save KenshoFujisaki/f3026fba0e4ba4f8fd8fdac6b7ef8ffa to your computer and use it in GitHub Desktop.
複数のMP4ファイルを無劣化で連結するシェルスクリプト ワンライナー
# 使い方)
# video_1.mp4, video_2.mp4, video_3.mp4,… を video.mp4 に連結したい時、
# 冒頭のfilenameにファイル接頭辞videoを渡す。つまり、filename=videoとする。
# ※FFMPEGを事前インストールしておく必要があります。 (macの場合は、$ brew install ffmpeg)
filename=ファイル名接頭辞;ffmpeg -f concat -safe 0 -i <(for f in ${filename}_*.mp4; do echo "file '$PWD/$f'"; done) -codec copy ${filename}.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment