libquicktime

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

lqt.h
Go to the documentation of this file.
1 /*******************************************************************************
2 lqt.h
3
4 libquicktime - A library for reading and writing quicktime/avi/mp4 files.
5 http://libquicktime.sourceforge.net
6
7 Copyright (C) 2002 Heroine Virtual Ltd.
8 Copyright (C) 2002-2011 Members of the libquicktime project.
9
10 This library is free software; you can redistribute it and/or modify it under
11 the terms of the GNU Lesser General Public License as published by the Free
12 Software Foundation; either version 2.1 of the License, or (at your option)
13 any later version.
14
15 This library is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
18 details.
19
20 You should have received a copy of the GNU Lesser General Public License along
21 with this library; if not, write to the Free Software Foundation, Inc., 51
22 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 *******************************************************************************/
24
25 #ifndef _LQT_H_
26 #define _LQT_H_
27
28 #include "quicktime.h"
29 #include "lqt_atoms.h"
30 #include "compression.h"
31 #include "lqt_codecinfo.h"
32 #include "lqt_qtvr.h"
33
34 #ifdef __GNUC__
35 #pragma GCC visibility push(default)
36 #endif
37
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42
48 void *lqt_bufalloc(size_t size);
49
50
51
58 void lqt_set_log_callback(lqt_log_callback_t cb, void * data);
59
60
72 int lqt_fileno(quicktime_t *file);
73
85 void lqt_set_audio_parameter(quicktime_t *file,int track, const char *key,const void *value);
86
98 void lqt_set_video_parameter(quicktime_t *file,int track, const char *key,const void *value);
99
110 int lqt_get_pixel_aspect(quicktime_t *file, int track, int * pixel_width,
111 int * pixel_height);
112
123 int lqt_set_pixel_aspect(quicktime_t *file, int track, int pixel_width,
124 int pixel_height);
125
138 lqt_interlace_mode_t lqt_get_interlace_mode(quicktime_t * file, int track);
139
152 int lqt_set_interlace_mode(quicktime_t * file, int track,
153 lqt_interlace_mode_t mode);
154
155
161 const char * lqt_interlace_mode_to_string(lqt_interlace_mode_t mode);
162
173 lqt_chroma_placement_t lqt_get_chroma_placement(quicktime_t * file, int track);
174
181 const char * lqt_chroma_placement_to_string(lqt_chroma_placement_t chroma_placement);
182
193 int lqt_get_codec_api_version();
194
201 const char * lqt_channel_to_string(lqt_channel_t ch);
202
214 void lqt_set_channel_setup(quicktime_t * file, int track, lqt_channel_t * ch);
215
226 const lqt_channel_t * lqt_get_channel_setup(quicktime_t * file, int track);
227
228
261 int lqt_add_text_track(quicktime_t * file, int timescale);
262
272 void lqt_set_text_language(quicktime_t * file, int track, const char * language);
273
284 void lqt_set_chapter_track(quicktime_t * file, int track);
285
295 void lqt_set_text_box(quicktime_t * file, int track,
296 uint16_t top, uint16_t left,
297 uint16_t bottom, uint16_t right);
298
311 void lqt_set_text_fg_color(quicktime_t * file, int track,
312 uint16_t r, uint16_t g,
313 uint16_t b, uint16_t a);
314
328 void lqt_set_text_bg_color(quicktime_t * file, int track,
329 uint16_t r, uint16_t g,
330 uint16_t b, uint16_t a);
331
332
333
334
343 int lqt_write_text(quicktime_t * file, int track, const char * text, int64_t duration);
344
362 int lqt_text_tracks(quicktime_t * file);
363
374 int lqt_get_text_language(quicktime_t * file, int track, char * language);
375
382 int lqt_text_time_scale(quicktime_t * file, int track);
383
393 void lqt_get_text_box(quicktime_t * file, int track,
394 uint16_t * top, uint16_t * left,
395 uint16_t * bottom, uint16_t * right);
396
397
412 int lqt_read_text(quicktime_t * file, int track, char ** text, int * text_alloc,
413 int64_t * timestamp, int64_t * duration);
414
422 int lqt_is_chapter_track(quicktime_t * file, int track);
423
430 int64_t lqt_text_samples(quicktime_t * file, int track);
431
438 void lqt_set_text_position(quicktime_t * file, int track, int64_t position);
439
450 void lqt_set_text_time(quicktime_t * file, int track, int64_t time);
451
463 void lqt_get_text_fg_color(quicktime_t * file, int track,
464 uint16_t * r, uint16_t * g,
465 uint16_t * b, uint16_t * a);
466
478 void lqt_get_text_bg_color(quicktime_t * file, int track,
479 uint16_t * r, uint16_t * g,
480 uint16_t * b, uint16_t * a);
481
497 #define LQT_TIMECODE_DROP 0x0001
498 #define LQT_TIMECODE_24HMAX 0x0002
499 #define LQT_TIMECODE_NEG_OK 0x0004
500 #define LQT_TIMECODE_COUNTER 0x0008
501
502
514 void lqt_add_timecode_track(quicktime_t * file, int track,
515 uint32_t flags, int framerate);
516
526 void lqt_write_timecode(quicktime_t * file, int track,
527 uint32_t timecode);
528
539 int lqt_has_timecode_track(quicktime_t * file, int track,
540 uint32_t * flags, int * framerate);
541
556 int lqt_read_timecode(quicktime_t * file, int track,
557 uint32_t * timecode);
558
570 const char * lqt_get_timecode_tape_name(quicktime_t * file, int track);
571
582 void lqt_set_timecode_tape_name(quicktime_t * file, int track,
583 const char * tapename);
584
593 int lqt_get_timecode_track_enabled(quicktime_t * file, int track);
594
603 void lqt_set_timecode_track_enabled(quicktime_t * file, int track,
604 int enabled);
605
612 /***********************************************
613 * Advanced colormodel handling.
614 * (defined in lqt_color.c)
615 ***********************************************/
616
622 #define LQT_COLORMODEL_NONE -1
623
624 /* Colormodel <-> string conversion (used by registry file routines) */
625
632 const char * lqt_colormodel_to_string(int colormodel);
633
640 int lqt_string_to_colormodel(const char * str);
641
642 /* Query information about the colormodel */
643
650 int lqt_colormodel_is_planar(int colormodel);
651
658 int lqt_colormodel_has_alpha(int colormodel);
659
666 int lqt_colormodel_is_rgb(int colormodel);
667
674 int lqt_colormodel_is_yuv(int colormodel);
675
684 void lqt_colormodel_get_chroma_sub(int colormodel, int * sub_h, int * sub_v);
685
692 int lqt_colormodel_is_video_range(int colormodel);
693
707 void lqt_get_default_rowspan(int colormodel, int width, int * rowspan, int * rowspan_uv);
708
721 int lqt_colormodel_has_conversion(int in_cmodel, int out_cmodel);
722
723 /* Query supported colormodels */
724
730 int lqt_num_colormodels();
731
737 const char * lqt_get_colormodel_string(int index);
738
745 int lqt_get_colormodel(int index);
746
757 int lqt_get_decoder_colormodel(quicktime_t * file, int track);
758
770 int lqt_get_best_source_colormodel(int const* source_options, int target);
771
783 int lqt_get_best_target_colormodel(int source, int const* target_options);
784
801 int lqt_get_best_colormodel(quicktime_t * file, int track, int * supported);
802
813 int lqt_get_cmodel(quicktime_t * file, int track);
814
830 uint8_t ** lqt_rows_alloc(int width, int height, int colormodel, int * rowspan, int * rowspan_uv);
831
845 void lqt_rows_copy(uint8_t **out_rows, uint8_t **in_rows, int width, int height, int in_rowspan, int in_rowspan_uv,
846 int out_rowspan, int out_rowspan_uv, int colormodel);
847
867 void lqt_rows_copy_sub(uint8_t **out_rows, uint8_t **in_rows,
868 int width, int height, int in_rowspan,
869 int in_rowspan_uv, int out_rowspan,
870 int out_rowspan_uv, int colormodel, int src_x, int src_y, int dst_x, int dst_y);
871
888 void lqt_rows_clear(uint8_t **rows,
889 int width, int height, int rowspan, int rowspan_uv, int colormodel);
890
891
897 void lqt_rows_free(uint8_t ** rows);
898
899
900 /**************************************
901 * Set streams for encoding
902 **************************************/
903
917 int lqt_set_audio(quicktime_t *file, int channels,
918 long sample_rate, int bits,
919 lqt_codec_info_t * codec_info);
920
921
939 int lqt_set_video(quicktime_t *file, int tracks,
940 int frame_w, int frame_h,
941 int frame_duration, int timescale,
942 lqt_codec_info_t * codec_info);
943
944
961 int lqt_add_audio_track(quicktime_t *file,
962 int channels, long sample_rate, int bits,
963 lqt_codec_info_t * codec_info);
964
972 int lqt_set_audio_codec(quicktime_t *file, int track,
973 lqt_codec_info_t * info);
974
975
986 void lqt_set_audio_language(quicktime_t * file, int track, const char * language);
987
1006 int lqt_add_video_track(quicktime_t *file,
1007 int frame_w, int frame_h,
1008 int frame_duration, int timescale,
1009 lqt_codec_info_t * codec_info);
1010
1018 int lqt_set_video_codec(quicktime_t *file, int track,
1019 lqt_codec_info_t * info);
1020
1021
1039 int lqt_set_video_pass(quicktime_t *file,
1040 int pass, int total_passes,
1041 const char * stats_file, int track);
1042
1050 int64_t lqt_get_frame_time(quicktime_t * file, int track, int frame);
1051
1062 int64_t lqt_frame_time(quicktime_t * file, int track);
1063
1077 int lqt_decode_video(quicktime_t *file,
1078 unsigned char **row_pointers, int track);
1079
1097 int lqt_read_video_frame(quicktime_t * file,
1098 uint8_t ** buffer, int * buffer_alloc,
1099 int64_t frame, int64_t * time, int track);
1100
1116 int lqt_encode_video(quicktime_t *file,
1117 unsigned char **row_pointers,
1118 int track, int64_t time);
1119
1137 int lqt_encode_video_d(quicktime_t *file,
1138 unsigned char **row_pointers,
1139 int track, int64_t time, int duration);
1140
1149 int lqt_frame_duration(quicktime_t * file, int track, int *constant);
1150
1158 int lqt_video_time_scale(quicktime_t * file, int track);
1159
1169 int64_t lqt_video_duration(quicktime_t * file, int track);
1170
1185 void lqt_set_cmodel(quicktime_t *file, int track, int colormodel);
1186
1193 long lqt_video_edit_list_total_entries(quicktime_t * file, int track);
1194
1202 long lqt_video_edit_duration(quicktime_t * file, int track, int entry_index);
1203
1211 long lqt_video_edit_time(quicktime_t * file, int track, int entry_index);
1212
1220 float lqt_video_edit_rate(quicktime_t * file, int track, int entry_index);
1221
1232 void lqt_set_row_span(quicktime_t *file, int track, int row_span);
1233
1244 void lqt_set_row_span_uv(quicktime_t *file, int track, int row_span_uv);
1245
1270 int lqt_decode_audio(quicktime_t *file,
1271 int16_t **output_i,
1272 float **output_f,
1273 long samples);
1274
1287 int64_t lqt_last_audio_position(quicktime_t * file, int track);
1288
1302 int lqt_encode_audio_track(quicktime_t *file,
1303 int16_t **output_i,
1304 float **output_f,
1305 long samples,
1306 int track);
1307
1325 int lqt_decode_audio_track(quicktime_t *file,
1326 int16_t **output_i,
1327 float **output_f,
1328 long samples,
1329 int track);
1330
1331 /*
1332 * Query the internal sample format. Works for decoding (call after quicktime_open)
1333 * and encoding (call after lqt_add_audio_track, lqt_set_audio or quicktime_set_audio).
1334 */
1335
1342 const char * lqt_sample_format_to_string(lqt_sample_format_t sampleformat);
1343
1355 lqt_sample_format_t lqt_get_sample_format(quicktime_t * file, int track);
1356
1357 /* The following return the actual number of en-/decoded frames */
1358
1375 int lqt_decode_audio_raw(quicktime_t *file,
1376 void * output,
1377 long samples,
1378 int track);
1379
1391 int lqt_get_audio_language(quicktime_t * file, int track, char * language);
1392
1393
1407 int lqt_encode_audio_raw(quicktime_t *file,
1408 void * input,
1409 long samples,
1410 int track);
1411
1423 void lqt_seek_video(quicktime_t * file, int track,
1424 int64_t time);
1425
1432 long lqt_audio_edit_list_total_entries(quicktime_t * file, int track);
1433
1441 long lqt_audio_edit_duration(quicktime_t * file, int track, int entry_index);
1442
1450 long lqt_audio_edit_time(quicktime_t * file, int track, int entry_index);
1451
1459 float lqt_audio_edit_rate(quicktime_t * file, int track, int entry_index);
1460
1461 /*
1462 * AVI Specific stuff
1463 */
1464
1471 int lqt_is_avi(quicktime_t *file);
1472
1483 int lqt_get_wav_id(quicktime_t *file, int track);
1484
1495 int lqt_total_channels(quicktime_t *file);
1496
1497 /* Extended metadata support */
1498
1505 void lqt_set_album(quicktime_t *file, char *string);
1506
1513 void lqt_set_artist(quicktime_t *file, char *string);
1514
1521 void lqt_set_genre(quicktime_t *file, char *string);
1522
1530 void lqt_set_track(quicktime_t *file, char *string);
1531
1538 void lqt_set_comment(quicktime_t *file, char *string);
1539
1546 void lqt_set_author(quicktime_t *file, char *string);
1547
1554 void lqt_set_creation_time(quicktime_t *file, unsigned long time);
1555
1556
1563 char * lqt_get_album(quicktime_t * file);
1564
1570 char * lqt_get_artist(quicktime_t * file);
1571
1578 char * lqt_get_genre(quicktime_t * file);
1579
1585 char * lqt_get_track(quicktime_t * file);
1586
1593 char * lqt_get_comment(quicktime_t *file);
1594
1600 char * lqt_get_author(quicktime_t *file);
1601
1607 unsigned long lqt_get_creation_time(quicktime_t * file);
1608
1609 /* get track number from track id */
1610 int lqt_track_from_id(quicktime_t *file, int track_id);
1611
1618 const char * lqt_file_type_to_string(lqt_file_type_t type);
1619
1626 lqt_file_type_t lqt_get_file_type(quicktime_t * file);
1627
1628
1636 quicktime_t * lqt_open_read(const char * filename);
1637
1647 quicktime_t * lqt_open_read_with_log(const char * filename, lqt_log_callback_t cb, void * log_data);
1648
1657 quicktime_t * lqt_open_write(const char * filename, lqt_file_type_t type);
1658
1669 quicktime_t * lqt_open_write_with_log(const char * filename, lqt_file_type_t type,
1670 lqt_log_callback_t cb, void * log_data);
1671
1683 void lqt_set_max_riff_size(quicktime_t * file, int size);
1684
1685
1693 void lqt_set_audio_pts_offset(quicktime_t * file, int track, int64_t offset);
1694
1702 int64_t lqt_get_audio_pts_offset(quicktime_t * file, int track);
1703
1711 void lqt_set_video_pts_offset(quicktime_t * file, int track, int64_t offset);
1712
1720 int64_t lqt_get_video_pts_offset(quicktime_t * file, int track);
1721
1729 void lqt_set_text_pts_offset(quicktime_t * file, int track, int64_t offset);
1730
1738 int64_t lqt_get_text_pts_offset(quicktime_t * file, int track);
1739
1740 #ifdef __cplusplus
1741 }
1742 #endif /* __cplusplus */
1743
1744 #ifdef __GNUC__
1745 #pragma GCC visibility pop
1746 #endif
1747
1748 #endif
lqt_open_read
quicktime_t * lqt_open_read(const char *filename)
Open a file for reading.
lqt_audio_edit_duration
long lqt_audio_edit_duration(quicktime_t *file, int track, int entry_index)
Get the duration of a audio track edit segment.
lqt_colormodel_is_yuv
int lqt_colormodel_is_yuv(int colormodel)
Check, if a colormodel is YUV based.
lqt_get_text_box
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.
lqt_set_video
int lqt_set_video(quicktime_t *file, int tracks, int frame_w, int frame_h, int frame_duration, int timescale, lqt_codec_info_t *codec_info)
Set up video tracks for encoding.
lqt_string_to_colormodel
int lqt_string_to_colormodel(const char *str)
Convert a description string to a colormodel.
lqt_file_type_t
lqt_file_type_t
File types.
Definition: quicktime.h:154
lqt_set_text_bg_color
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.
lqt_get_pixel_aspect
int lqt_get_pixel_aspect(quicktime_t *file, int track, int *pixel_width, int *pixel_height)
Get the pixel aspect ratio of a video track.
lqt_set_log_callback
void lqt_set_log_callback(lqt_log_callback_t cb, void *data)
Set callback for global logging.
lqt_log_callback_t
void(* lqt_log_callback_t)(lqt_log_level_t level, const char *domain, const char *message, void *data)
Log callback.
Definition: quicktime.h:142
lqt_set_text_fg_color
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.
lqt_encode_video
int lqt_encode_video(quicktime_t *file, unsigned char **row_pointers, int track, int64_t time)
Encode one video frame.
lqt_get_genre
char * lqt_get_genre(quicktime_t *file)
Get the genre from the file.
lqt_get_frame_time
int64_t lqt_get_frame_time(quicktime_t *file, int track, int frame)
Get the timestamp of a given frame.
lqt_get_wav_id
int lqt_get_wav_id(quicktime_t *file, int track)
Get the WAVE id of an audio track.
lqt_colormodel_has_alpha
int lqt_colormodel_has_alpha(int colormodel)
Check if a colormodel has an alpha (transperency) channel.
lqt_colormodel_is_rgb
int lqt_colormodel_is_rgb(int colormodel)
Check, if a colormodel is RGB based.
lqt_set_row_span
void lqt_set_row_span(quicktime_t *file, int track, int row_span)
Set the row span for the luma plane.
lqt_colormodel_is_planar
int lqt_colormodel_is_planar(int colormodel)
Check if a colormodel is planar.
lqt_is_avi
int lqt_is_avi(quicktime_t *file)
Query if the function is an AVI.
lqt_chroma_placement_to_string
const char * lqt_chroma_placement_to_string(lqt_chroma_placement_t chroma_placement)
Convert a chroma placement to a human readable string.
lqt_set_text_time
void lqt_set_text_time(quicktime_t *file, int track, int64_t time)
Go to a specific time.
lqt_channel_t
lqt_channel_t
Channel definitions.
Definition: quicktime.h:177
lqt_set_comment
void lqt_set_comment(quicktime_t *file, char *string)
Set the comment for the file.
lqt_set_cmodel
void lqt_set_cmodel(quicktime_t *file, int track, int colormodel)
Set the colormodel for en-/decoding.
lqt_frame_time
int64_t lqt_frame_time(quicktime_t *file, int track)
Get the timestamp of the next frame to be decoded.
lqt_is_chapter_track
int lqt_is_chapter_track(quicktime_t *file, int track)
Check if a track is a chapter track.
lqt_seek_video
void lqt_seek_video(quicktime_t *file, int track, int64_t time)
Seek to a specific video time.
lqt_set_author
void lqt_set_author(quicktime_t *file, char *string)
Set the author for the file.
lqt_colormodel_get_chroma_sub
void lqt_colormodel_get_chroma_sub(int colormodel, int *sub_h, int *sub_v)
Get the chroma subsampling factors.
lqt_set_audio_pts_offset
void lqt_set_audio_pts_offset(quicktime_t *file, int track, int64_t offset)
Set an audio pts offset.
lqt_get_album
char * lqt_get_album(quicktime_t *file)
Get the album from the file.
lqt_get_channel_setup
const lqt_channel_t * lqt_get_channel_setup(quicktime_t *file, int track)
Get a channel setup from a file.
lqt_set_audio_parameter
void lqt_set_audio_parameter(quicktime_t *file, int track, const char *key, const void *value)
Set a codec parameter for an audio track.
lqt_decode_video
int lqt_decode_video(quicktime_t *file, unsigned char **row_pointers, int track)
Decode one video frame.
lqt_set_chapter_track
void lqt_set_chapter_track(quicktime_t *file, int track)
Make a text track a chapter 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.
lqt_open_read_with_log
quicktime_t * lqt_open_read_with_log(const char *filename, lqt_log_callback_t cb, void *log_data)
Open a file for reading.
lqt_audio_edit_list_total_entries
long lqt_audio_edit_list_total_entries(quicktime_t *file, int track)
Get the number of audio track edit segments.
lqt_set_text_position
void lqt_set_text_position(quicktime_t *file, int track, int64_t position)
Go to a specific sample.
lqt_set_creation_time
void lqt_set_creation_time(quicktime_t *file, unsigned long time)
Set the creation time for the file.
lqt_get_text_bg_color
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.
lqt_chroma_placement_t
lqt_chroma_placement_t
Chroma placement.
Definition: quicktime.h:278
lqt_file_type_to_string
const char * lqt_file_type_to_string(lqt_file_type_t type)
Get a human readable filetype.
lqt_add_audio_track
int lqt_add_audio_track(quicktime_t *file, int channels, long sample_rate, int bits, lqt_codec_info_t *codec_info)
Add an audio track for encoding.
lqt_get_interlace_mode
lqt_interlace_mode_t lqt_get_interlace_mode(quicktime_t *file, int track)
Get the interlace mode.
lqt_set_artist
void lqt_set_artist(quicktime_t *file, char *string)
Set the artist for the file.
lqt_sample_format_to_string
const char * lqt_sample_format_to_string(lqt_sample_format_t sampleformat)
Get a human readable description for a sample format.
lqt_video_edit_rate
float lqt_video_edit_rate(quicktime_t *file, int track, int entry_index)
Get the rate of a video track edit segment.
lqt_rows_clear
void lqt_rows_clear(uint8_t **rows, int width, int height, int rowspan, int rowspan_uv, int colormodel)
Clear a video frame.
lqt_set_interlace_mode
int lqt_set_interlace_mode(quicktime_t *file, int track, lqt_interlace_mode_t mode)
Set the interlace mode.
lqt_total_channels
int lqt_total_channels(quicktime_t *file)
Get the total number of audio channels across all tracks.
lqt_get_author
char * lqt_get_author(quicktime_t *file)
Get the author from the file.
lqt_get_text_language
int lqt_get_text_language(quicktime_t *file, int track, char *language)
Get the text language.
lqt_set_video_codec
int lqt_set_video_codec(quicktime_t *file, int track, lqt_codec_info_t *info)
Set a codec for an audio track.
lqt_get_text_pts_offset
int64_t lqt_get_text_pts_offset(quicktime_t *file, int track)
Get an video pts offset.
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.
lqt_set_text_box
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.
lqt_set_video_parameter
void lqt_set_video_parameter(quicktime_t *file, int track, const char *key, const void *value)
Set a codec parameter for a video track.
lqt_text_samples
int64_t lqt_text_samples(quicktime_t *file, int track)
Get the total number of text samples.
lqt_get_file_type
lqt_file_type_t lqt_get_file_type(quicktime_t *file)
Get the filetype.
lqt_set_track
void lqt_set_track(quicktime_t *file, char *string)
Set the track number for the file.
lqt_get_sample_format
lqt_sample_format_t lqt_get_sample_format(quicktime_t *file, int track)
Return the sample format used natively by the codec.
lqt_video_time_scale
int lqt_video_time_scale(quicktime_t *file, int track)
Get the timescale of the track.
lqt_rows_copy_sub
void lqt_rows_copy_sub(uint8_t **out_rows, uint8_t **in_rows, int width, int height, int in_rowspan, int in_rowspan_uv, int out_rowspan, int out_rowspan_uv, int colormodel, int src_x, int src_y, int dst_x, int dst_y)
Copy a subrectangle video frame.
lqt_codec_info_s
Structure describing a codec.
Definition: lqt_codecinfo.h:189
lqt_set_genre
void lqt_set_genre(quicktime_t *file, char *string)
Set the genre for the file.
lqt_last_audio_position
int64_t lqt_last_audio_position(quicktime_t *file, int track)
Get the position of the last decoded sample.
lqt_get_audio_pts_offset
int64_t lqt_get_audio_pts_offset(quicktime_t *file, int track)
Get an audio pts offset.
lqt_read_video_frame
int lqt_read_video_frame(quicktime_t *file, uint8_t **buffer, int *buffer_alloc, int64_t frame, int64_t *time, int track)
Read a compressed video frame.
lqt_frame_duration
int lqt_frame_duration(quicktime_t *file, int track, int *constant)
Get the duration of the NEXT frame to be decoded.
lqt_audio_edit_time
long lqt_audio_edit_time(quicktime_t *file, int track, int entry_index)
Get the time offset of a audio track edit segment.
lqt_write_text
int lqt_write_text(quicktime_t *file, int track, const char *text, int64_t duration)
Write a text sample.
lqt_get_creation_time
unsigned long lqt_get_creation_time(quicktime_t *file)
Get the creation time from the file.
lqt_set_pixel_aspect
int lqt_set_pixel_aspect(quicktime_t *file, int track, int pixel_width, int pixel_height)
Set the pixel aspect ratio of a video track.
lqt_get_best_colormodel
int lqt_get_best_colormodel(quicktime_t *file, int track, int *supported)
Get the best colormodel out of a list of supported colormodels.
lqt_set_max_riff_size
void lqt_set_max_riff_size(quicktime_t *file, int size)
Set the segment size for ODML AVIs.
lqt_get_audio_language
int lqt_get_audio_language(quicktime_t *file, int track, char *language)
Get the audio language.
lqt_get_colormodel_string
const char * lqt_get_colormodel_string(int index)
Get a colormodel string.
lqt_rows_alloc
uint8_t ** lqt_rows_alloc(int width, int height, int colormodel, int *rowspan, int *rowspan_uv)
Allocate a frame buffer for use with libquicktime.
lqt_colormodel_has_conversion
int lqt_colormodel_has_conversion(int in_cmodel, int out_cmodel)
Check if a colormodel conversion is supported by libquicktime.
lqt_decode_audio
int lqt_decode_audio(quicktime_t *file, int16_t **output_i, float **output_f, long samples)
Decode all channels from all tracks at once.
lqt_set_audio_language
void lqt_set_audio_language(quicktime_t *file, int track, const char *language)
Set the audio language.
lqt_get_track
char * lqt_get_track(quicktime_t *file)
Get the track number from the file.
lqt_get_best_target_colormodel
int lqt_get_best_target_colormodel(int source, int const *target_options)
Select a target colormodel from a provided list that is best for conversion from a specified source c...
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.
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.
lqt_encode_audio_track
int lqt_encode_audio_track(quicktime_t *file, int16_t **output_i, float **output_f, long samples, int track)
Encode a number of audio samples for the first track.
lqt_set_audio_codec
int lqt_set_audio_codec(quicktime_t *file, int track, lqt_codec_info_t *info)
Set a codec for an audio track.
lqt_video_duration
int64_t lqt_video_duration(quicktime_t *file, int track)
Get the duration of a video track.
lqt_add_video_track
int lqt_add_video_track(quicktime_t *file, int frame_w, int frame_h, int frame_duration, int timescale, lqt_codec_info_t *codec_info)
Add a video track for encoding.
lqt_decode_audio_raw
int lqt_decode_audio_raw(quicktime_t *file, void *output, long samples, int track)
Decode audio in the native sampleformat of the codec.
lqt_rows_free
void lqt_rows_free(uint8_t **rows)
Free a frame allocated by lqt_rows_alloc.
lqt_get_default_rowspan
void lqt_get_default_rowspan(int colormodel, int width, int *rowspan, int *rowspan_uv)
Get the default row span for a colormodel and an image width.
lqt_add_text_track
int lqt_add_text_track(quicktime_t *file, int timescale)
Add a text track.
lqt_set_text_language
void lqt_set_text_language(quicktime_t *file, int track, const char *language)
Set the language for a text track.
lqt_text_tracks
int lqt_text_tracks(quicktime_t *file)
Get the number of text tracks.
lqt_set_timecode_track_enabled
void lqt_set_timecode_track_enabled(quicktime_t *file, int track, int enabled)
Enable or disable a timecode track.
lqt_set_text_pts_offset
void lqt_set_text_pts_offset(quicktime_t *file, int track, int64_t offset)
Set an video pts offset.
lqt_text_time_scale
int lqt_text_time_scale(quicktime_t *file, int track)
Get the timescale for a text track.
quicktime.h
lqt_decode_audio_track
int lqt_decode_audio_track(quicktime_t *file, int16_t **output_i, float **output_f, long samples, int track)
Decode a number of audio samples.
lqt_channel_to_string
const char * lqt_channel_to_string(lqt_channel_t ch)
Convert a channel identifier to a human readnable string.
lqt_get_video_pts_offset
int64_t lqt_get_video_pts_offset(quicktime_t *file, int track)
Get an video pts offset.
lqt_video_edit_list_total_entries
long lqt_video_edit_list_total_entries(quicktime_t *file, int track)
Get the number of video track edit segments.
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.
lqt_get_chroma_placement
lqt_chroma_placement_t lqt_get_chroma_placement(quicktime_t *file, int track)
Get the chroma placement.
lqt_encode_video_d
int lqt_encode_video_d(quicktime_t *file, unsigned char **row_pointers, int track, int64_t time, int duration)
Encode one video frame.
lqt_get_colormodel
int lqt_get_colormodel(int index)
Get a colormodel.
lqt_sample_format_t
lqt_sample_format_t
Sample format definitions for audio.
Definition: quicktime.h:294
lqt_video_edit_time
long lqt_video_edit_time(quicktime_t *file, int track, int entry_index)
Get the time offset of a video track edit segment.
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.
lqt_open_write
quicktime_t * lqt_open_write(const char *filename, lqt_file_type_t type)
Open a file for writing.
lqt_set_album
void lqt_set_album(quicktime_t *file, char *string)
Set the album for the file.
lqt_get_comment
char * lqt_get_comment(quicktime_t *file)
Get the comment from the file.
lqt_read_text
int lqt_read_text(quicktime_t *file, int track, char **text, int *text_alloc, int64_t *timestamp, int64_t *duration)
Read a text sample.
lqt_set_channel_setup
void lqt_set_channel_setup(quicktime_t *file, int track, lqt_channel_t *ch)
Set a channel setup for an audio track.
quicktime_t
struct quicktime_s quicktime_t
Quicktime handle.
Definition: quicktime.h:313
lqt_get_codec_api_version
int lqt_get_codec_api_version()
Get the codec API version.
lqt_colormodel_is_video_range
int lqt_colormodel_is_video_range(int colormodel)
Check, if a colormodel is video range or full range.
lqt_interlace_mode_to_string
const char * lqt_interlace_mode_to_string(lqt_interlace_mode_t mode)
Convert an interlace mode to a human readable string.
lqt_open_write_with_log
quicktime_t * lqt_open_write_with_log(const char *filename, lqt_file_type_t type, lqt_log_callback_t cb, void *log_data)
Open a file for writing.
lqt_set_row_span_uv
void lqt_set_row_span_uv(quicktime_t *file, int track, int row_span_uv)
Set the row span for the chroma planes.
lqt_rows_copy
void lqt_rows_copy(uint8_t **out_rows, uint8_t **in_rows, int width, int height, int in_rowspan, int in_rowspan_uv, int out_rowspan, int out_rowspan_uv, int colormodel)
Copy a video frame.
lqt_get_best_source_colormodel
int lqt_get_best_source_colormodel(int const *source_options, int target)
Select a source colormodel from a provided list that is best for conversion into a specified target c...
lqt_set_audio
int lqt_set_audio(quicktime_t *file, int channels, long sample_rate, int bits, lqt_codec_info_t *codec_info)
Set up audio tracks for encoding.
lqt_encode_audio_raw
int lqt_encode_audio_raw(quicktime_t *file, void *input, long samples, int track)
Encode audio in the native sampleformat of the codec.
lqt_get_cmodel
int lqt_get_cmodel(quicktime_t *file, int track)
Get the colormodel, which will be valid for the next en-/decode call.
lqt_get_text_fg_color
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.
lqt_get_decoder_colormodel
int lqt_get_decoder_colormodel(quicktime_t *file, int track)
Get the native colormodel of the decoder.
lqt_num_colormodels
int lqt_num_colormodels()
Get number of supported colormodels.
lqt_fileno
int lqt_fileno(quicktime_t *file)
Return the raw filedescriptor associated with the file.
lqt_get_artist
char * lqt_get_artist(quicktime_t *file)
Get the artist from the file.
lqt_video_edit_duration
long lqt_video_edit_duration(quicktime_t *file, int track, int entry_index)
Get the duration of a video track edit segment.
lqt_colormodel_to_string
const char * lqt_colormodel_to_string(int colormodel)
Convert a colormodel to a human readable string.
lqt_set_video_pass
int lqt_set_video_pass(quicktime_t *file, int pass, int total_passes, const char *stats_file, int track)
Enable multipass encoding.
lqt_set_video_pts_offset
void lqt_set_video_pts_offset(quicktime_t *file, int track, int64_t offset)
Set an video pts offset.
lqt_audio_edit_rate
float lqt_audio_edit_rate(quicktime_t *file, int track, int entry_index)
Get the rate of a audio track edit segment.
lqt_interlace_mode_t
lqt_interlace_mode_t
interlace modes
Definition: quicktime.h:262
lqt_get_timecode_track_enabled
int lqt_get_timecode_track_enabled(quicktime_t *file, int track)
Get the enabled flag of a timecode track.