[FFmpeg-user] How do I make ffplay play without high latency?
tojesseg at gmail.com
Thu Nov 22 19:02:25 CET 2012
I have an internet-controllable robot (See photo) and I have a little
Cisco MP4 streaming video network camera on it, and I'm trying to use
ffplay to play the live video stream.
The camera encodes the video to either mjpeg or mpeg4 with extremely
I'm using the mpeg4 mode because it requires far less bandwidth.
The problem I'm having is that ffplay seems to introduce a second or
two of latency -- which is a big deal when you're driving the robot
via the video feed, and you can' t see where you're going until after
it's too late.
With mplayer I was using the -benchmark option which makes it play as
fast as possible, but even that has just under a second of latency.
I know that the video camera is getting the data out the network port
quickly because when I use the windows web client, it has a plugin
that streams/plays the mpeg4 and it has very low latency -- so I know
the camera is not the source of the latency.
(But of course I use Linux.)
Is there a way to make ffmpeg play each frame as soon as it can with
reduced buffers or whatever so I can get the picture to the screen as
soon as possible? I don't care too much about jitter or stuttering - I
just need the video on the screen as soon as possible.
Thank you very much,
NOTE: Below, the "warning: first frame is no keyframe" line happened
when I clicked in ffplay to fast forward to the end, to try to get
latency to reduce. But the video was playing just fine after I
clicked to fast forward.
bash-4.1# ffplay http://admin:email@example.com/img/video.asf
ffplay version N-46939-g030db0c Copyright (c) 2003-2012 the FFmpeg developers
built on Nov 21 2012 00:52:42 with gcc 4.5.2 (GCC)
libavutil 52. 8.100 / 52. 8.100
libavcodec 54. 74.100 / 54. 74.100
libavformat 54. 37.100 / 54. 37.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 23.101 / 3. 23.101
libswscale 2. 1.102 / 2. 1.102
libswresample 0. 17.101 / 0. 17.101
[asf @ 0x8f2b1a0] Estimating duration from bitrate, this may be inaccurate
Input #0, asf, from 'http://admin:firstname.lastname@example.org/img/video.asf':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mpeg4 (MP4S / 0x5334504D), yuv420p, 640x480,
14.99 tbr, 1k tbn, 1k tbc
Frame changed from size:0x0 to size:640x480 4KB sq= 0B f=0/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 972, new 874=0/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 972, new 829=0/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 971, new 823=0/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 975, new 11230/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 974, new 14450/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 974, new 753=0/0
[mpeg4 @ 0x8f40920] warning: first frame is no keyframe 0KB sq= 0B f=0/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 973, new 790=0/0 B f=0/0
[asf @ 0x8f2b1a0] freeing incomplete packet size 975, new 784=0/0
61.58 A-V: 0.000 fd= 517 aq= 0KB vq= 0KB sq= 0B f=0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 51134 bytes
Desc: not available
More information about the ffmpeg-user