Reputation: 197
I'm using the below ffmpeg code to embed a video over a background image
ffmpeg -loop 1 -i <INPUT BACKGROUND IMAGE> -i <INPUT VIDEO FILE> -
filter_complex "[1]scale=515:386 [vid]; [0][vid]overlay=43:46:shortest=1[out]"
-map "[out]" -y <OUTPUT VIDEO FILE>
This will put my input video file on top of my input background image and create a final output video file. However, I need the audio from the input video file to be copied over to the output video file as well. How do I achieve that?
Thank you!
Upvotes: 1
Views: 3053
Reputation: 93329
Map the audio as well and set codec mode for it to copy
.
ffmpeg -loop 1 -i <INPUT BACKGROUND IMAGE> -i <INPUT VIDEO FILE>
-filter_complex "[1]scale=515:386 [vid]; [0][vid]overlay=43:46:shortest=1[out]"
-map "[out]" -map 1:a -c:a copy -y <OUTPUT VIDEO FILE>
Upvotes: 1