📄 quicktime.h
字号:
/** \ingroup video_codecs * \brief 8 bit Packed YUV 4:4:4 * * Should always be there, can safely be hardcoded. */ #define QUICKTIME_V308 "v308"/** \ingroup video_codecs * \brief 8 bit Packed YUVA 4:4:4:4 * * Should always be there, can safely be hardcoded. */#define QUICKTIME_V408 "v408"/** \ingroup video_codecs * \brief 10 bit Packed YUV 4:2:2 * * Should always be there, can safely be hardcoded. */ #define QUICKTIME_V210 "v210"/** \ingroup video_codecs * \brief 10 bit Packed YUV 4:4:4 * * Should always be there, can safely be hardcoded. */#define QUICKTIME_V410 "v410"/* =================== Audio formats ======================= *//** \defgroup audio_codecs Audio codec identifiers * \brief Audio codec identifiers * * These definintions are for some more commonly used codecs. * They can be used as the compressor argument for \ref quicktime_set_audio . * There is, however, no way to check, if a * codec is accually present on the system. * It should also be noted, that libquicktime supports more codecs, than * are listed here. For these reasons, it's strongly recommended * to use the more sophisticated codec selection mechanism via the * \ref codec_registry . *//** \ingroup audio_codecs * \brief Unsigned 8 bit * * Should always be there, can safely be hardcoded. */ #define QUICKTIME_RAWAUDIO "raw "/** \ingroup audio_codecs * \brief IMA4 * * Should always be there, can safely be hardcoded. */#define QUICKTIME_IMA4 "ima4"/** \ingroup audio_codecs * \brief Twos compliment 16 bit * * Should always be there, can safely be hardcoded. */ #define QUICKTIME_TWOS "twos"/** \ingroup audio_codecs * \brief mu-law 2:1 * * Should always be there, can safely be hardcoded. */ #define QUICKTIME_ULAW "ulaw"/** \ingroup audio_codecs * \brief Ogg Vorbis * * This depends on libvorbis and creates incompatible streams, * which won't play anywhere except libquicktime and perhaps * quicktime4linux. Never hardcode this. */#define QUICKTIME_VORBIS "OggS"/** \ingroup audio_codecs * \brief MP3 * * This depends on lame, which might or might not be there. * Never hardcode this. */#define QUICKTIME_MP3 ".mp3" /* =========================== public interface ========================= // *//** \ingroup general * \brief Get the quicktime4linux major version * * This returns the major quicktime4linux version. The complete version is 2.0.0, which * was the last qt4l version from which we ported code. It's not usable for detecting the * libquicktime version. */ /* Get version information */int quicktime_major();/** \ingroup general * \brief Get the quicktime4linux minor version * * This returns the minor quicktime4linux version. The complete version is 2.0.0, which * was the last qt4l version from which we ported code. It's not usable for detecting the * libquicktime version. */int quicktime_minor();/** \ingroup general * \brief Get the quicktime4linux release number * * This returns the release number of quicktime4linux. The complete version is 2.0.0, which * was the last qt4l version from which we ported code. It's not usable for detecting the * libquicktime version. */int quicktime_release();/** \ingroup general \brief Test file compatibility \param path A path to a regular file \returns 1 if the file is decodable by libquicktime. Check the signature of a path and return 1 is the file is likely to ba decodable by libquicktime. This check might return false positives or false negatives. In general it's better (although slower) to check, if \ref quicktime_open return NULL or not. */ int quicktime_check_sig(char *path);/** \ingroup general \brief Open a file \param filename A path to a regular file \param rd 1 for open readonly, 0 else \param wr 1 for open writeonly, 0 else \returns An initialized file handle or NULL if opening failed. Note, that files can never be opened read/write mode.*/ quicktime_t* quicktime_open(const char *filename, int rd, int wr);/** \ingroup general \brief Make a file streamable \param in_path Existing non streamable file \param out_path Output file \returns 1 if an error occurred, 0 else This function makes a file streamable by placing the moov header at the beginning of the file. Note that you need approximately the twice the disk-space of the file. It is recommended, that this function is called only for files, which are encoded by libquicktime. Other files might not be correctly written.*/ int quicktime_make_streamable(char *in_path, char *out_path);/** \defgroup metadata Metadata support \brief Metadata support These functions allow you to read/write the metadata of the file. Currently, only the metadata in the udta atom are supported.*//** \ingroup metadata \brief Set the copyright info for the file \param file A quicktime handle \param string The copyright info*/ void quicktime_set_copyright(quicktime_t *file, char *string);/** \ingroup metadata \brief Set the name for the file \param file A quicktime handle \param string The name*/void quicktime_set_name(quicktime_t *file, char *string);/** \ingroup metadata \brief Set info for the file \param file A quicktime handle \param string An info string*/void quicktime_set_info(quicktime_t *file, char *string);/** \ingroup metadata \brief Get the copyright info from the file \param file A quicktime handle \returns The copyright info or NULL*/ char* quicktime_get_copyright(quicktime_t *file);/** \ingroup metadata \brief Get the name from the file \param file A quicktime handle \returns The name or NULL*/ char* quicktime_get_name(quicktime_t *file);/** \ingroup metadata \brief Get the info string from the file \param file A quicktime handle \returns The info string or NULL*/ char* quicktime_get_info(quicktime_t *file);/** \ingroup audio_encode \brief Set up tracks in a new file after opening and before writing \param file A quicktime handle \param channels Number of channels \param sample_rate Samplerate \param bits Bits per sample \param compressor Compressor to use Returns the number of quicktime tracks allocated. Audio is stored two channels per quicktime track. This function is depracated and should not be used in newly written code. It won't let you add individual tracks with different codecs, samplerates etc. Use \ref lqt_add_audio_track instread.*/ int quicktime_set_audio(quicktime_t *file, int channels, long sample_rate, int bits, char *compressor);/** \ingroup video_encode \brief Set the framerate for encoding \param file A quicktime handle \param framerate framerate Sets the framerate for encoding. This function is depracated and should not be used in newly written code.*/void quicktime_set_framerate(quicktime_t *file, double framerate);/** \ingroup video_encode \brief Set up video tracks for encoding \param file A quicktime handle \param tracks Number of tracks \param frame_w Frame width \param frame_h Frame height \param frame_rate Frame rate (in frames per second) \param compressor Four character code of the compressor This function is depracated and should not be used in newly written code. It won't allow you to set multiple video streams with different formats, and passing a double framerate causes rounding errors. Use \ref lqt_add_video_track instead.*/ int quicktime_set_video(quicktime_t *file, int tracks, int frame_w, int frame_h, double frame_rate, char *compressor);/** \ingroup video_encode \brief Set jpeg encoding quality \param file A quicktime handle \param quality Quality (0..100) \param use_float Use floating point routines Set the jpeg encoding quality and whether to use floating point routines. This should be called after creating the video track(s). This function is depracated and should not be used in newly written code. Use \ref lqt_set_video_parameter instead.*/ void quicktime_set_jpeg(quicktime_t *file, int quality, int use_float);/** \ingroup video_encode * \brief Set a codec parameter * \param file A quicktime handle * \param key Short name of the parameter * \param value Parameter value. * * For integer parameters, value must be of the type int*. For string parameters, * use char*. * * This function sets the same parameter for all video AND audio streams, which is quite * idiotic. Use \ref lqt_set_audio_parameter and \ref lqt_set_video_parameter to set * codec parameters on a per stream basis. */void quicktime_set_parameter(quicktime_t *file, char *key, void *value);/** \ingroup video_encode * \brief Set the depth of a video track. * \param file A quicktime handle * \param depth The depth (bits per pixel) * \param track index (starting with 0) * * This function is deprecated and should never be called. * The depth is set by the codecs and there is no reason to change this. * */void quicktime_set_depth(quicktime_t *file, int depth, int track);/** \ingroup video * \brief Set the colormodel for en-/decoding * \param file A quicktime handle * \param colormodel The colormodel to use. * * This sets the colormodels for all video tracks at once. * It's a better idea to use \ref lqt_set_cmodel instead. */void quicktime_set_cmodel(quicktime_t *file, int colormodel);/** \ingroup video * \brief Set the row_span for en-/decoding * \param file A quicktime handle * \param row_span The rowspan to use. * * This sets the rowspans for all video tracks at once. * It's a better idea to use \ref lqt_set_row_span and * \ref lqt_set_row_span_uv instead. */void quicktime_set_row_span(quicktime_t *file, int row_span);/** \ingroup general * \brief Close a quicktime handle and free all associated memory * \param file A quicktime handle */ int quicktime_close(quicktime_t *file);/* get length information *//* channel numbers start on 1 for audio and video *//** \ingroup audio_decode * \brief Get the audio length * \param file A quicktime handle * \param track index (starting with 0) * \returns The total number of uncompressed audio samples in the track */ long quicktime_audio_length(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the video length * \param file A quicktime handle * \param track index (starting with 0) * \returns The total number of video frames in the track * * Note that for tracks with nonconstant framerate, you won't be able to obtain the * track duration from the number of frame. If you are interested in the total playing time, * use \ref lqt_video_duration */long quicktime_video_length(quicktime_t *file, int track);/** \ingroup audio_decode * \brief Get the audio position * \param file A quicktime handle * \param track index (starting with 0) * \returns The number (starting with 0) of the next sample to be decoded. */ /* get position information */long quicktime_audio_position(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the video position * \param file A quicktime handle * \param track index (starting with 0) * \returns The number (starting with 0) of the next frame to be decoded. * * To get timestamps for tracks with nonconstant framerate, use \ref lqt_frame_time */long quicktime_video_position(quicktime_t *file, int track);/** \ingroup video_decode * \brief Get the number of video tracks * \param file A quicktime handle * \returns The number of video tracks */ /* get file information */int quicktime_video_tracks(quicktime_t *file);/** \ingroup audio_decode * \brief Get the number of audio tracks * \param file A quicktime handle * \returns The number of audio tracks */int quicktime_audio_tracks(quicktime_t *file);/** \ingroup audio_decode * \brief Check if a file has at least one audio track * \param file A quicktime handle * \returns 1 if the file has audio tracks, 0 else */ int quicktime_has_audio(quicktime_t *file);/** \ingroup audio_decode * \brief Get the samplerate of an audio track * \param file A quicktime handle * \param track index (starting with 0) * \returns The samplerate in Hz
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -