PHPから実行した際の備忘録。
連結する全動画の画角、コーデックが同じであること。
file_list.txt
file '/var/***/1.mp4'
file '/var/***/2.mp4'
file '/var/***/3.mp4'
file '/var/***/4.mp4'
file '/var/***/5.mp4'
# 動作確認済み
$cmd = "ffmpeg -f concat -safe 0 -i {$file_list_path} -c copy {$output_local_path}.mp4";
system($cmd);
# こっちは未テスト
$cmd = "ffmpeg -f concat -safe 0 -i {$file_list_path} -c:v copy c:a copy {$output_local_path}.mp4";
system($cmd);
- -f concat
- 連結指示
- -safe 0
- file_list.txt 内でファイルパスを絶対パスで指定する際に必要とのこと
- {file_list_path}
- 連結するファイルのパスを書いたテキストファイルパス
- -c copy
- オリジナルのコーデックを再エンコードしない(無劣化)
- -c:v copy
- ビデオコーデックを再エンコードしない(無劣化)
- -c:a copy
- オーディオコーデックを再エンコードしない(無劣化)