目的
特定のディレクトリにある40個の動画ファイルを連結させたかった
準備
- ffmpeg のインストール
コマンド
$ ls -1v *.mov | sed 's/^/file /' > filelist.txt
$ ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mov
補足
$ ls -1v *.mov | sed 's/^/file /' > filelist.txt
-
ls -1v *.mov: .mov ファイルを名前順にリスト表示 -
sed 's/^/file /': 各ファイル名の前にfileを追加 -
> filelist.txt: リストをfilelist.txtに保存
filelist.txt
file aaa.mov
file bbb.mov
file ccc.mov
$ ffmpeg -f concat -safe 0 -i filelist.txt -c copy output.mov
-
-f concat: 連結モードを指定 -
-safe 0: ファイル名にスペースが含まれている場合でも安全に処理 -
-i filelist.txt: 入力リストファイル -
-c copy: エンコードせずにコピー -
output.mov: 出力ファイル名