[FFmpeg-user] Cannot stream live in FLV format. SWF works. Why?

Jerome Martens jeromemartens at yahoo.com
Mon Oct 15 16:32:01 CEST 2012



Hello,
I would like to generate a live videostream using ffmpeg/ffserver under linux. The stream originates from a sequence of images which are rendered in realtime by processing several sensor data. The images are written as jpegs to the named pipe "jpgpipe" (created by mkfifo) at a rate of 5 fps by a separate process. My problem is that I don't know which is the best format for live streaming with as little latency as possible?

The image sequence is encoded to flv and sent to ffserver on port 8090:
ffmpeg -y -r 5 -f mjpeg -i jpgpipe -vcodec flv -flags +global_header http://localhost:8090/feed1.ffm

These two sections of /etc/ffserver.conf stream the feed in either swf or flv format:

<Stream swftest.swf> 
Feed feed1.ffm 
Format swf 
VideoCodec flv
NoAudio
</Stream>

<Stream flvtest.flv> 
Feed feed1.ffm 
Format flv 
VideoCodec flv
NoAudio
</Stream>

When I open http://localhost:8090/swftest.swf in a browser, the video starts playing with about two seconds delay.
When I open http://localhost:8090/flvtest.flv, I first have to stop the process which generates the images. Only after all images have been streamed, the browser starts playing the whole video.

Trying to understand the difference between flv and swf formats, all explanations seem to tell the opposite: swf is said to be the format for saving videos, while flv is said to be appropriate for live streaming.

Am I doing something wrong? Missing some flags or settings?
Are there better ways of live streaming image sequences (if possible with ffmpeg/ffserver)?
Is it worth looking into mp4 or rtp streams?
Is it possible to broadcast with less than 0.5 seconds delay?

Thank you very much for reading
Jerome



More information about the ffmpeg-user mailing list