[FFmpeg-devel] [PATCH] fix stream copy

lou at fakeoutdoorsman.com lou
Mon Feb 1 20:30:41 CET 2010


On Mon, 1 Feb 2010 20:05:42 +0100
Michael Niedermayer <michaelni at gmx.at> wrote:

> 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
> 
> [...]

I submitted the following bug report and bcoudurier pointed me to this
thread, so I believe this bug report provides a relevant command
and sample:

https://roundup.ffmpeg.org/roundup/ffmpeg/issue1712

Lou



More information about the ffmpeg-devel mailing list