[Ffmpeg-devel] Re: [PATCH] mov fps fix

Michael Niedermayer michaelni
Tue Jan 10 19:02:06 CET 2006


Hi

On Tue, Jan 10, 2006 at 05:47:07PM +0100, Baptiste COUDURIER wrote:
> Hi
> 
> Michael Niedermayer wrote:
> > Hi
> > 
> > [...]
> >
> > 1. you must also change/check dts&pts of the returned AVPackets
> > 2. use av_set_pts_info()
> > 3. use the greatest common divisor of all durations would be more general
> > 
> 
> All right, i changed the code according to your suggestions. Is it
> correct now ?
> 
> Btw, is it preferred to keep time_base as 40/1000 for example, or to
> reduce it to 1/25 ?

reduce


> 
> I did not get point 3, did you mean all "stts" samples durations ?

yes gcd(duration1, duration2, ..., durationN)


> 
> I was wondering if there was any "coding style" guide for ffmpeg. Do you
> know if such document exists ?

http://ffmpeg.org/ffmpeg-doc.html#SEC33


[...]
> -        pkt->pts = pts;
> -        pkt->dts = dts;
> +        pkt->pts = av_rescale(pts,
> +                   (int64_t)s->streams[sc->ffindex]->time_base.den,
> +                   (int64_t)sc->time_scale * (int64_t)s->streams[sc->ffindex]->time_base.num);	 
> +        pkt->dts = av_rescale(dts,
> +                   (int64_t)s->streams[sc->ffindex]->time_base.den,	 
> +                   (int64_t)sc->time_scale * (int64_t)s->streams[sc->ffindex]->time_base.num);

could you add a assert() here to ensure that the conversation is exact? i 
know it should be exact but better double check to catch (future) bugs quickly

[...]

-- 
Michael





More information about the ffmpeg-devel mailing list