I have a 10 minute video and a 50 minute audio mp3. The video starts at 500 seconds into the audio. Using FFMPEG, how can I add the the audio to the video but specify a 500 seconds audio offset (So that they sync up)?
EDIT:
Down the bottom of this page it suggests how to specify an offset.
$ ffmpeg -i video_source -itsoffet delay -i audio_source -map 0:x -map 1:y .......
However, when I apply this, it still starts the audio from the start.
-itsoffset – this is an important parameter in this command because it instructs FFmpeg to add a delay of three seconds to the input streams. 3 literally means start the second input after three seconds of when the first input started. -c:a copy – tells FFmpeg for audio codec just copy it.
The itsoffset option applies to all streams embedded within the input file. Therefore, adjusting timestamps only for a single stream requires to specify twice the same input file. adjusts timestamps of the input audio stream(s) only.
The -i option in the above command is simple: it is the path to the input file. The second option -f mp3 tells ffmpeg that the ouput is in mp3 format. The third option i.e -ab 192000 tells ffmpeg that we want the output to be encoded at 192Kbps and -vn tells ffmpeg that we dont want video.
We are 8 years later, and the -itsoffset
does work.
Exactly as in your linked page:
ffmpeg -i input_1 -itsoffset 00:00:03 -i input_2
Note that you place the -itsoffset
switch before the input you want to delay, in this case input_2
will be delayed.
So in your case that the video starts later, you would add -itsoffset 00:08:20
before the video input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With