libquicktime
Timecodes

Timecode support. More...

Macros

#define LQT_TIMECODE_DROP   0x0001
 Indicates whether the timecode is drop frame.
#define LQT_TIMECODE_24HMAX   0x0002
 Indicates whether the timecode wraps after 24 hours.
#define LQT_TIMECODE_NEG_OK   0x0004
 Indicates whether negative time values are allowed.
#define LQT_TIMECODE_COUNTER   0x0008
 Indicates whether the time value corresponds to a tape counter value.

Functions

void lqt_add_timecode_track (quicktime_t *file, int track, uint32_t flags, int framerate)
 Attach a timecode track to a video track.
void lqt_write_timecode (quicktime_t *file, int track, uint32_t timecode)
 Write a timecode for the next video frame to be encoded.
int lqt_has_timecode_track (quicktime_t *file, int track, uint32_t *flags, int *framerate)
 Check, if a video track has timecodes.
int lqt_read_timecode (quicktime_t *file, int track, uint32_t *timecode)
 Read the timecode for the next frame to be decoded.
const char * lqt_get_timecode_tape_name (quicktime_t *file, int track)
 Get the tape name stored in a timecode track.
void lqt_set_timecode_tape_name (quicktime_t *file, int track, const char *tapename)
 Set the tapename for a timecode track.
int lqt_get_timecode_track_enabled (quicktime_t *file, int track)
 Get the enabled flag of a timecode track.
void lqt_set_timecode_track_enabled (quicktime_t *file, int track, int enabled)
 Enable or disable a timecode track.

Detailed Description

Timecode support.

Timecodes are passed to/from libquicktime in the same format as they are stored in the file: 32 bit unsigned integers. For the meaning of the bits, see the section "Timecode Sample Data" in the Quicktime file format specification.

Macro Definition Documentation

◆ LQT_TIMECODE_DROP

#define LQT_TIMECODE_DROP   0x0001

Indicates whether the timecode is drop frame.

◆ LQT_TIMECODE_24HMAX

#define LQT_TIMECODE_24HMAX   0x0002

Indicates whether the timecode wraps after 24 hours.

◆ LQT_TIMECODE_NEG_OK

#define LQT_TIMECODE_NEG_OK   0x0004

Indicates whether negative time values are allowed.

◆ LQT_TIMECODE_COUNTER

#define LQT_TIMECODE_COUNTER   0x0008

Indicates whether the time value corresponds to a tape counter value.

Function Documentation

◆ lqt_add_timecode_track()

void lqt_add_timecode_track ( quicktime_t * file,
int track,
uint32_t flags,
int framerate )

Attach a timecode track to a video track.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
flagsZero or more of the LQT_TIMECODE_* flags
framerateThe integer framerate

If the format (e.g. AVI) doesn't support timecode, this function emits a warning.

Since 1.1.0

References lqt_add_timecode_track().

Referenced by lqt_add_timecode_track().

◆ lqt_write_timecode()

void lqt_write_timecode ( quicktime_t * file,
int track,
uint32_t timecode )

Write a timecode for the next video frame to be encoded.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)

Call this function before encoding the actual video frame.

Since 1.1.0

References lqt_write_timecode().

Referenced by lqt_write_timecode().

◆ lqt_has_timecode_track()

int lqt_has_timecode_track ( quicktime_t * file,
int track,
uint32_t * flags,
int * framerate )

Check, if a video track has timecodes.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
flagsIf non NULL returns zero or more of the LQT_TIMECODE_* flags
framerateIf non NULL returns the integer framerate
Returns
1 if timecodes are available, 0 else

Since 1.1.0

References lqt_has_timecode_track().

Referenced by lqt_has_timecode_track().

◆ lqt_read_timecode()

int lqt_read_timecode ( quicktime_t * file,
int track,
uint32_t * timecode )

Read the timecode for the next frame to be decoded.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
timecodeReturns the timecode if available
Returns
1 if a timecode is available for this frame, 0 else

For frames, which have no timecode attached, you can increment the last timecode accordingly in your application. Call this function before decoding the actual video frame.

Since 1.1.0

References lqt_read_timecode().

Referenced by lqt_read_timecode().

◆ lqt_get_timecode_tape_name()

const char * lqt_get_timecode_tape_name ( quicktime_t * file,
int track )

Get the tape name stored in a timecode track.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
Returns
pointer to tape name (might be NULL if no tape name)

Returned pointer should remain valid as long as the file is open. Do not free it.

Since 1.1.0

References lqt_get_timecode_tape_name().

Referenced by lqt_get_timecode_tape_name().

◆ lqt_set_timecode_tape_name()

void lqt_set_timecode_tape_name ( quicktime_t * file,
int track,
const char * tapename )

Set the tapename for a timecode track.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
tapenameTape name string

A copy is made of the string passed in

Since 1.1.0

References lqt_set_timecode_tape_name().

Referenced by lqt_set_timecode_tape_name().

◆ lqt_get_timecode_track_enabled()

int lqt_get_timecode_track_enabled ( quicktime_t * file,
int track )

Get the enabled flag of a timecode track.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
Returns
1 if enabled, 0 if not enabled

Since 1.1.0

References lqt_get_timecode_track_enabled().

Referenced by lqt_get_timecode_track_enabled().

◆ lqt_set_timecode_track_enabled()

void lqt_set_timecode_track_enabled ( quicktime_t * file,
int track,
int enabled )

Enable or disable a timecode track.

Parameters
fileA quicktime handle
trackVideo track index (starting with 0)
enabled0=>disable otherwise enable

Since 1.1.0

References lqt_set_timecode_track_enabled().

Referenced by lqt_set_timecode_track_enabled().