You should not reencode neither the video nor the audio, but just delay the audio stream. The -itsoffset
option of ffmpeg
serves the purpose of adding an offset to the time stamp of a stream, such that it is delayed. The command therefore would be more like:
ffmpeg -i my_movie.mp4 -itsoffset 0.5 -i my_movie.mp4 -map 0:v -map 1:a -c:copy fixed_movie.mp4
-itsoffset 0.5 -i my_movie.mp4
specifies that the second input file
(which, in this case, happens to be the same as the first), should be
delayed by 0.5 s.
-map 0:v -map 1:a
selects only the video from the
first input file, and only the audio from the second (delayed)
stream. These woulld not be needed if you had two files, one with only the video stream and the other with only the audio stream.
-c:copy
indicates all streams should be copied (and is a shortcut notation equivalent to -c:v copy -c:a copy
)
You should also be able to achieve this with the graphical tool Avidemux, but my experience is that it does not always work reliably. The command line is, once you found the options, way faster.
vlc
can adjust the audio forward/backward compared to video when you watch it, meaning no change is required.