Add audio at specific time in video using ffmpeg

Solution 1:

I finally solved the problem by adding just 1 option -async

ffmpeg -y -i a.mp4 -itsoffset 00:00:30 -i sng.m4a -map 0:0 -map 1:0 -c:v copy -preset ultrafast -async 1 out.mp4

By default audio/video timestamps are stretched to match each other; which was my problem of audio starting from initial even after giving the "itsoffset" option.

As per Ffmpeg Doc, using -async 1 corrects the initial timestamp of audio only. I know that this option is deprecated; but anyhow it solved my case.