libquicktime
Functions
Writing text

Encode text. More...

Functions

int lqt_add_text_track (quicktime_t *file, int timescale)
 Add a text track. More...
 
void lqt_set_text_language (quicktime_t *file, int track, const char *language)
 Set the language for a text track. More...
 
void lqt_set_chapter_track (quicktime_t *file, int track)
 Make a text track a chapter track. More...
 
void lqt_set_text_box (quicktime_t *file, int track, uint16_t top, uint16_t left, uint16_t bottom, uint16_t right)
 Set the text box of a text track. More...
 
void lqt_set_text_fg_color (quicktime_t *file, int track, uint16_t r, uint16_t g, uint16_t b, uint16_t a)
 Set the foreground color of a text track. More...
 
void lqt_set_text_bg_color (quicktime_t *file, int track, uint16_t r, uint16_t g, uint16_t b, uint16_t a)
 Set the background color of a text track. More...
 
int lqt_write_text (quicktime_t *file, int track, const char *text, int64_t duration)
 Write a text sample. More...
 
void lqt_set_text_pts_offset (quicktime_t *file, int track, int64_t offset)
 Set an video pts offset. More...
 

Detailed Description

Encode text.

Function Documentation

int lqt_add_text_track ( quicktime_t file,
int  timescale 
)

Add a text track.

Parameters
fileA quicktime handle
timescaleThe timescale, in which timestamps will be given.
void lqt_set_text_language ( quicktime_t file,
int  track,
const char *  language 
)

Set the language for a text track.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)
languageISO-639 Language code

The language code is a 3-character code, English is "eng", Japanese is "jpn".

void lqt_set_chapter_track ( quicktime_t file,
int  track 
)

Make a text track a chapter track.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)

By default, text tracks are subtitles. By calling this function, you tell libquicktime, that the text track should be a chapter track.

void lqt_set_text_box ( quicktime_t file,
int  track,
uint16_t  top,
uint16_t  left,
uint16_t  bottom,
uint16_t  right 
)

Set the text box of a text track.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)
topTop border
leftLeft border
bottomBottom border
rightRight border
void lqt_set_text_fg_color ( quicktime_t file,
int  track,
uint16_t  r,
uint16_t  g,
uint16_t  b,
uint16_t  a 
)

Set the foreground color of a text track.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)
rRed
gGreen
bBlue
aAlpha

Color values are between 0x0000 and 0xffff. The alpha value is only used for mp4.

void lqt_set_text_bg_color ( quicktime_t file,
int  track,
uint16_t  r,
uint16_t  g,
uint16_t  b,
uint16_t  a 
)

Set the background color of a text track.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)
rRed
gGreen
bBlue
aAlpha

Color values are between 0x0000 and 0xffff. The alpha value is only used for mp4. For Quicktime, the text box is set to transparent if the alpha value is below 0x8000.

int lqt_write_text ( quicktime_t file,
int  track,
const char *  text,
int64_t  duration 
)

Write a text sample.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)
textA null-terminated UTF-8 string
durationThe duration associated with this sample
Returns
0 if a the text sample could be written to the file, nonzero else
void lqt_set_text_pts_offset ( quicktime_t file,
int  track,
int64_t  offset 
)

Set an video pts offset.

Parameters
fileA quicktime handle
trackTrack index (starting with 0)
offsetPTS offset of the subtitles (in timescale units)