[Ffmpeg-devel] low_delay and has_b_frames

Michael Niedermayer michaelni
Sat Nov 11 18:55:09 CET 2006


Hi

On Sat, Nov 11, 2006 at 03:45:06PM +0100, Baptiste Coudurier wrote:
> Baptiste Coudurier a ?crit :
> >Hi
> >
> >I noticed that even when using -intra, encoder avctx has has_b_frames
> >set to 1.
> >
> >I checked mpegvideo.c and indeed:
> >
> >@@ -1169,12 +1169,12 @@
> >     switch(avctx->codec->id) {
> >     case CODEC_ID_MPEG1VIDEO:
> >         s->out_format = FMT_MPEG1;
> >-        s->low_delay= 0; //s->max_b_frames ? 0 : 1;
> >+        s->low_delay= s->max_b_frames ? 0 : 1;
> >         avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1);
> >         break;
> >     case CODEC_ID_MPEG2VIDEO:
> >         s->out_format = FMT_MPEG1;
> >-        s->low_delay= 0; //s->max_b_frames ? 0 : 1;
> >+        s->low_delay= s->max_b_frames ? 0 : 1;
> >         avctx->delay= s->low_delay ? 0 : (s->max_b_frames + 1);
> >         s->rtp_mode= 1;
> >         break;
> >
> >later:
> >    avctx->has_b_frames= !s->low_delay;
> >
> >What is the reason behind not using max_b_frames ?

avcodec.h:
    /**
     * if 1 the stream has a 1 frame delay during decoding.
     * - encoding: set by lavc
     * - decoding: set by lavc
     */
    int has_b_frames;


> >Should I modify has_b_frames set by taking max_b_frames into account ?
> >
> 
> Ping, any idea ?

... about changing low delay
iam against changing the default unless you ensure that this is ok with
things like VCD/SVCD/DVD and so on

adding optional low delay support via CODEC_FLAG_LOW_DELAY is fine though

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list