1

I'm trying to merge an audio file with a video file. I have two options:

  • Have a very small video file (e.g., 10 seconds) that loop while the audio file is not over. (input.mp4)

  • Have a very long video file (name.wav) (it is not mp3) on which I can attach the audio file. I would like to cut the video when the audio is finished.

I'm using the latter with the -t option of ffmpeg. It means I have to get the duration of the audio file to feed it into ffmpeg. Is it possible to avoid this step ? I try to use: ffmpeg -stream_loop -1 -i input.mp4 -i input.wav -shortest -map 0:v:0 -map 1:a:0 -y out.mp4 But it not success Any pointer for the first solution ?

  • Your command should work for both options. *"But it not success"* doesn't tell me what is wrong, so I'll guess you should read [My ffmpeg output always add extra silence at the end](https://stackoverflow.com/a/55804507/). – llogan Apr 18 '20 at 18:01
  • The problem is video ouput.mp4 no sound. In fact if using file mp3. output.mp4 is OK. – Phong Nguyen Apr 19 '20 at 01:13
  • Show the complete log from your command. You can copy the log and [edit] your question to add it. – llogan Apr 19 '20 at 18:56

0 Answers0