[FFmpeg-devel] Issue 3052

Benoit Fouet benoit.fouet at free.fr
Thu Jul 17 16:28:07 CEST 2014


Hi,

----- Mail original -----
> On Wed, Jul 16, 2014 at 05:40:35PM +0200, Benoit Fouet wrote:
> > 
> > 
> > ----- Mail original -----
> > > Hi,
> > > 
> > > I had a look at https://trac.ffmpeg.org/ticket/3052.
> > > The issue is that the last frame duration is lost. Is there any
> > > reason why the packet duration is not transmitted from the
> > > demuxer
> > > to the muxer?
> > > Attached is a dumb patch, just to understand a bit more why
> > > things
> > > are done the way they are...
> > > 
> > 
> > e.g., by dumb, I mean that the duration should be corrected with
> > the right timebase... But I just want to get feedback on the
> > forwarding part.
> 
> pkt_duration and pkt_timebase where primarly intended for the decoder
> side, they could be used for encoder too but i guess filters dont
> update them currently
> 

I'll try to address the filter case as a separate issue anyway, so this shouldn't be an issue; at least for now.

> that is:
> 
> @@ -2063,6 +2063,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
>              avpkt->size = 0;
>          else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
>              avpkt->pts = avpkt->dts = frame->pts;
> +        if (frame && av_codec_get_pkt_timebase(avctx).num)
> +            avpkt->duration =
> av_rescale_q(av_frame_get_pkt_duration(frame),
> +
>                                           av_codec_get_pkt_timebase(avctx),
> +                                           avctx->time_base);
> 
>          if (needs_realloc && avpkt->data) {
>              ret = av_buffer_realloc(&avpkt->buf, avpkt->size +
>              FF_INPUT_BUFFER_PADDING_SIZE);
> 

I'll try to add the time_base in the AVFrame then, so that the information is there with the duration.
I should post a patch soon to do this, and test it on the GIF issue from issue 3052

-- 
Ben


More information about the ffmpeg-devel mailing list