[FFmpeg-user] Video and audio out of sync after some time

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Nov 2 16:00:41 CET 2015

Nithiwat Maneesint <ggadv4 <at> gmail.com> writes:

> I receive the data in bytes then I decode the video 
> to YUV420p and the audio to pcm_s16le in Java, then I 
> send the decoded video and audio data (in bytes) to 
> ffmpeg via pipe:0 (video) and a udp socket (audio).
> The problem is that, the video has variable FPS

This cannot work because FFmpeg (has to) assumes that 
rawvideo is cfr and this is what you tell it with the 
input parameter -r.

As Moritz said, use FFmpeg to decode your input stream 
which will have timestamps then to avoid the sync issue.

Carl Eugen

More information about the ffmpeg-user mailing list