[FFmpeg-devel] [PATCH] fix stream copy

Michael Niedermayer michaelni
Mon Feb 1 20:05:42 CET 2010


On Mon, Feb 01, 2010 at 10:58:52AM +0200, Maksym Veremeyenko wrote:
> 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:
> [2222]            if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO)
> [2223]                opts = ost->sync_opts * 
> av_q2d(ost->st->codec->time_base);
> 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.

how can i reproduce the problem(s) this thread talks about?
sample file & command line please

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100201/b18fbf43/attachment.pgp>



More information about the ffmpeg-devel mailing list