[FFmpeg-devel] [PATCH] avcodec/gif: fix duration of last packet/frame
Paul B Mahol
onemda at gmail.com
Tue Aug 23 15:36:18 EEST 2022
On Tue, Aug 23, 2022 at 2:18 PM Andreas Rheinhardt <
andreas.rheinhardt at outlook.com> wrote:
> Paul B Mahol:
> > Hi,
> >
> > patch attached.
> >
> > return ret;
> > }
> >
> > + pkt->duration = av_rescale_q(pict->duration, (AVRational){ 1, 100 },
> > + avctx->time_base);
> > pkt->size = outbuf_ptr - pkt->data;
> > if (s->image || !avctx->frame_number)
> > pkt->flags |= AV_PKT_FLAG_KEY;
>
> Where does the magic 1/100 timebase come from? For encoding, the
> AVFrame's time base is supposed to be AVCodecContext.time_base. This
> could actually be done generically for all video-encoders without delay.
> (I know that AVFrame has a time_base of its own that is currently unset
> and unused.)
>
> It is from gif demuxer/"container", it uses 1/100 timebase.
Similar thing is done for audio encoders.
> - Andreas
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
More information about the ffmpeg-devel
mailing list