[FFmpeg-devel] Live streaming of VP8

Michael Niedermayer michaelni at gmx.at
Sun Jun 10 01:20:42 CEST 2012


On Sat, Jun 09, 2012 at 02:50:33PM -0700, James Zern wrote:
> On Sat, Jun 9, 2012 at 8:14 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sat, Jun 09, 2012 at 04:51:23PM +0200, Andy Bell wrote:
> >> Hi All,
> >>
> >> I am streaming a VP8 stream over network and using the following code to
> >> encode:
> >>
> >> _bitRate = 500 * 1000;
> >> _codecContext->bit_rate = _bitRate; // --target-bitrate=500
> >> _codecContext->rc_min_rate = _codecContext->rc_max_rate =
> >> _codecContext->bit_rate; // --end-usage=cbr
> 
> Pairing vbr with realtime (quality=realtime/deadline=1) is probably a
> better choice for live encoding.
> 
> >>
> >> _codecContext->thread_count = 4;
> >> _codecContext->qmin = 4;
> >> _codecContext->qmax = 56;
> >> _codecContext->width = 800;
> >> _codecContext->height = 600;
> >> _codecContext->rc_buffer_aggressivity = 0.95;  // --undershoot-pct=95
> >> _codecContext->rc_buffer_size = _bitRate * 6; // --buz-sz=6000 ms
> >> _codecContext->rc_initial_buffer_occupancy = _bitRate * 4; //
> >> --buf-initial-sz=4000 ms
> >> _codecContext->profile = 3;
> 
> You probably don't want to set this. It impacts decode complexity at
> the cost of encode quality.
> 
> >> _codecContext->time_base.num = 1;
> >> _codecContext->time_base.den = 25;
> >> _codecContext->gop_size = 999999; // --kf-max-dist
> >>
> >> This works fine but when there is a huge scene change the codec generates a
> >> key frame which I am having trouble transmitting in realtime over the
> >> network due to the sudden jump in bitrate.
> >
> > rc_buffer_size indicates a wanted max latency of 6 seconds
> > if you want it to be less you can use a smaller value
> >
> 
> This will help overall bitrate spikes and as I mentioned on
> webm-discuss you might be looking for the max-intra-rate option. I've
> attached a patch to add this option.

>  configure              |    4 ++--
>  libavcodec/libvpxenc.c |    5 +++++
>  2 files changed, 7 insertions(+), 2 deletions(-)
> f1ac9b8b4f2a410e5571db744a2a289306912cbc  0001-libvpxenc-add-VP8E_SET_MAX_INTRA_BITRATE_PCT-mapping.patch
> From c93b99e6b9e1afccb5ca687ffe891386b3c449e5 Mon Sep 17 00:00:00 2001
> From: James Zern <jzern at google.com>
> Date: Sat, 9 Jun 2012 14:40:51 -0700
> Subject: [PATCH] libvpxenc: add VP8E_SET_MAX_INTRA_BITRATE_PCT mapping
> 
> defines 'max-intra-rate' in line with vpxenc param

applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120610/33a7cdba/attachment.asc>


More information about the ffmpeg-devel mailing list