[FFmpeg-devel] [PATCH] dv: add timecode to metadata

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Dec 23 14:13:43 CET 2011


On Fri, Dec 23, 2011 at 01:26:35AM +0100, Matthieu Bouron wrote:
> 2011/12/22 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:
> > On Thu, Dec 22, 2011 at 10:29:52PM +0100, Matthieu Bouron wrote:
> >> +static int dv_extract_timecode(DVDemuxContext* c, uint8_t* frame, char tc[32])
> >> +{
> >> +    int hh, mm, ss, ff, df;
> >> +    const uint8_t* tc_pack;
> >
> > Having the space between type and * and not between * and name is more
> > consistent with the rest of the code (and also more consistent with the
> > actual semantics).
> >
> >> +    ff  = tc_pack[1]         & 0xf;
> >> +    ff += ((tc_pack[1] >> 4) & 0x3) * 10;
> >> +    df  = ((tc_pack[1] >> 6) & 0x1);
> >> +    df  = (tc_pack[1]  >> 6) & 0x1;
> >> +    ss  = tc_pack[2]         & 0xf;
> >> +    ss += ((tc_pack[2] >> 4) & 0x7) * 10;
> >> +    mm  = tc_pack[3]         & 0xf;
> >> +    mm += ((tc_pack[3] >> 4) & 0x7) * 10;
> >> +    hh  = tc_pack[4]         & 0xf;
> >> +    hh += ((tc_pack[4] >> 4) & 0x1) * 10;
> >
> > What is the exact format?
> 
> The format is described in the SMPTE 314M.
> For 525/60 Systems:
> 
> CF (1b)  DF(1b)         TENS OF FRAME(2b)    UNITS OF FRAME(4b)
> PC (1b)               TENS OF SECONDS (3b)    UNITS OF SECONDS(4b)
> BGF0(1b)              TENS OF MINUTES (3b)    UNITS OF MINUTES(4b)
> BGF2(1b) BGF1(1b)   TENS OF HOURS(2b)    UNITS OF HOURS (4b)
> 
> The only difference for PAL system, is that the DF (drop_frame) flag
> is ignored (defined as arbitrary).

I'd still be in favour of exporting its value as is, or would you
expect any issue with that?


More information about the ffmpeg-devel mailing list