[FFmpeg-user] Extracted Audio not in Sync with Video

凯迪软件(咨询、售后) ikaidi at qq.com
Tue Oct 31 02:17:03 EET 2023

ffmpeg -y -i "v1-ed.mp4" -i "a1-ed.wav" -filter_complex "[1]anull[aud]; [0]fade=t=out:st=6673.87:n=24[out]" -strict experimental -shortest -map 0:v:0 -map 1:a:0 "lecture.mp4"

You can try using this command to see if it can solve your problem.

The translation in English is: "Try canceling the fade-in and fade-out effect you added."

china kaidi

------------------ Original ------------------
From:                                                                                                                        "FFmpeg user questions"                                                                                    <jnfo-d at grauman.com>;
Date: Tue, Oct 31, 2023 07:31 AM
To: "ffmpeg-user"<ffmpeg-user at ffmpeg.org>;

Subject: [FFmpeg-user] Extracted Audio not in Sync with Video

Hi all,

My use case is that I want to extract audio from a mp4, edit the audio, 
and then put the audio and the video back together. It works fine, but 
over the course of the two hour video, the audio gets out of sync with the 
video and falls behind it (visibly, so you can see the mouth and sound 
aren't in sync).

I extract the audio with a command like this:
ffmpeg -y -i "v1-ed.mp4" -vn "a1.wav"

I edit a1.wav with audacity to create a1-ed.wav.

And then combine audio and video with a command like this:
ffmpeg -y -i "v1-ed.mp4" -i "a1-ed.wav" -filter_complex "[1]anull[aud]; [0]fade=t=out:st=6673.87:n=24[out]" -strict experimental -shortest -map [out] -map [aud] "lecture.mp4"

Is there any easy way to make sure the audio stays sync'd through this 


ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org

To unsubscribe, visit link above, or email
ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list