Decode text. More...
Functions | |
int | lqt_text_tracks (quicktime_t *file) |
Get the number of text tracks. | |
int | lqt_get_text_language (quicktime_t *file, int track, char *language) |
Get the text language. | |
int | lqt_text_time_scale (quicktime_t *file, int track) |
Get the timescale for a text track. | |
void | lqt_get_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. | |
int | lqt_read_text (quicktime_t *file, int track, char **text, int *text_alloc, int64_t *timestamp, int64_t *duration) |
Read a text sample. | |
int | lqt_is_chapter_track (quicktime_t *file, int track) |
Check if a track is a chapter track. | |
int64_t | lqt_text_samples (quicktime_t *file, int track) |
Get the total number of text samples. | |
void | lqt_set_text_position (quicktime_t *file, int track, int64_t position) |
Go to a specific sample. | |
void | lqt_set_text_time (quicktime_t *file, int track, int64_t time) |
Go to a specific time. | |
void | lqt_get_text_fg_color (quicktime_t *file, int track, uint16_t *r, uint16_t *g, uint16_t *b, uint16_t *a) |
Get the foreground color of a text track. | |
void | lqt_get_text_bg_color (quicktime_t *file, int track, uint16_t *r, uint16_t *g, uint16_t *b, uint16_t *a) |
Get the background color of a text track. | |
int64_t | lqt_get_text_pts_offset (quicktime_t *file, int track) |
Get an video pts offset. |
Decode text.
int lqt_text_tracks | ( | quicktime_t * | file | ) |
Get the number of text tracks.
file | A quicktime handle |
int lqt_get_text_language | ( | quicktime_t * | file, | |
int | track, | |||
char * | language | |||
) |
Get the text language.
file | A quicktime handle | |
track | Track index (starting with 0) | |
language | Returns ISO-639 Language code |
The language code is a 3-character code, English is "eng", Japanese is "jpn".
int lqt_text_time_scale | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the timescale for a text track.
file | A quicktime handle | |
track | Track index (starting with 0) |
void lqt_get_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.
file | A quicktime handle | |
track | Track index (starting with 0) | |
top | Returns the top border | |
left | Returns the left border | |
bottom | Returns the bottom border | |
right | Returns the right border |
int lqt_read_text | ( | quicktime_t * | file, | |
int | track, | |||
char ** | text, | |||
int * | text_alloc, | |||
int64_t * | timestamp, | |||
int64_t * | duration | |||
) |
Read a text sample.
file | A quicktime handle | |
track | Track index (starting with 0) | |
text | Address of a buffer | |
text_alloc | Allocated bytes for this buffer (will be changed) | |
timestamp | Returns the timestamp of the sample | |
duration | Returns the duration of the sample |
This funtion calls realloc() to make sure there is enough space for for the text. It's a good idea to always pass the same buffer to this function (set to NULL initially) and free it after the file is closed.
int lqt_is_chapter_track | ( | quicktime_t * | file, | |
int | track | |||
) |
Check if a track is a chapter track.
file | A quicktime handle | |
track | Track index (starting with 0) |
int64_t lqt_text_samples | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the total number of text samples.
file | A quicktime handle | |
track | Track index (starting with 0) |
void lqt_set_text_position | ( | quicktime_t * | file, | |
int | track, | |||
int64_t | position | |||
) |
Go to a specific sample.
file | A quicktime handle | |
track | Track index (starting with 0) | |
position | The sample position (starting with 0) |
void lqt_set_text_time | ( | quicktime_t * | file, | |
int | track, | |||
int64_t | time | |||
) |
Go to a specific time.
file | A quicktime handle | |
track | Track index (starting with 0) | |
time | Time |
This wil reposition the text track such, that the next call to lqt_read_text will return a sample with at least the timestamp you specified.
void lqt_get_text_fg_color | ( | quicktime_t * | file, | |
int | track, | |||
uint16_t * | r, | |||
uint16_t * | g, | |||
uint16_t * | b, | |||
uint16_t * | a | |||
) |
Get the foreground color of a text track.
file | A quicktime handle | |
track | Track index (starting with 0) | |
r | Returns red | |
g | Returns green | |
b | Returns blue | |
a | Returns alpha |
Color values are between 0x0000 and 0xffff.
void lqt_get_text_bg_color | ( | quicktime_t * | file, | |
int | track, | |||
uint16_t * | r, | |||
uint16_t * | g, | |||
uint16_t * | b, | |||
uint16_t * | a | |||
) |
Get the background color of a text track.
file | A quicktime handle | |
track | Track index (starting with 0) | |
r | Returns red | |
g | Returns green | |
b | Returns blue | |
a | Returns alpha |
Color values are between 0x0000 and 0xffff.
int64_t lqt_get_text_pts_offset | ( | quicktime_t * | file, | |
int | track | |||
) |
Get an video pts offset.
file | A quicktime handle | |
track | Track index (starting with 0) |