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

Trent Piepho xyzzy
Sun Apr 15 22:21:16 CEST 2007

On Sun, 15 Apr 2007, Michael Niedermayer wrote:
> > > SMPTE timescodes are hour:minute:second:frame and should be unique for each
> > > frame.  The frame wraps from 29 to 0.  E.g., after '0:0:0:29' follows
> > > '0:0:01:00'.
> > >
> > well iam not entirely sure what mpeg2 mandates in the non drop frame case
> > but mpeg4 requires 01:00:00:00 after an hour no matter if 30000/1001
> > fps or 12.5 fps or anything else, mpeg4 does not even support drop timecode
> >
> > now if mpeg2 behaves the same (it doesnt seem so) then we have no problem
> > at all, if it differs then timecode is codec specific and IMHO its not
> > the users job to know these details, if this is really needed it belongs
> > into the encoder
> to quote the specific part in mpeg4 about timecode:
> time_code: This is a 18-bit integer containing the following: time_code_hours, time_code_minutes, marker_bit and
> time_code_seconds as shown in Table 6-19. The parameters correspond to those defined in the IEC standard
> publication 461 for time and control codes for video tape recorders. The time code specifies the modulo part (i.e.
>                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> the full second units) of the time base for the first object plane (in display order) after the GOV header.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is what mpeg-2 says:

This is a 25-bit integer containing the following:  drop_frame_flag,
time_code_hours, time_code_minutes, marker_bit, time_code_seconds and
time_code_pictures as shown in Table 6-11.  The parameters correspond to
those defined in the IEC standard publication 461 for 'time and control
codes for video tape recorders'  (see Bibliography, Annex G).  The time
code refers to the first picture after the group of pictures header that
has a temporal_reference of zero.  The drop_frame_flag can be set to either
'0' or '1'.  It may be set to '1' only if the frame rate is 29,97Hz.  If it
is '0' then pictures are counted assuming rounding to the nearest integral
number of pictures per second, for example 29,97Hz would be rounded to and
counted as 30Hz.  If it is '1' then picture numbers 0 and 1 at the start of
each minute, except minutes 0, 10, 20, 30, 40, 50 are omitted from the

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

This is what I've been saying.  When not using drop-frame timecode, each
and every frame increments the timecode counter by 1.  They describe it a
bit differently, but if you think about it the result is exactly the same.

In drop-frame the counter skips ahead by 2 frames each minute, except on
multiple of ten.

> if someone has the IEC 461 spec iam surely interrested to take a look ...

I bet this is very similar to what you would see in that spec:

More information about the ffmpeg-devel mailing list