[Ffmpeg-devel] [PATCH] DV timecode

Michael Niedermayer michaelni
Sun Apr 15 16:51:58 CEST 2007


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


> 
> >>> [...]
> >>>>              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


> 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


> 
> >> timecode is not timestamp.
> > 
> > it is
> 
> No.

well, if it is or not the code is wrong which is the point the terminology
isnt

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070415/5c5693b6/attachment.pgp>



More information about the ffmpeg-devel mailing list