[FFmpeg-devel] [PATCH] stream copy packet duration

Aurelien Jacobs aurel
Wed Jul 25 18:08:45 CEST 2007


On Wed, 25 Jul 2007 17:58:18 +0200
Baptiste Coudurier <baptiste.coudurier at smartjog.com> wrote:

> Hi
> 
> Aurelien Jacobs wrote:
> > Hi,
> > 
> > Attached patch allows to copy packet duration when doing a stream copy.
> > This will be especially useful when stream copying subtitles.
> > Ok to apply ?
> > 
> > [...]
> >
> > + opkt.duration = av_rescale_q(av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q), AV_TIME_BASE_Q,  ost->st->time_base);
> >
> 
> Why not :
> 
> opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base,
> ost->st->time_base);

In fact I copied the way it's done for pts rescaling. But now that I think
about it, it was done this way because an offset is added to the pts.
And this offset must be relative to AV_TIME_BASE_Q.
So for duration, your proposition should be fine.
Updated patch attached.

Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pkt_duration_stream_copy.diff
Type: text/x-diff
Size: 700 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070725/51192cca/attachment.diff>



More information about the ffmpeg-devel mailing list