[FFmpeg-devel] Short last frame with movenc

Al Crate al at dneg.com
Fri Sep 21 17:34:21 CEST 2012


movenc.c is setting the time_base.num value to 1 for all the AVStreams, 
it doesn`t seem to handle any other form of time_base


in the folloing function

static int mov_write_header(AVFormatContext *s)
		

it does this

av_set_pts_info(st, 64, 1, track->timescale);

so a time_base of 25/600 becomes 1/600 and everything goes to pot.




On 21/09/12 03:12, Michael Niedermayer wrote:
> On Thu, Sep 20, 2012 at 04:41:51PM +0100, Al Crate wrote:
>> Hi, I`m trying to encoded a prores movie into a mov container.
>>
>> This works fine with
>>
>> time_base.den = 24
>> time_base.num = 1
>>
>> But if I try
>>
>> time_base.den = 600
>> time_base.num = 25
>>
>> I get problems with moveenc setting the duration of the last frame
>> to 1, instead of 25.
>>
>> It looks like oformat->write_header() which is called in
>> avformat_write_header is setting the AVStream time_base to 600:1
>> instead of 600:25.
>>
>> Can some one reproduce this, I did a packet dump and the durations
>> are all 0.0002, whereas using 24/1 they come out with the correct
>> duration of 0.042.
>>
>> Oddly the pts and dts values look right.
>>
>> Any help would be much appreciated, the odd time_base values are for
>> Final Cut Pro (yeah right) compatability.
>
> hmm, if you want to debug this, look first at if the AVPacket.duration
> is set correct for what the mov muxer (movenc.c) gets
> then if that is correct check if / where it gets lost on its way
> to the stts storing code
>
> [...]
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list