ffmpeg - audio is 500ms behind video in screen recording

Viewed 443

I am trying to record my screen along with the audio using ffmpeg 4.3. But in the final output, my audio is around 500ms to 1sec behind the video. Why is this happening? How this can be fixed? Here is the command I am using on Windows 10 machine:

ffmpeg.exe -threads 4 -rtbufsize 1024m -f dshow -i audio="Microphone (Realtek Audio)" -f gdigrab -offset_x 0 -offset_y 0 -video_size 1920x1080 -framerate 30 -probesize 32 -i desktop -pix_fmt yuv420p -c:v libx264 -crf 28 -preset ultrafast -tune zerolatency -movflags +faststart test.mp4

1 Answers

how have you calculate the shift between the 2 media ?

ffmpeg -i "sample.mp4" -itsoffset 13.84 -i "sample.mp4" \
       -map 1:v -map 0:a -c copy "movie-video-delayed.mp4"

-itoffset is the delay

Related