[FFmpeg-user] ffmpeg latency

Cory J. Geesaman cory at geesaman.com
Wed Mar 20 14:51:29 CET 2013

I'm experiencing a delay with ffmpeg streams from two 8-channel bt878a cards
from NTSC sources running 29.97 FPS being converted to mpeg1video that
builds up over time, after running for 10-20 minutes the streams are delayed
by 4-5 seconds, when run overnight they are delayed by at least 5 hours.
The ffserver the streams go to have 5MB feed file size limits and they are
then converted to webm via another ffmpeg process, but the delay appears to
occur on the machine with the bt878a cards before it is sent to the
ffserver.  I'm not really sure how this is possible to begin with (even with
2 separate 5MB feed files, 10MB isn't enough to hold several hours at
320x240, is it?) - but is there some way I can tell ffmpeg to only grab live
images or otherwise cut out the delay that is building up?


The command grabbing from the bt878a cards is (16 of these, but here's one
for the first channel):


ffmpeg -f video4linux2 -standard ntsc -i /dev/video0


The command converting to webm (sits on whereas the prior command
is on


ffmpeg -f mpegvideo -i http://localhost:8090/0.mpg -vcodec libvpx


And the ffserver.conf relating to those channels:


Port 8090


MaxHTTPConnections 2000

MAXClients 100

MaxBandwidth 1000000

CustomLog /var/log/ffserver



<Feed 0.ffm>

File /tmp/0.ffm

FileMaxSize 5M

ACL allow



<Feed 0_webm.ffm>

File /tmp/0_webm.ffm

FileMaxSize 5M

ACL allow localhost



<Stream 0.mpg>

Feed 0.ffm

Format mpeg1video


VideoFrameRate 29.97

VideoBitRate 512K

VideoSize 320x240

VideoBufferSize 40

VideoGopSize 12



<Stream 0.webm>

Feed 0_webm.ffm

Format webm


VideoCodec libvpx

VideoSize 320x240

VideoFrameRate 29.97

AVOptionVideo flags +global_header

AVOptionVideo cpu-used 0

AVOptionVideo quality good

PreRoll 0


VideoGopSize 12

VideoBitRate 256



More information about the ffmpeg-user mailing list