[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
http://10.1.2.1:8090/0.ffm

 

The command converting to webm (sits on 10.1.2.1 whereas the prior command
is on 10.1.2.2):

 

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

 

And the ffserver.conf relating to those channels:

 

Port 8090

#BindAddress 10.1.1.15

MaxHTTPConnections 2000

MAXClients 100

MaxBandwidth 1000000

CustomLog /var/log/ffserver

NoDaemon

 

<Feed 0.ffm>

File /tmp/0.ffm

FileMaxSize 5M

ACL allow 10.1.2.2

</Feed>

 

<Feed 0_webm.ffm>

File /tmp/0_webm.ffm

FileMaxSize 5M

ACL allow localhost

</Feed>

 

<Stream 0.mpg>

Feed 0.ffm

Format mpeg1video

NoAudio

VideoFrameRate 29.97

VideoBitRate 512K

VideoSize 320x240

VideoBufferSize 40

VideoGopSize 12

</Stream>

 

<Stream 0.webm>

Feed 0_webm.ffm

Format webm

NoAudio

VideoCodec libvpx

VideoSize 320x240

VideoFrameRate 29.97

AVOptionVideo flags +global_header

AVOptionVideo cpu-used 0

AVOptionVideo quality good

PreRoll 0

StartSendOnKey

VideoGopSize 12

VideoBitRate 256

</Stream>

 



More information about the ffmpeg-user mailing list