[Ffmpeg-devel] Re: [PATCH] x264 avc encoding, movenc avcC, ctts

Michael Niedermayer michaelni
Mon Feb 20 19:48:33 CET 2006


Hi

On Mon, Feb 20, 2006 at 06:53:53PM +0100, Baptiste COUDURIER wrote:
> Michael Niedermayer wrote:
> > [...]
> > 
> > 
> > use trk->cluster[cl][id].cts= (pkt->pts - pkt->dts) * enc->time_base.num;
> > 
> 
> Humm. Here is what I get:
> 
> from generated sample (using pkt->pts - pkt->dts) * enc->time_base.num
> 
> timescale : 25
> stts : count 22 duration 1
> 
> count 1, duration 3600
> count 1, duration 10800
> count 2, duration 0
> count 1, duration 10800
> count 2, duration 0
> count 1, duration 10800
> count 2, duration 0
> count 1, duration 7200
> count 1, duration 0
> count 1, duration 3600
> count 1, duration 10800
> count 2, duration 0
> count 1, duration 10800
> 
> ...
> 
> from H264_GOP125.mp4 generated by FCP:
> 
> timescale : 2500
> stts : count 201 duration 100
> 
> count 1, duration 100
> count 1, duration 200
> count 1, duration 0
> count 1, duration 200
> count 1, duration 0
> count 1, duration 200
> count 1, duration 0
> count 1, duration 200
> count 1, duration 0
> count 1, duration 200
> count 1, duration 0
> 
> ...
> 
> pkt->dts - pkt->pts is a multiple of pkt->duration, the latter being 3600.
> 
> If I rescale I will get the right values. I must be missing something.

no, movenc.c is missing something
av_set_pts_info(s->streams[i], 64, 1, timescale);
and then 
trk->cluster[cl][id].cts= pkt->pts - pkt->dts;
should work

if not, tell me what happens ...

[...]

-- 
Michael





More information about the ffmpeg-devel mailing list