0
0

More than 3 years have passed since last update.

ffmpegで動画を連結する備忘録

Last updated at Posted at 2020-11-20

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
    • オーディオコーデックを再エンコードしない(無劣化)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0