libquicktime
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#pragma GCC visibility push(default)
35
36
37#ifdef __cplusplus
38extern "C" {
39#endif /* __cplusplus */
40
45
46void *lqt_bufalloc(size_t size);
47
48
49
55
57
58
69
71
82
83void lqt_set_audio_parameter(quicktime_t *file,int track, const char *key,const void *value);
84
95
96void lqt_set_video_parameter(quicktime_t *file,int track, const char *key,const void *value);
97
106
107
108int lqt_get_pixel_aspect(quicktime_t *file, int track, int * pixel_width,
109 int * pixel_height);
110
120
121int lqt_set_pixel_aspect(quicktime_t *file, int track, int pixel_width,
122 int pixel_height);
123
135
137
149
152
153
160
170
172
178
180
190
192
198
200
211
212void lqt_set_channel_setup(quicktime_t * file, int track, lqt_channel_t * ch);
213
223
225
226
246
253
258
259int lqt_add_text_track(quicktime_t * file, int timescale);
260
269
270void lqt_set_text_language(quicktime_t * file, int track, const char * language);
271
279
280
281
282void lqt_set_chapter_track(quicktime_t * file, int track);
283
292
293void lqt_set_text_box(quicktime_t * file, int track,
294 uint16_t top, uint16_t left,
295 uint16_t bottom, uint16_t right);
296
308
309void lqt_set_text_fg_color(quicktime_t * file, int track,
310 uint16_t r, uint16_t g,
311 uint16_t b, uint16_t a);
312
325
326void lqt_set_text_bg_color(quicktime_t * file, int track,
327 uint16_t r, uint16_t g,
328 uint16_t b, uint16_t a);
329
330
331
332
340
341int lqt_write_text(quicktime_t * file, int track, const char * text, int64_t duration);
342
346
354
359
361
371
372int lqt_get_text_language(quicktime_t * file, int track, char * language);
373
379
380int lqt_text_time_scale(quicktime_t * file, int track);
381
390
391void lqt_get_text_box(quicktime_t * file, int track,
392 uint16_t * top, uint16_t * left,
393 uint16_t * bottom, uint16_t * right);
394
395
409
410int lqt_read_text(quicktime_t * file, int track, char ** text, int * text_alloc,
411 int64_t * timestamp, int64_t * duration);
412
418
419
420int lqt_is_chapter_track(quicktime_t * file, int track);
421
427
428int64_t lqt_text_samples(quicktime_t * file, int track);
429
435
436void lqt_set_text_position(quicktime_t * file, int track, int64_t position);
437
447
448void lqt_set_text_time(quicktime_t * file, int track, int64_t time);
449
460
461void lqt_get_text_fg_color(quicktime_t * file, int track,
462 uint16_t * r, uint16_t * g,
463 uint16_t * b, uint16_t * a);
464
475
476void lqt_get_text_bg_color(quicktime_t * file, int track,
477 uint16_t * r, uint16_t * g,
478 uint16_t * b, uint16_t * a);
479
483
494
495#define LQT_TIMECODE_DROP 0x0001
496#define LQT_TIMECODE_24HMAX 0x0002
497#define LQT_TIMECODE_NEG_OK 0x0004
498#define LQT_TIMECODE_COUNTER 0x0008
499
511
512void lqt_add_timecode_track(quicktime_t * file, int track,
513 uint32_t flags, int framerate);
514
523
524void lqt_write_timecode(quicktime_t * file, int track,
525 uint32_t timecode);
526
536
538 uint32_t * flags, int * framerate);
539
552
553
554int lqt_read_timecode(quicktime_t * file, int track,
555 uint32_t * timecode);
556
567
568const char * lqt_get_timecode_tape_name(quicktime_t * file, int track);
569
579
581 const char * tapename);
582
590
592
600
602 int enabled);
603
607
608
609
610/***********************************************
611 * Advanced colormodel handling.
612 * (defined in lqt_color.c)
613 ***********************************************/
614
619
620#define LQT_COLORMODEL_NONE -1
621
622/* Colormodel <-> string conversion (used by registry file routines) */
623
629
630const char * lqt_colormodel_to_string(int colormodel);
631
637
638int lqt_string_to_colormodel(const char * str);
639
640/* Query information about the colormodel */
641
647
648int lqt_colormodel_is_planar(int colormodel);
649
655
656int lqt_colormodel_has_alpha(int colormodel);
657
663
664int lqt_colormodel_is_rgb(int colormodel);
665
671
672int lqt_colormodel_is_yuv(int colormodel);
673
681
682void lqt_colormodel_get_chroma_sub(int colormodel, int * sub_h, int * sub_v);
683
696
697void lqt_get_default_rowspan(int colormodel, int width, int * rowspan, int * rowspan_uv);
698
710
711int lqt_colormodel_has_conversion(int in_cmodel, int out_cmodel);
712
713/* Query supported colormodels */
714
719
721
727const char * lqt_get_colormodel_string(int index);
728
734
735int lqt_get_colormodel(int index);
736
746
748
759
760int lqt_get_best_source_colormodel(int const* source_options, int target);
761
772
773int lqt_get_best_target_colormodel(int source, int const* target_options);
774
790
791int lqt_get_best_colormodel(quicktime_t * file, int track, int * supported);
792
802
803int lqt_get_cmodel(quicktime_t * file, int track);
804
819
820uint8_t ** lqt_rows_alloc(int width, int height, int colormodel, int * rowspan, int * rowspan_uv);
821
834
835void lqt_rows_copy(uint8_t **out_rows, uint8_t **in_rows, int width, int height, int in_rowspan, int in_rowspan_uv,
836 int out_rowspan, int out_rowspan_uv, int colormodel);
837
856
857void lqt_rows_copy_sub(uint8_t **out_rows, uint8_t **in_rows,
858 int width, int height, int in_rowspan,
859 int in_rowspan_uv, int out_rowspan,
860 int out_rowspan_uv, int colormodel, int src_x, int src_y, int dst_x, int dst_y);
861
877
878void lqt_rows_clear(uint8_t **rows,
879 int width, int height, int rowspan, int rowspan_uv, int colormodel);
880
881
886
887void lqt_rows_free(uint8_t ** rows);
888
889
890/**************************************
891 * Set streams for encoding
892 **************************************/
893
906
907int lqt_set_audio(quicktime_t *file, int channels,
908 long sample_rate, int bits,
909 lqt_codec_info_t * codec_info);
910
911
928
929int lqt_set_video(quicktime_t *file, int tracks,
930 int frame_w, int frame_h,
931 int frame_duration, int timescale,
932 lqt_codec_info_t * codec_info);
933
934
950
952 int channels, long sample_rate, int bits,
953 lqt_codec_info_t * codec_info);
954
961
962int lqt_set_audio_codec(quicktime_t *file, int track,
963 lqt_codec_info_t * info);
964
965
975
976void lqt_set_audio_language(quicktime_t * file, int track, const char * language);
977
995
997 int frame_w, int frame_h,
998 int frame_duration, int timescale,
999 lqt_codec_info_t * codec_info);
1000
1007
1009 lqt_codec_info_t * info);
1010
1011
1028
1030 int pass, int total_passes,
1031 const char * stats_file, int track);
1032
1040int64_t lqt_get_frame_time(quicktime_t * file, int track, int frame);
1041
1051
1052int64_t lqt_frame_time(quicktime_t * file, int track);
1053
1064
1065
1067 unsigned char **row_pointers, int track);
1068
1085
1087 uint8_t ** buffer, int * buffer_alloc,
1088 int64_t frame, int64_t * time, int track);
1089
1104
1106 unsigned char **row_pointers,
1107 int track, int64_t time);
1108
1125
1127 unsigned char **row_pointers,
1128 int track, int64_t time, int duration);
1129
1137
1138int lqt_frame_duration(quicktime_t * file, int track, int *constant);
1139
1146
1147int lqt_video_time_scale(quicktime_t * file, int track);
1148
1157
1158int64_t lqt_video_duration(quicktime_t * file, int track);
1159
1173
1174void lqt_set_cmodel(quicktime_t *file, int track, int colormodel);
1175
1181
1183
1190
1191long lqt_video_edit_duration(quicktime_t * file, int track, int entry_index);
1192
1199
1200long lqt_video_edit_time(quicktime_t * file, int track, int entry_index);
1201
1208
1209float lqt_video_edit_rate(quicktime_t * file, int track, int entry_index);
1210
1220
1221void lqt_set_row_span(quicktime_t *file, int track, int row_span);
1222
1232
1233void lqt_set_row_span_uv(quicktime_t *file, int track, int row_span_uv);
1234
1258
1260 int16_t **output_i,
1261 float **output_f,
1262 long samples);
1263
1275
1276int64_t lqt_last_audio_position(quicktime_t * file, int track);
1277
1290
1292 int16_t **output_i,
1293 float **output_f,
1294 long samples,
1295 int track);
1296
1313
1315 int16_t **output_i,
1316 float **output_f,
1317 long samples,
1318 int track);
1319
1320/*
1321 * Support for "raw" audio en-/decoding: This bypasses all
1322 * internal sampleformat conversions, and allows access to audio
1323 * samples in a format, which is closest to the internal representation.
1324 */
1325
1326/*
1327 * Query the internal sample format. Works for decoding (call after quicktime_open)
1328 * and encoding (call after lqt_add_audio_track, lqt_set_audio or quicktime_set_audio).
1329 */
1330
1336
1338
1353
1355
1356/* The following return the actual number of en-/decoded frames */
1357
1373
1375 void * output,
1376 long samples,
1377 int track);
1378
1389
1390int lqt_get_audio_language(quicktime_t * file, int track, char * language);
1391
1392
1405
1407 void * input,
1408 long samples,
1409 int track);
1410
1421
1422void lqt_seek_video(quicktime_t * file, int track,
1423 int64_t time);
1424
1430
1432
1439
1440long lqt_audio_edit_duration(quicktime_t * file, int track, int entry_index);
1441
1448
1449long lqt_audio_edit_time(quicktime_t * file, int track, int entry_index);
1450
1457
1458float lqt_audio_edit_rate(quicktime_t * file, int track, int entry_index);
1459
1460/*
1461 * AVI Specific stuff
1462 */
1463
1469
1471
1481
1482int lqt_get_wav_id(quicktime_t *file, int track);
1483
1493
1495
1496/* Extended metadata support */
1497
1503
1504void lqt_set_album(quicktime_t *file, char *string);
1505
1511
1512void lqt_set_artist(quicktime_t *file, char *string);
1513
1519
1520void lqt_set_genre(quicktime_t *file, char *string);
1521
1527
1528
1529void lqt_set_track(quicktime_t *file, char *string);
1530
1536
1537void lqt_set_comment(quicktime_t *file, char *string);
1538
1544
1545void lqt_set_author(quicktime_t *file, char *string);
1546
1552
1553void lqt_set_creation_time(quicktime_t *file, unsigned long time);
1554
1555
1561
1563
1570
1576
1578
1585
1591
1593
1600
1607
1608/* get track number from track id */
1609int lqt_track_from_id(quicktime_t *file, int track_id);
1610
1616
1618
1624
1626
1627
1634
1635quicktime_t * lqt_open_read(const char * filename);
1636
1645
1646 quicktime_t * lqt_open_read_with_log(const char * filename, lqt_log_callback_t cb, void * log_data);
1647
1655
1656quicktime_t * lqt_open_write(const char * filename, lqt_file_type_t type);
1657
1667
1669 lqt_log_callback_t cb, void * log_data);
1670
1681
1682void lqt_set_max_riff_size(quicktime_t * file, int size);
1683
1684
1691
1692void lqt_set_audio_pts_offset(quicktime_t * file, int track, int64_t offset);
1693
1700
1701int64_t lqt_get_audio_pts_offset(quicktime_t * file, int track);
1702
1709
1710void lqt_set_video_pts_offset(quicktime_t * file, int track, int64_t offset);
1711
1718
1719int64_t lqt_get_video_pts_offset(quicktime_t * file, int track);
1720
1727
1728void lqt_set_text_pts_offset(quicktime_t * file, int track, int64_t offset);
1729
1736
1737int64_t lqt_get_text_pts_offset(quicktime_t * file, int track);
1738
1739#ifdef __cplusplus
1740}
1741#endif /* __cplusplus */
1742
1743#pragma GCC visibility pop
1744
1745#endif
int lqt_total_channels(quicktime_t *file)
Get the total number of audio channels across all tracks.
long lqt_audio_edit_time(quicktime_t *file, int track, int entry_index)
Get the time offset of a audio track edit segment.
long lqt_audio_edit_duration(quicktime_t *file, int track, int entry_index)
Get the duration of a audio track edit segment.
int lqt_decode_audio(quicktime_t *file, int16_t **output_i, float **output_f, long samples)
Decode all channels from all tracks at once.
int lqt_decode_audio_raw(quicktime_t *file, void *output, long samples, int track)
Decode audio in the native sampleformat of the codec.
int64_t lqt_last_audio_position(quicktime_t *file, int track)
Get the position of the last decoded sample.
long lqt_audio_edit_list_total_entries(quicktime_t *file, int track)
Get the number of audio track edit segments.
float lqt_audio_edit_rate(quicktime_t *file, int track, int entry_index)
Get the rate of a audio track edit segment.
int64_t lqt_get_audio_pts_offset(quicktime_t *file, int track)
Get an audio pts offset.
int lqt_get_audio_language(quicktime_t *file, int track, char *language)
Get the audio language.
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.
void lqt_set_audio_pts_offset(quicktime_t *file, int track, int64_t offset)
Set an audio pts offset.
int lqt_encode_audio_raw(quicktime_t *file, void *input, long samples, int track)
Encode audio in the native sampleformat of the codec.
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.
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.
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.
int lqt_set_audio_codec(quicktime_t *file, int track, lqt_codec_info_t *info)
Set a codec for an audio track.
void lqt_set_audio_language(quicktime_t *file, int track, const char *language)
Set the audio language.
lqt_sample_format_t
Sample format definitions for audio.
Definition quicktime.h:288
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_sample_format_t lqt_get_sample_format(quicktime_t *file, int track)
Return the sample format used natively by the codec.
const char * lqt_sample_format_to_string(lqt_sample_format_t sampleformat)
Get a human readable description for a sample format.
int lqt_colormodel_has_alpha(int colormodel)
Check if a colormodel has an alpha (transperency) channel.
const char * lqt_colormodel_to_string(int colormodel)
Convert a colormodel to a human readable string.
int lqt_colormodel_has_conversion(int in_cmodel, int out_cmodel)
Check if a colormodel conversion is supported by libquicktime.
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...
const char * lqt_get_colormodel_string(int index)
Get a colormodel string.
int lqt_num_colormodels()
Get number of supported colormodels.
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...
int lqt_colormodel_is_planar(int colormodel)
Check if a colormodel is planar.
int lqt_colormodel_is_yuv(int colormodel)
Check, if a colormodel is YUV based.
void lqt_colormodel_get_chroma_sub(int colormodel, int *sub_h, int *sub_v)
Get the chroma subsampling factors.
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.
int lqt_string_to_colormodel(const char *str)
Convert a description string to a colormodel.
int lqt_get_colormodel(int index)
Get a colormodel.
int lqt_colormodel_is_rgb(int colormodel)
Check, if a colormodel is RGB based.
void lqt_set_max_riff_size(quicktime_t *file, int size)
Set the segment size for ODML AVIs.
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.
quicktime_t * lqt_open_write(const char *filename, lqt_file_type_t type)
Open a file for writing.
lqt_file_type_t lqt_get_file_type(quicktime_t *file)
Get the filetype.
quicktime_t * lqt_open_read(const char *filename)
Open a file for reading.
int lqt_get_codec_api_version()
Get the codec API version.
quicktime_t * lqt_open_read_with_log(const char *filename, lqt_log_callback_t cb, void *log_data)
Open a file for reading.
int lqt_fileno(quicktime_t *file)
Return the raw filedescriptor associated with the file.
int lqt_get_wav_id(quicktime_t *file, int track)
Get the WAVE id of an audio track.
int lqt_is_avi(quicktime_t *file)
Query if the function is an AVI.
const char * lqt_file_type_to_string(lqt_file_type_t type)
Get a human readable filetype.
struct quicktime_s quicktime_t
Quicktime handle.
Definition quicktime.h:306
void(* lqt_log_callback_t)(lqt_log_level_t level, const char *domain, const char *message, void *data)
Log callback.
Definition quicktime.h:140
void lqt_set_log_callback(lqt_log_callback_t cb, void *data)
Set callback for global logging.
char * lqt_get_comment(quicktime_t *file)
Get the comment from the file.
void lqt_set_album(quicktime_t *file, char *string)
Set the album for the file.
void lqt_set_genre(quicktime_t *file, char *string)
Set the genre for the file.
void lqt_set_author(quicktime_t *file, char *string)
Set the author for the file.
unsigned long lqt_get_creation_time(quicktime_t *file)
Get the creation time from the file.
char * lqt_get_genre(quicktime_t *file)
Get the genre from the file.
void lqt_set_track(quicktime_t *file, char *string)
Set the track number for the file.
char * lqt_get_author(quicktime_t *file)
Get the author from the file.
char * lqt_get_album(quicktime_t *file)
Get the album from the file.
void lqt_set_comment(quicktime_t *file, char *string)
Set the comment for the file.
void lqt_set_artist(quicktime_t *file, char *string)
Set the artist for the file.
char * lqt_get_track(quicktime_t *file)
Get the track number from the file.
char * lqt_get_artist(quicktime_t *file)
Get the artist from the file.
void lqt_set_creation_time(quicktime_t *file, unsigned long time)
Set the creation time for the file.
void lqt_set_channel_setup(quicktime_t *file, int track, lqt_channel_t *ch)
Set a channel setup for an audio track.
const lqt_channel_t * lqt_get_channel_setup(quicktime_t *file, int track)
Get a channel setup from a file.
const char * lqt_channel_to_string(lqt_channel_t ch)
Convert a channel identifier to a human readnable string.
lqt_channel_t
Channel definitions.
Definition quicktime.h:176
int lqt_is_chapter_track(quicktime_t *file, int track)
Check if a track is a chapter track.
int lqt_text_tracks(quicktime_t *file)
Get the number of text tracks.
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.
void lqt_set_text_time(quicktime_t *file, int track, int64_t time)
Go to a specific time.
int lqt_get_text_language(quicktime_t *file, int track, char *language)
Get the text language.
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.
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_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.
int lqt_text_time_scale(quicktime_t *file, int track)
Get the timescale for a text track.
void lqt_set_chapter_track(quicktime_t *file, int track)
Make a text track a chapter track.
void lqt_set_text_language(quicktime_t *file, int track, const char *language)
Set the language for a text 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.
void lqt_set_text_pts_offset(quicktime_t *file, int track, int64_t offset)
Set an video pts offset.
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.
int lqt_add_text_track(quicktime_t *file, int timescale)
Add a text track.
int lqt_write_text(quicktime_t *file, int track, const char *text, int64_t duration)
Write a text sample.
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.
int lqt_read_timecode(quicktime_t *file, int track, uint32_t *timecode)
Read the timecode for the next frame to be decoded.
void lqt_set_timecode_track_enabled(quicktime_t *file, int track, int enabled)
Enable or disable a timecode track.
void lqt_set_timecode_tape_name(quicktime_t *file, int track, const char *tapename)
Set the tapename for a timecode track.
void lqt_write_timecode(quicktime_t *file, int track, uint32_t timecode)
Write a timecode for the next video frame to be encoded.
const char * lqt_get_timecode_tape_name(quicktime_t *file, int track)
Get the tape name stored in a timecode track.
int lqt_has_timecode_track(quicktime_t *file, int track, uint32_t *flags, int *framerate)
Check, if a video track has timecodes.
int lqt_get_timecode_track_enabled(quicktime_t *file, int track)
Get the enabled flag of a 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.
long lqt_video_edit_time(quicktime_t *file, int track, int entry_index)
Get the time offset of a video track edit segment.
lqt_interlace_mode_t lqt_get_interlace_mode(quicktime_t *file, int track)
Get the interlace mode.
long lqt_video_edit_duration(quicktime_t *file, int track, int entry_index)
Get the duration of a video track edit segment.
lqt_chroma_placement_t lqt_get_chroma_placement(quicktime_t *file, int track)
Get the chroma placement.
long lqt_video_edit_list_total_entries(quicktime_t *file, int track)
Get the number of video track edit segments.
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.
float lqt_video_edit_rate(quicktime_t *file, int track, int entry_index)
Get the rate of a video track edit segment.
int lqt_get_decoder_colormodel(quicktime_t *file, int track)
Get the native colormodel of the decoder.
int lqt_frame_duration(quicktime_t *file, int track, int *constant)
Get the duration of the NEXT frame to be decoded.
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.
int lqt_video_time_scale(quicktime_t *file, int track)
Get the timescale of the track.
void lqt_seek_video(quicktime_t *file, int track, int64_t time)
Seek to a specific video time.
int64_t lqt_video_duration(quicktime_t *file, int track)
Get the duration of a video track.
int64_t lqt_frame_time(quicktime_t *file, int track)
Get the timestamp of the next frame to be decoded.
int lqt_decode_video(quicktime_t *file, unsigned char **row_pointers, int track)
Decode one video frame.
int64_t lqt_get_video_pts_offset(quicktime_t *file, int track)
Get an video pts offset.
int64_t lqt_get_frame_time(quicktime_t *file, int track, int frame)
Get the timestamp of a given frame.
int lqt_encode_video_d(quicktime_t *file, unsigned char **row_pointers, int track, int64_t time, int duration)
Encode one video frame.
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.
int lqt_set_video_codec(quicktime_t *file, int track, lqt_codec_info_t *info)
Set a codec for an audio track.
void lqt_set_video_pts_offset(quicktime_t *file, int track, int64_t offset)
Set an video pts offset.
int lqt_set_interlace_mode(quicktime_t *file, int track, lqt_interlace_mode_t mode)
Set the interlace mode.
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.
int lqt_encode_video(quicktime_t *file, unsigned char **row_pointers, int track, int64_t time)
Encode one video frame.
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.
int lqt_set_video_pass(quicktime_t *file, int pass, int total_passes, const char *stats_file, int track)
Enable multipass encoding.
int lqt_get_best_colormodel(quicktime_t *file, int track, int *supported)
Get the best colormodel out of a list of supported colormodels.
void lqt_rows_clear(uint8_t **rows, int width, int height, int rowspan, int rowspan_uv, int colormodel)
Clear a video frame.
lqt_chroma_placement_t
Chroma placement.
Definition quicktime.h:272
const char * lqt_chroma_placement_to_string(lqt_chroma_placement_t chroma_placement)
Convert a chroma placement to a human readable string.
const char * lqt_interlace_mode_to_string(lqt_interlace_mode_t mode)
Convert an interlace mode to a human readable string.
lqt_interlace_mode_t
interlace modes
Definition quicktime.h:256
void lqt_set_row_span_uv(quicktime_t *file, int track, int row_span_uv)
Set the row span for the chroma planes.
void lqt_set_cmodel(quicktime_t *file, int track, int colormodel)
Set the colormodel for en-/decoding.
int lqt_get_cmodel(quicktime_t *file, int track)
Get the colormodel, which will be valid for the next en-/decode call.
void lqt_set_row_span(quicktime_t *file, int track, int row_span)
Set the row span for the luma plane.
void lqt_set_video_parameter(quicktime_t *file, int track, const char *key, const void *value)
Set a codec parameter for a video track.
void lqt_rows_free(uint8_t **rows)
Free a frame allocated by lqt_rows_alloc.
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.
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.
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_file_type_t
File types.
Definition quicktime.h:153