[theora] Live Streams

Gregory Maxwell gmaxwell at gmail.com
Wed Jan 6 06:53:16 PST 2010

On Wed, Jan 6, 2010 at 1:34 AM, iMDT - Tiago Jacobs <tiago at imdt.com.br> wrote:
> Thanks for your response.
> I made some testing with "live" streaming.
> I used this very basic command line:
> ffmpeg2theora /dev/video0  -f video4linux2 --inputfps 12 -x 352 -y 288 -A 32
> -V 500 -K 2  -d 1 -o - | oggfwd localhost 8000 hackme /teste.ogv
> Warning: could not set desired buffer delay of 1, using 12 instead.
> This message is generated by :

Buffer delay does not do what you think it does. It sets the
constraint interval for rate control in frames, it does not directly
influence the delay of theora. The delay of theora is one frame.

> It seems that buf_delay is set by th_encode_ctl...
> The lower "latency" i got was 12seconds... Am i missing something?

Yes, you're missing that icecast isn't at all designed for low latency
streaming, that if you need low latency for ogg low latency streaming
doesn't generally work over tcp, and that by default most ogg tools
pack multiple frames into a single ogg page when they can to reduce
framing overhead.  You've also said nothing of your client software,
so I have no idea how much buffering it is performing.

You could change ffmpeg2theora to only insert a single frame per ogg
page easily enough.

            if (info->v_pkg>22 && ogg_stream_flush(&info->to, &og)) {
            if (info->a_pkg>22 && ogg_stream_flush(&info->vo, &og)) {

in theorautil.c down to 1 should be enough.

> Other thing that i've noticed is that for static images (i.e) a static
> bitmap on every frame (with these options), the bitrate does not have "d
> ffmpeg2theora /dev/video0  -f video4linux2 --inputfps 12 -x 352 -y 288 -A 32
> -V 500 -K 2  -d 1 -o - | oggfwd localhost 8000 hackme /teste.ogv

You appear to have been cut off here.

More information about the theora mailing list