[Ffmpeg-devel] [PATCH] DV timecode

Michael Niedermayer michaelni
Sun Apr 15 16:01:54 CEST 2007


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


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

it is

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

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- 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/682e5735/attachment.pgp>



More information about the ffmpeg-devel mailing list