[FFmpeg-user] how to re-add original audio delay back into a 2-inputfile ffmpeg transcode

hydra3333 at gmail.com hydra3333 at gmail.com
Thu Jul 30 07:53:16 EEST 2020


I have a .mpg with interlaced mpeg2 and ac3 audio, which needs converting to progressive .mp4 avc/aac.

The interlaced video is a bit grainy etc so I hope to deinterlace and clean it up using vapoursynth CUDA filters and at the same time convert the audio, using a single commandline, perhaps like this:

ffmpeg.exe -i input_from_vapoursynthprocessed_mpg.vpy  -i the_mpg.mpg  -map 0:v:0  -map 1:a:0  -c:v blah  -c:a blah  -y output.mp4

The thing is, the original files always have an audio/video delay of some kind (audio delay usually has a negative value, sometimes even a couple of seconds).
Also, Vapoursynth returns audio-free content, so video/audio delays returned to ffmpeg there would I suppose be 0.
The aim is to not have lost lipsync in the final output.

Can someone please advise;

(a) whether any audio delay is carried through correctly to the output file when using the single commandline above

(b) if not, how could I introduce the audio delay, assuming I can already detect its original value from the .mpg using mediainfo/ffprobe ?

Thanks !

More information about the ffmpeg-user mailing list