[Ffmpeg-devel] [PATCH] DV timecode

Baptiste Coudurier baptiste.coudurier
Sun Apr 15 17:04:57 CEST 2007


Michael Niedermayer wrote:
> Hi
> 
> On Sun, Apr 15, 2007 at 04:22:32PM +0200, Baptiste Coudurier wrote:
>> Michael Niedermayer wrote:
>>> Hi
>>>
>>> On Sun, Apr 15, 2007 at 03:27:28PM +0200, Baptiste Coudurier wrote:
>>>> Michael Niedermayer wrote:
>>>>> [...]
>>>>>
>>>>> what a mess
>>>>> see opt_rec_timestamp()
>>>> It does not do what I want my helper function to do.
>>> your "helper" function is much more complex than needed, also it
>>> uses a unaccpetable syntax, parse_date() as used in opt_rec_timestamp() is
>>> exactly what should be used
>> No, timecode is not a date, and parse_date has no support for ';'.
> 
> correct syntax is hour:minute:second.millisecond
> exactly what parse_date() uses
> we will not add another syntax for a similar command line option

correct syntax is hour:minutes:seconds:frames

>>>>> [...]
>>>>>>              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
>>>>>
>> It was added by YOU at r2713. 
> 
> nonsense, the code actually was added by fabrice
> r2713 was a unrelated change

nonsense in r2713 you changed timecode to use coded_picture_number.
Why did you do that if it was wrong ?

-            time_code = s->fake_picture_number;
-            s->gop_picture_number = s->fake_picture_number;
+            time_code = s->current_picture_ptr->coded_picture_number;
+
+            s->gop_picture_number = time_code;


>> Does encoder support frame/field repetition ?
> 
> put_bits(&s->pb, 1, s->repeat_first_field);
> 
> so id say yes the encoder mpeg12.c does support it

and where is it handled and/or set ?

mpegvideo.c:            assert(s->repeat_first_field==0);
when update vbv delay also.

[...]

-- 
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