[FFmpeg-user] Unable to sync audio and video

Nicolas George george at nsup.org
Mon Feb 15 20:13:34 EET 2021


Livio Tenze (12021-02-15):
> -The audio source comes from alsa: here I see really strange behaviour. The
> pts value of the second packet with respect to the first pts packet seems
> to be "delayed" from 0.4s to 1.8s. I don't understand this behaviour: I
> checked the time from start to the second packet and the elapsed time
> cannot be justified (ms and not s).

Can you observe the same phenomenon using ffprobe?

ffprobe -f alsa -i default -show_packets -of compact | head -n 50 | less -S

would be a good way to look.

Do you observe warnings on the console?

How does your application handle parallelism between encoding and
reading from devices?

> -Finally, when I write audio and video in the output MP4 stream (I use
> libx264 and libfdk_aac for video and audio respectively) the audio stream
> is delayed.

Do the timestamps between audio and video match before encoding?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20210215/440227ea/attachment.sig>


More information about the ffmpeg-user mailing list