libquicktime

- Main Page
- Modules
- Data Structures
- Files

Macros | Functions
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

#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.

## Function Documentation

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

Attach a timecode track to a video track.

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)
  flags | Zero or more of the LQT_TIMECODE_* flags
  framerate | The integer framerate

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

Since 1.1.0

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

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

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)

Call this function before encoding the actual video frame.

Since 1.1.0

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

Check, if a video track has timecodes.

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)
  flags | If non NULL returns zero or more of the LQT_TIMECODE_* flags
  framerate | If non NULL returns the integer framerate

Returns:
  1 if timecodes are available, 0 else

Since 1.1.0

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

Read the timecode for the next frame to be decoded.

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)
  timecode | Returns 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

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

Get the tape name stored in a timecode track.

Parameters:

  file | A quicktime handle
  track | Video 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

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

Set the tapename for a timecode track.

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)
  tapename | Tape name string

A copy is made of the string passed in

Since 1.1.0

int lqt_get_timecode_track_enabled | ( | quicktime_t * | file,
|  | int | track
| ) |  |

Get the enabled flag of a timecode track.

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)

Returns:
  1 if enabled, 0 if not enabled

Since 1.1.0

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

Enable or disable a timecode track.

Parameters:

  file | A quicktime handle
  track | Video track index (starting with 0)
  enabled | 0=>disable otherwise enable

Since 1.1.0