[FFmpeg-devel] [PATCH] fix stream copy
Mon Feb 1 09:58:52 CET 2010
Baptiste Coudurier ???????(??):
> Well the problem is the definition of sync_opts:
> int64_t sync_opts; /* output frame counter, could be changed
> to some true timestamp */ //FIXME look at frame_number
> With your patch the definition would become wrong in some cases.
i think definition is already wrong, because of codec->time_base is not
equal to framerate, so the opts calculation in ffmpeg.c:
 if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO)
 opts = ost->sync_opts *
already mentioned to codec->time_base units instead of frame counter...
>>> One other possible solution is to use pts.val when stream copy is used.
>> it will require changing another part of code where ost->sync_opts used
>> for stop condition or keep previous packet pts to calc duration of
>> previous packet....
> Hummm, I'm not sure what you mean, but this seems to fix the issue for
> me. Can you confirm ?
i did not find a way to reproduce situation with pkt->duration==0, but
for other situation attached patch works for me and i am able to cut
proper fragment duration for all files i tested with.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 748 bytes
Desc: not available
More information about the ffmpeg-devel