[FFmpeg-devel] [PATCH] h264 ticks and time base

Baptiste Coudurier baptiste.coudurier
Sat Jun 20 08:15:46 CEST 2009


Michael Niedermayer wrote:
> On Wed, Jun 17, 2009 at 04:58:34PM -0700, Baptiste Coudurier wrote:
>> Michael Niedermayer wrote:
>>> On Sun, Jun 14, 2009 at 10:42:11PM -0700, Baptiste Coudurier wrote:
>>>> Hi,
>>>>
>>>> 1) Set avctx time_base in h264 parser.
>>>> 2) Set avctx ticks_per_frame in h264 decoder.
>>>>
>>>> I don't get this code in decode_init in h264.c
>>>>
>>>>     reset_sei(h);
>>>>     if(avctx->codec_id == CODEC_ID_H264){
>>>>         if(avctx->ticks_per_frame == 1){
>>>>             s->avctx->time_base.den *=2;
>>>>         }
>>>>         avctx->ticks_per_frame = 2;
>>>>     }
>>>>     return 0;
>>>>
>>>> avctx->ticks_per_frame is not set before calling the decoder
>>>> in any case. Should that be removed ?
>>> what do you mean by "that" ?
>> the if(avctx->ticks_per_frame == 1)
> 
> i think it was needed because the codec might be ininted then closed and
> then ininted again, but i may misremember

Oh, hackish isn't it ?
Nothing seems to set ticks_per_frame to 1 in h264 though.

libavcodec/h264.c:        if(avctx->ticks_per_frame == 1){
libavcodec/h264.c:        avctx->ticks_per_frame = 2;
libavcodec/h264.c:            s->avctx->ticks_per_frame = 2;
libavcodec/h264_parser.c:                avctx->ticks_per_frame = 2;
libavcodec/mpeg12.c:            avctx->ticks_per_frame=1;
libavcodec/mpeg12.c:            avctx->ticks_per_frame=2;
libavcodec/options.c:{"ticks_per_frame", NULL, OFFSET(ticks_per_frame),
FF_OPT_TYPE_INT, 1, 1, INT_MAX, A|V|E|D},
libavcodec/avcodec.h:    int ticks_per_frame;

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list