OptiTrack Timecode
Overview
Timecode Integration
Note: SMPTE Timecode integration requires the eSync 2 hub.
Timecode Representation
When SMPTE timecode signal is available within a system, each frame of data will contain an OptiTrack timecode stamp, which is an extended form of the typical studio SMPTE timecode stamp. Since the frame rate of an OptiTrack mocap system typically exceeds standard SMPTE timecode frame rates, an additional “subframe” value is added at the end of the timecode stamp. This “subframe” value is 0-based and indicates increments of captured mocap frames in between every SMPTE timecode frames:
In the above sample representation, a 120 FPS motion capture session is synchronized to a sync source with 30 FPS no-drop SMPTE timecode signal. In this case, there is a 4 : 1 ratio of number motion capture frames to a single frame of the sync source, and the extra motion capture frames are represented by the OptiTrack SubFrame field in the OptiTrack timecode.
The generic form for OptiTrack timecode: HH:MM:SS:FF.Y (hours:minutes:seconds:frames.subframe)
NatNet: Timecode
OptiTrack encoded SMPTE timecode:
Unsigned int Timecode
OptiTrack encoded sub-frame data:
Unsigned int TimecodeSubframe
The Unsigned int Timecode
parameter is interpreted differently when streaming from a live data (Live Mode) compared to when streaming from a recorded playback (Edit Mode). The differences are listed below:
NatNet: Timecode Helper Functions
NatNet_DecodeTimecode
Helper function to decode OptiTrack timecode data into individual timecode values bool NatNet_DecodeTimecode(unsigned int inTimecode, unsigned int inTimecodeSubframe,
NatNet_TimecodeStringify
Helper function to decode OptiTrack timecode into a user friendly string in the form “hh:mm:ss:ff:yy” bool NatNet_TimecodeStringify(unsigned int inTimecode, unsigned int inTimecodeSubframe,
C++ Sample: Using the utility functions for timecode parameters
The following is an example of how to decode timecode using the NatNet helper functions (from the SampleClient.cpp example): // decode timecode to values int hour, minute, second, frame, subframe; bool bValid = pClient->DecodeTimecode(data->Timecode, data->TimecodeSubframe,
// decode timecode to friendly string char szTimecode[128] = ""; pClient->TimecodeStringify(data->Timecode, data->TimecodeSubframe, szTimecode, 128); printf("Timecode : %s\n", szTimecode);
Last updated