[FFmpeg-user] How do I make ffplay play without high latency?

Nicolas George nicolas.george at normalesup.org
Wed Nov 28 18:02:10 CET 2012


L'octidi 8 frimaire, an CCXXI, Nicolas George a écrit :
> I believe the problem is in the ASF demuxer. For example, compare this:
> 
> f=asf; \
> ffmpeg -re -f lavfi -i testsrc=r=10:n=1:s=160x120,crop=80:60:80:30 \
>   -f $f - -pix_fmt yuv420p -f sdl - | \
> ./ffmpeg_g -probesize 2k -flags +low_delay -f $f -i - \
>   -pix_fmt yuv420p -f sdl -
> 
> and the same with f=m4v instead of f=asf: the second (m4v) is smooth and has
> almost no delay, the first is completely choppy and has a visible latency.

I realize that this example could be explained by a latency in the muxer in
the encoding ffmpeg, and therefore irrelevant here. Further tests with a
local file and dd+sleep to cat it slowly seem to confirm that.

The hard thing here is that it is not possible to reproduce your issue
completely.

If you want to investigate further, I would suggest to add debug output just
after the call to iformat->read_packet in libavfilter/utils.c. Something
like that should be enough:

if (ret >= 0) {
    static int c = 0;
    av_log(0, 16, "Got a frame: %d\n", c++);
}

Then you would have to try to figure out if the numbers that will be printed
very quickly are in sync with the camera input or with the SDL display.

Now that I think of it: can you show a little output of ffprobe on the
stream? I would be curious to know what the timestamps are.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20121128/c9792d04/attachment.asc>


More information about the ffmpeg-user mailing list