|
FFmpeg 9.0
|
Functions for querying libavformat capabilities, allocating core structures, etc. More...
Macros | |
| #define | AVFMT_PROGCOPY_MATCH_BY_ID (1 << 0) |
| match streams using stream id | |
| #define | AVFMT_PROGCOPY_MATCH_BY_INDEX (1 << 1) |
| match streams using stream index | |
| #define | AVFMT_PROGCOPY_OVERWRITE (1 << 8) |
| overwrite pre-existing program having same ID | |
Functions | |
| unsigned | avformat_version (void) |
| Return the LIBAVFORMAT_VERSION_INT constant. | |
| const char * | avformat_configuration (void) |
| Return the libavformat build-time configuration. | |
| const char * | avformat_license (void) |
| Return the libavformat license. | |
| int | avformat_network_init (void) |
| Do global initialization of network libraries. | |
| int | avformat_network_deinit (void) |
| Undo the initialization done by avformat_network_init. | |
| const AVOutputFormat * | av_muxer_iterate (void **opaque) |
| Iterate over all registered muxers. | |
| const AVInputFormat * | av_demuxer_iterate (void **opaque) |
| Iterate over all registered demuxers. | |
| AVFormatContext * | avformat_alloc_context (void) |
| Allocate an AVFormatContext. | |
| void | avformat_free_context (AVFormatContext *s) |
| Free an AVFormatContext and all its streams. | |
| const AVClass * | avformat_get_class (void) |
| Get the AVClass for AVFormatContext. | |
| const AVClass * | av_stream_get_class (void) |
| Get the AVClass for AVStream. | |
| const AVClass * | av_stream_group_get_class (void) |
| Get the AVClass for AVStreamGroup. | |
| const char * | avformat_stream_group_name (enum AVStreamGroupParamsType type) |
| AVStreamGroup * | avformat_stream_group_create (AVFormatContext *s, enum AVStreamGroupParamsType type, AVDictionary **options) |
| Add a new empty stream group to a media file. | |
| AVStream * | avformat_new_stream (AVFormatContext *s, const struct AVCodec *c) |
| Add a new stream to a media file. | |
| int | avformat_stream_group_add_stream (AVStreamGroup *stg, AVStream *st) |
| Add an already allocated stream to a stream group. | |
| AVProgram * | av_new_program (AVFormatContext *s, int id) |
| int | av_program_copy (AVFormatContext *dst, const AVFormatContext *src, int progid, int flags) |
| Copy an AVProgram from one AVFormatContext to another. | |
Functions for querying libavformat capabilities, allocating core structures, etc.
| #define AVFMT_PROGCOPY_MATCH_BY_ID (1 << 0) |
match streams using stream id
Definition at line 2127 of file avformat.h.
| #define AVFMT_PROGCOPY_MATCH_BY_INDEX (1 << 1) |
match streams using stream index
Definition at line 2128 of file avformat.h.
| #define AVFMT_PROGCOPY_OVERWRITE (1 << 8) |
overwrite pre-existing program having same ID
Definition at line 2129 of file avformat.h.
| unsigned avformat_version | ( | void | ) |
Return the LIBAVFORMAT_VERSION_INT constant.
| const char * avformat_configuration | ( | void | ) |
Return the libavformat build-time configuration.
| const char * avformat_license | ( | void | ) |
Return the libavformat license.
| int avformat_network_init | ( | void | ) |
Do global initialization of network libraries.
This is optional, and not recommended anymore.
This functions only exists to work around thread-safety issues with older GnuTLS or OpenSSL libraries. If libavformat is linked to newer versions of those libraries, or if you do not use them, calling this function is unnecessary. Otherwise, you need to call this function before any other threads using them are started.
This function will be deprecated once support for older GnuTLS and OpenSSL libraries is removed, and this function has no purpose anymore.
Referenced by main().
| int avformat_network_deinit | ( | void | ) |
Undo the initialization done by avformat_network_init.
Call it only once for each time you called avformat_network_init.
Referenced by main().
| const AVOutputFormat * av_muxer_iterate | ( | void ** | opaque | ) |
Iterate over all registered muxers.
| opaque | a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. |
| const AVInputFormat * av_demuxer_iterate | ( | void ** | opaque | ) |
Iterate over all registered demuxers.
| opaque | a pointer where libavformat will store the iteration state. Must point to NULL to start the iteration. |
| AVFormatContext * avformat_alloc_context | ( | void | ) |
Allocate an AVFormatContext.
avformat_free_context() can be used to free the context and everything allocated by the framework within it.
Referenced by main(), and open_output_file().
| void avformat_free_context | ( | AVFormatContext * | s | ) |
Free an AVFormatContext and all its streams.
| s | context to free |
Referenced by main(), and open_output_file().
| const AVClass * avformat_get_class | ( | void | ) |
Get the AVClass for AVFormatContext.
It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.
| const AVClass * av_stream_get_class | ( | void | ) |
It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.
| const AVClass * av_stream_group_get_class | ( | void | ) |
Get the AVClass for AVStreamGroup.
It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.
| const char * avformat_stream_group_name | ( | enum AVStreamGroupParamsType | type | ) |
| AVStreamGroup * avformat_stream_group_create | ( | AVFormatContext * | s, |
| enum AVStreamGroupParamsType | type, | ||
| AVDictionary ** | options ) |
Add a new empty stream group to a media file.
When demuxing, it may be called by the demuxer in read_header(). If the flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also be called in read_packet().
When muxing, may be called by the user before avformat_write_header().
User is required to call avformat_free_context() to clean up the allocation by avformat_stream_group_create().
New streams can be added to the group with avformat_stream_group_add_stream().
| s | media file handle |
| AVStream * avformat_new_stream | ( | AVFormatContext * | s, |
| const struct AVCodec * | c ) |
Add a new stream to a media file.
When demuxing, it is called by the demuxer in read_header(). If the flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also be called in read_packet().
When muxing, should be called by the user before avformat_write_header().
User is required to call avformat_free_context() to clean up the allocation by avformat_new_stream().
| s | media file handle |
| c | unused, does nothing |
Referenced by add_stream(), dec_enc(), dec_enc(), main(), open_output_file(), and open_output_file().
| int avformat_stream_group_add_stream | ( | AVStreamGroup * | stg, |
| AVStream * | st ) |
Add an already allocated stream to a stream group.
When demuxing, it may be called by the demuxer in read_header(). If the flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also be called in read_packet().
When muxing, may be called by the user before avformat_write_header() after having allocated a new group with avformat_stream_group_create() and stream with avformat_new_stream().
User is required to call avformat_free_context() to clean up the allocation by avformat_stream_group_add_stream().
| stg | stream group belonging to a media file. |
| st | stream in the media file to add to the group. |
| 0 | success |
| AVERROR(EEXIST) | the stream was already in the group |
| another negative error code | legitimate errors |
| AVProgram * av_new_program | ( | AVFormatContext * | s, |
| int | id ) |
| int av_program_copy | ( | AVFormatContext * | dst, |
| const AVFormatContext * | src, | ||
| int | progid, | ||
| int | flags ) |
Copy an AVProgram from one AVFormatContext to another.
Streams in the destination context whose designated attribute match the attribute of the streams in the source AVProgram index are added to the stream index of the copied AVProgram. The attribute is designated using AVFMT_PROGCOPY_MATCH_ flags.
If a new program has to be added, the function expects and requires any existing buffer holding the array of pointers to AVPrograms in the destination context to have its size be a power-of-two value. This should be the case if all earlier programs were created using av_new_program or this function.
| dst | pointer to the target muxer context |
| src | pointer to the source muxer context |
| progid | ID of the program to be copied |
| flags | combination of flags which determine how streams are matched and whether pre-existing AVProgram in target is overwritten. If no match condition is set, streams will be matched by ids if all source stream ids are non-zero and unique, else by index. |