エンジニアとしての市場価値を測りませんか?PR

企業からあなたに合ったオリジナルのスカウトを受け取って、市場価値を測りましょう

108
89

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ffmpegを使って映像と音声を結合する

Posted at

ffmpegを使って映像と音声を結合して一つの動画ファイルにするには、次のようなコマンドを実行します。

ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4

ポイントは-c:v copyを指定して動画を再エンコードしないようにしていることと、-map 0:v:0 -map 1:a:0を指定して元の動画ファイルに音声トラックが含まれている場合でも確実に音声ファイルの音声トラックを利用するようにしているところです。
元の動画ファイルに音声が含まれていないのであれば、-mapの指定はなくても良いです。

108
89
1

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
niusounds

@niusounds((エンジニアのすがた) niu)

REALITYでAndroidテックリードをやっていました。 初めて触ったAndroidは1.5から。 好きなFlowのオペレーターはflatMapLatest。 好きなメタルのサブジャンルはメロスピとシンフォニックメタルとフォークメタル。

Linked from these articles

Comments

massann07
@massann07

動画ファイルに音声トラックと音声ファイルの音どちらも取り入れることは可能でしょうか?
また参考になりそうな記事がありましたがご教授いただければ幸いです。

0

Let's comment your feelings that are more than good

Being held Article posting campaign

ネイティブアプリ Qiita Tech Festa 2025

2025-06-17 ~ 2025-07-15

View details
108
89

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address