I am using Ubuntu vivid on my laptop and I want to recompile audio and voice with delayed audio. Movie was late comparing to audio. I demuxed voice.aac and video.h264 from orginal video. I know that it is possible via editing aac but this file doesnt need any mod for aac. Just wanna delay audio.
-itsoffset option should do what you want:
-itsoffset offset (input)
Set the input time offset.
offset must be a time duration specification, see (ffmpeg-utils) the Time duration section in the ffmpeg-utils(1) manual.
The offset is added to the timestamps of the input files. Specifying a positive offset means that the corresponding streams are delayed by the time duration specified in offset.
$ ffmpeg -i video.h264 -itsoffset 1.0 -i voice.aac -map 0:a -map 1:v -c copy remuxed.mp4
should give an audio delay of 1 second. However, there might be container issues here, since
ffmpeg is having to figure everything out from scratch.
What's better is if you do it using the original file:
$ ffmpeg -i orig.mkv -itsoffset 1.0 -i orig.mkv -map 0:a -map 1:v -c copy remuxed.mkv
This applies a delay of 1 second (per the option to
input 0, and no delay to
input 1. The
-map options specify to take the (delayed) audio from
input 0 and the (non-delayed) video from
Hope that's clearer!
(If you wanted to delay the video instead, change the
$ ffmpeg -i orig.mkv -itsoffset 1.0 -i orig.mkv -map 0:v -map 1:a -c copy remuxed.mkv
which specifies to take the delayed video, and the non-delayed audio)