Functions | |
long | quicktime_video_length (quicktime_t *file, int track) |
Get the video length. | |
long | quicktime_video_position (quicktime_t *file, int track) |
Get the video position. | |
int | quicktime_video_tracks (quicktime_t *file) |
Get the number of video tracks. | |
int | quicktime_has_video (quicktime_t *file) |
Check if a file has at least one video track. | |
int | quicktime_video_width (quicktime_t *file, int track) |
Get the width of a video track. | |
int | quicktime_video_height (quicktime_t *file, int track) |
Get the height of a video track. | |
int | quicktime_video_depth (quicktime_t *file, int track) |
Get the depth of a video track. | |
double | quicktime_frame_rate (quicktime_t *file, int track) |
Get the framerate of a video track. | |
char * | quicktime_video_compressor (quicktime_t *file, int track) |
Get the four character code of a video track. | |
long | quicktime_frame_size (quicktime_t *file, long frame, int track) |
Get the compressed size of frame in a video track. | |
int | quicktime_set_video_position (quicktime_t *file, int64_t frame, int track) |
Seek to a specific video frame. | |
long | quicktime_read_frame (quicktime_t *file, unsigned char *video_buffer, int track) |
Read a compressed video frame. | |
int | quicktime_supported_video (quicktime_t *file, int track) |
Check if a video track is supported by libquicktime. | |
int | quicktime_reads_cmodel (quicktime_t *file, int colormodel, int track) |
Check if a colormodel is supported for decoding. | |
int | quicktime_decode_video (quicktime_t *file, unsigned char **row_pointers, int track) |
Decode a video frame in BC_RGB888. | |
long | quicktime_decode_scaled (quicktime_t *file, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, int color_model, unsigned char **row_pointers, int track) |
Decode aand optionally scale a video frame. | |
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_interlace_mode_t | lqt_get_interlace_mode (quicktime_t *file, int track) |
Get the interlace mode. | |
lqt_chroma_placement_t | lqt_get_chroma_placement (quicktime_t *file, int track) |
Get the chroma placement. | |
int | lqt_get_decoder_colormodel (quicktime_t *file, int track) |
Get the native colormodel of the decoder. | |
int64_t | lqt_get_frame_time (quicktime_t *file, int track, int frame) |
Get the timestamp of a given frame. | |
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. | |
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_frame_duration (quicktime_t *file, int track, int *constant) |
Get the duration of the NEXT frame to be decoded. | |
int | lqt_video_time_scale (quicktime_t *file, int track) |
Get the timescale of the track. | |
int64_t | lqt_video_duration (quicktime_t *file, int track) |
Get the duration of a video track. | |
long | lqt_video_edit_list_total_entries (quicktime_t *file, int track) |
Get the number of video track edit segments. | |
long | lqt_video_edit_duration (quicktime_t *file, int track, int entry_index) |
Get the duration of a video track edit segment. | |
long | lqt_video_edit_time (quicktime_t *file, int track, int entry_index) |
Get the time offset of a video track edit segment. | |
float | lqt_video_edit_rate (quicktime_t *file, int track, int entry_index) |
Get the rate of a video track edit segment. | |
void | lqt_seek_video (quicktime_t *file, int track, int64_t time) |
Seek to a specific video time. | |
int64_t | lqt_get_video_pts_offset (quicktime_t *file, int track) |
Get an video pts offset. |
The video API changed a lot during the last years (causing lot of confusion), so here is the preferred way: First get the number of video tracks with quicktime_video_tracks. Then for each track you want to decode, use quicktime_supported_video to verify that a codec is available. Then for each track, get the frame size with quicktime_video_width and quicktime_video_height . The framerate is only exact when handled as a rational number. Thus, you'll need 2 functions lqt_video_time_scale and lqt_frame_duration . The framerate in frames/sec becomes time_scale/frame_duration. Further format information can be obtained with lqt_get_pixel_aspect, lqt_get_interlace_mode and lqt_get_chroma_placement.
A very important thing is the colormodel (see Color handling): First obtain the colormodel used natively by the codec with lqt_get_cmodel. Your application might or might not support all colormodels, which exist in libquicktime. The more colormodels you can handle yourself, the better, since libquicktimes built in colormodel converter is not the best. Thus, it's the best idea to pack all colormodels you can handle yourself into an array, and call lqt_get_best_colormodel to get the best colormodel. After you figured out, which colormodel you use, tell this to libquicktime with lqt_set_cmodel.
When decoding frames, libquicktime by default assumes, that the frames you pass to it have no padding bytes between the scanlines. Some APIs however padd scanlines to certain boundaries. If this is the case, you must tell this to libquicktime by calling lqt_set_row_span and lqt_set_row_span_uv (for planar formats).
Then, for each frame, it's wise to get the timestamp with lqt_frame_time before decoding it. This will make sure, that you'll support tracks with nonconstant framerates. The actual decoding then should happen with lqt_decode_video.
long quicktime_video_length | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the video length.
file | A quicktime handle | |
track | index (starting with 0) |
long quicktime_video_position | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the video position.
file | A quicktime handle | |
track | index (starting with 0) |
int quicktime_video_tracks | ( | quicktime_t * | file | ) |
Get the number of video tracks.
file | A quicktime handle |
int quicktime_has_video | ( | quicktime_t * | file | ) |
Check if a file has at least one video track.
file | A quicktime handle |
int quicktime_video_width | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the width of a video track.
file | A quicktime handle | |
track | index (starting with 0) |
int quicktime_video_height | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the height of a video track.
file | A quicktime handle | |
track | index (starting with 0) |
int quicktime_video_depth | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the depth of a video track.
file | A quicktime handle | |
track | index (starting with 0) |
To get some better informations about the pixel format, a codec will deliver, use lqt_get_cmodel or (better) lqt_get_decoder_colormodel .
double quicktime_frame_rate | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the framerate of a video track.
file | A quicktime handle | |
track | index (starting with 0) |
To get the framerate as a rational number (and check if it's constant), use lqt_frame_duration and lqt_video_time_scale .
char* quicktime_video_compressor | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the four character code of a video track.
file | A quicktime handle | |
track | index (starting with 0) |
long quicktime_frame_size | ( | quicktime_t * | file, | |
long | frame, | |||
int | track | |||
) |
Get the compressed size of frame in a video track.
file | A quicktime handle | |
frame | Frame index (starting with 0) | |
track | index (starting with 0) |
int quicktime_set_video_position | ( | quicktime_t * | file, | |
int64_t | frame, | |||
int | track | |||
) |
Seek to a specific video frame.
file | A quicktime handle | |
frame | The frame position (starting with 0) | |
track | index (starting with 0) |
long quicktime_read_frame | ( | quicktime_t * | file, | |
unsigned char * | video_buffer, | |||
int | track | |||
) |
Read a compressed video frame.
file | A quicktime handle | |
video_buffer | The compressed frame | |
track | index (starting with 0) |
int quicktime_supported_video | ( | quicktime_t * | file, | |
int | track | |||
) |
Check if a video track is supported by libquicktime.
file | A quicktime handle | |
track | index (starting with 0) |
int quicktime_reads_cmodel | ( | quicktime_t * | file, | |
int | colormodel, | |||
int | track | |||
) |
Check if a colormodel is supported for decoding.
file | A quicktime handle | |
colormodel | A colormodel (see Color handling) | |
track | index (starting with 0) |
int quicktime_decode_video | ( | quicktime_t * | file, | |
unsigned char ** | row_pointers, | |||
int | track | |||
) |
Decode a video frame in BC_RGB888.
file | A quicktime handle | |
row_pointers | Frame buffer (see lqt_rows_alloc ) | |
track | index (starting with 0) |
long quicktime_decode_scaled | ( | quicktime_t * | file, | |
int | in_x, | |||
int | in_y, | |||
int | in_w, | |||
int | in_h, | |||
int | out_w, | |||
int | out_h, | |||
int | color_model, | |||
unsigned char ** | row_pointers, | |||
int | track | |||
) |
Decode aand optionally scale a video frame.
file | A quicktime handle | |
in_x | Horizontal offset of the image relative to the source image | |
in_y | Vertical offset of the image relative to the source image | |
in_w | Image width in the source image | |
in_h | Image height in the source image | |
out_w | Width of output frame | |
out_h | Height of output frame | |
color_model | Colormodel of the output frame | |
row_pointers | Frame buffer (see lqt_rows_alloc ) | |
track | index (starting with 0) |
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.
file | A quicktime handle | |
track | Track index (starting with 0) | |
pixel_width | returns the pixel width | |
pixel_height | returns the pixel height |
lqt_interlace_mode_t lqt_get_interlace_mode | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the interlace mode.
file | A quicktime handle | |
track | Track index (starting with 0) |
lqt_chroma_placement_t lqt_get_chroma_placement | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the chroma placement.
file | A quicktime handle | |
track | Track index (starting with 0) |
int lqt_get_decoder_colormodel | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the native colormodel of the decoder.
file | A quicktime handle | |
track | Track index (starting with 0) |
int64_t lqt_get_frame_time | ( | quicktime_t * | file, | |
int | track, | |||
int | frame | |||
) |
Get the timestamp of a given frame.
file | A quicktime handle | |
track | Track index (starting with 0) | |
frame | The frame |
int64_t lqt_frame_time | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the timestamp of the next frame to be decoded.
file | A quicktime handle | |
track | Track index (starting with 0) |
int lqt_decode_video | ( | quicktime_t * | file, | |
unsigned char ** | row_pointers, | |||
int | track | |||
) |
Decode one video frame.
file | A quicktime handle | |
row_pointers | Frame (see lqt_rows_alloc) | |
track | Track index (starting with 0) |
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.
file | A quicktime handle | |
buffer | Buffer where the frame will be read to | |
buffer_alloc | Number of bytes allocated for the buffer | |
frame | Number of the frame to be read (starting with 0) | |
time | If non NULL, returns the timestamp in timescale tics | |
track | Track index (starting with 0) |
int lqt_frame_duration | ( | quicktime_t * | file, | |
int | track, | |||
int * | constant | |||
) |
Get the duration of the NEXT frame to be decoded.
file | A quicktime handle | |
track | Track index (starting with 0) | |
constant | If non NULL it will be set to 1 if the frame duration is constant throughout the whole track |
int lqt_video_time_scale | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the timescale of the track.
file | A quicktime handle | |
track | Track index (starting with 0) |
int64_t lqt_video_duration | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the duration of a video track.
file | A quicktime handle | |
track | Track index (starting with 0) |
long lqt_video_edit_list_total_entries | ( | quicktime_t * | file, | |
int | track | |||
) |
Get the number of video track edit segments.
file | A quicktime handle | |
track | Video track index (starting with 0) |
long lqt_video_edit_duration | ( | quicktime_t * | file, | |
int | track, | |||
int | entry_index | |||
) |
Get the duration of a video track edit segment.
file | A quicktime handle | |
track | Video track index (starting with 0) | |
entry_index | Index into the edit segments |
long lqt_video_edit_time | ( | quicktime_t * | file, | |
int | track, | |||
int | entry_index | |||
) |
Get the time offset of a video track edit segment.
file | A quicktime handle | |
track | Video track index (starting with 0) | |
entry_index | Index into the edit segments |
float lqt_video_edit_rate | ( | quicktime_t * | file, | |
int | track, | |||
int | entry_index | |||
) |
Get the rate of a video track edit segment.
file | A quicktime handle | |
track | Video track index (starting with 0) | |
entry_index | Index into the edit segments |
void lqt_seek_video | ( | quicktime_t * | file, | |
int | track, | |||
int64_t | time | |||
) |
Seek to a specific video time.
file | A quicktime handle | |
time | The desired time of the next frame in timescale tics (starting with 0) | |
track | index (starting with 0) |
int64_t lqt_get_video_pts_offset | ( | quicktime_t * | file, | |
int | track | |||
) |
Get an video pts offset.
file | A quicktime handle | |
track | Track index (starting with 0) |