[FFmpeg-user] Latency in webcam capture

Arif Driessen arifd86 at gmail.com
Thu Oct 7 17:41:04 EEST 2021


Hi guys,

Sorry for yet another latency post.

I think this is also due to buffering:

ffplay -hide_banner -f lavfi movie=/dev/video0:f=video4linux2

It takes about 2 seconds before any images are shown, and that's also about
exactly the amount of latency when the images are produced. I'm almost
certain a buffer is being filled up, without getting flushed.

There's nothing in the docs:
https://ffmpeg.org/ffmpeg-devices.html#video4linux2_002c-v4l2 about
buffer_size here.

I've also tried:

ffmpeg \
-hide_banner \
-analyzeduration 1 \
-probesize 32 \
-fflags -nobuffer \
-f v4l2 -i /dev/video0 \
-force_key_frames 00:00:00.000 \
-f nut - | ffplay - &> /dev/null

Any ideas?

Thank you!
Arif Driessen


More information about the ffmpeg-user mailing list