[FFmpeg-devel] Issue 3052
Michael Niedermayer
michaelni at gmx.at
Wed Jul 16 19:40:12 CEST 2014
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
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);
also there is
repeat_pict
which is the frame duration in codec time_base units
again, i suspect this is not updated by filters currently
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140716/8f8f814f/attachment.asc>
More information about the ffmpeg-devel
mailing list