[Ffmpeg-devel] [PATCH] remove drop timecode flag

Michael Niedermayer michaelni
Mon Apr 16 03:00:32 CEST 2007


Hi

On Sun, Apr 15, 2007 at 03:58:30PM -0700, Trent Piepho wrote:
[...]
> > also what exactly is the problem with just setting the true sec/min/hour
> > and frame within that second as mandated by mpeg4 in the mpeg2 case too
> > if its really just an abstract ID?
> 
> I'm not sure what you mean by "frame within that second".
> 
> In your method, what is the formula for the timecode values for frame i at
> 30000/1001?
> 
> Do you mean:
> double t = i * 1001 / 30000;
> int hours = (int)(t/3600) % 60;
> int mins = (int)(t/60) % 60;
> int secs = (int)(t) % 60;
> int frame = (t - (int)t)*30000.0/1001.0 + 0.5;

yes minus the floats and rounding


> 
> This has two problems.  One, it doesn't follow the SMPTE spec.  Frame
> 510 should have frame id '00:00:17;00', but this method gives it
> frame id '00:00:17;01'
> 
> This makes a difference!  How many frames are there between '00:00:16;00'
> and '00:00:17;10'?  

you dont know that due to frame/field repetition


> In SMPTE timecode, there are exactly 40 frames.  In
> this alternate timecode, there are a 39 frames.  The interval is different
> because it's not following the SMPTE spec.  It's not following the MPEG-2
> spec either.

mpeg2 says:
NOTE -      The information carried  by  time_code  plays  no  part  in  the
            decoding process.

so IMHO no matter what you set it to the file is still valid mpeg2


> 
> This alternate timecode also will use frame fields that go to :30, instead
> of always wrapping at :29.

this is caused by the rounding, i think without it 29 is max

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- 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/20070416/1a879c94/attachment.pgp>



More information about the ffmpeg-devel mailing list