0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【備忘録】会議動画の再エンコード- ffmpeg

0
Last updated at Posted at 2026-09-03

はじめに

会議画面ではおそらくパワーポイントが主で、画面が変化しないことが多いと思われます。したがって再エンコードを行うと動画のビットレートが落ちて容量が減るのではないかと思われます。

コマンド

動画としてこのようなものを格納しているとして

MP4
├─ H.264映像
└─ AAC音声

ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset medium -c:a copy output.mp4

[その他]動画の大きさを変更(余白を黒で表示)

ffmpeg -i input.mp4 -vf "pad=1920:1080:(1920-iw)/2:(1080-ih)/2:black" output.mp4

[その他]動画の結合(再エンコードなしで)

再エンコードしないで問題ない条件はコーデック・fps・音声形式が統一されているか

list.txt
file input1.mp4
file input2.mp4
ffmpeg -f concat -safe 0 -i list.txt -c copy output.mp4

1440×1080の地デジ・BS録画の放送TSファイルをmp4に変換

input_ts="input.ts"
output_mp4=${input_ts%.*}.mp4
ffmpeg -y -i ${input_ts} \
-c:v libx264 \
-preset veryfast \
-crf 22 \
-filter:v "bwdif=0:-1:1" \
-c:a aac \
-b:a 192k \
-ar 48000 \
-ac 2 \
-movflags +faststart \
${output_mp4}
  • -y: 確認なしで上書き
  • -i input.ts: 入力ファイル

映像関連

  • -c:v libx264: 映像コーデックをH.264で圧縮
  • -preset veryfast: エンコード速度を指定
  • -crf 25: 画質指定。大きいほど画質が悪くなる。容量が多ければ29、少なければ25や22に設定。1440×1080の地デジ・BS録画なら22あたりがおすすめ
  • -filter:v "bwdif=0:-1:1": 地デジ録画のような1080iを1080pに変換しデインターレースする

音声関連

  • -c:a aac: 音声をAACに変換
  • -b:a 192k: 音声ビットレート
  • -ar 48000: サンプリング周波数(Hz)
  • -ac 2: 音声チャネル数(ステレオ)
  • -movflags +faststart: MP4のインデックス情報をファイル先頭へ移動
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?