openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Timecodes...


From: Kevin Wheatley
Subject: [Openexr-devel] Timecodes...
Date: Fri, 01 Oct 2004 11:56:41 +0100

Ken McGaugh wrote:
> Thanks again to everybody and I apologise to those who are bored stiff of this
> conversation.  Now we need to discuss timecode, which is just an unsigned 
> 32-bit
> integer, but IlmImf only supports signed 32-bit integers.  What to do... :)

BCD encoded fields ?? - 
Frames per second
Drop frame (NTSC and PAL-M types)
non-drop frame
user bits as well as normal timecode?

Now do we care about field sequence position? I don't think so.

Do you then provide supporting functions to turn timecode into frame
numbers and back again I belive it to be useful as some DI systems use
the frame number as an indicator of timecode, other use DPX header
info, some offer the option of both. (I do not recomend anybody use
SMPTE EG40 as anything other than a cross check though as its erm a
little complicated to work out what they were doing whan they wrote
that... i don't think they heard of separation of concerns)

As such store the timecode as an integer offset and then store the
format in terms of frameRate and dropFrameMode (3 types), you can then
compute the number back again. this doesn't say what to do with the
user bits though.

Kevin

P.S. Drop frame modes...

IEC refers to drop-frame mode of M/NTSC and M/PAL as Mode 1,
non-drop-frame mode is Mode 0

M/NTSC drop-frame is drop 2 frames every minute except every 10
totalling 108 frames per hour
M/PAL drop-frame is drop 4 frames every even minute except every 20
again totalling 108 drops per hour

Both count frames [0-29] and should run at 29.97fps

P.P.S. TC<->frame counts

>From timecodes, its easier to convert assuming no frop frames then
subtract the droped ones:

  $mins = $mins + $hrs * 60;
  my ($frames) = (((($mins)*60)+$secs)*$fps)+$frms;
  
  if ($frame_mode == 1 && $standard eq "M/NTSC")
  {
    $frames = $frames - (2 * $mins) + (2 * int($mins /
10));            # Subtract 2 frames per minute except every 10
  }
  elsif ($frame_mode == 1 && $standard eq "M/PAL")
  {
    $frames = $frames - (4 * int($mins/2)) + (4 * int($mins / 20)); #
Subtract 4 frames per even minute except every 20
  }
  return ($frames);

>From a frame count add the extra dropped frames and then convert back
to hours minutes seconds and frames.

-- 
| Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this      |
| Senior Technology                     | My employer for certain |
| And Network Systems Architect         | Not even myself         |




reply via email to

[Prev in Thread] Current Thread [Next in Thread]