13

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.

2 Answers 2

18

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.

Sign up to request clarification or add additional context in comments.

Comments

6

I couldn't get audio to offset properly either, and some searching suggests that -itsoffset is currently broken.

You could try and get/compile an old version of ffmpeg before it broke (which doesn't sound like much fun).

Alternately, you could pad your audio with the necessary silence using something like sox and then combine:

sox -null silence.mp3 trim 0 500    # use -r to adjust sample-rate if necessary
sox silence.mp3 input.mp3 padded_input.mp3
ffmpeg -i in.avi -i padded_input.mp3 out.avi

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.