[Ffmpeg-devel] [PATCH] DV timecode

Baptiste Coudurier baptiste.coudurier
Sun Apr 15 15:27:28 CEST 2007


Michael Niedermayer wrote:
> [...]
> 
> what a mess
> see opt_rec_timestamp()

It does not do what I want my helper function to do.

> [...]
>>              time_code = s->current_picture_ptr->coded_picture_number + s->avctx->timecode_frame_start;
>>  
>>              s->gop_picture_number = s->current_picture_ptr->coded_picture_number;
>> -            if (s->avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE) {
>> -                /* only works for NTSC 29.97 */
>> -                int d = time_code / 17982;
>> -                int m = time_code % 17982;
>> -                //if (m < 2) m += 2; /* not needed since -2,-1 / 1798 in C returns 0 */
>> -                time_code += 18 * d + 2 * ((m - 2) / 1798);
>> -            }
>> +            if (s->avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE)
>> +                time_code = ff_drop_frame_timecode_adjust(time_code);
>>              put_bits(&s->pb, 5, (uint32_t)((time_code / (fps * 3600)) % 24));
>>              put_bits(&s->pb, 6, (uint32_t)((time_code / (fps * 60)) % 60));
>>              put_bits(&s->pb, 1, 1);
> 
> while it has been added by you in the past and not now the use of
> coded_picture_number is completely wrong, you MUST use the proper
> timestamp, even with mpeg1/2 timestamps differ from frame numbers
> due to frame / field repetion amongth others
> 

timecode is not timestamp.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list