FFmpeg  3.2.10
Functions
Core functions

Functions for querying libavformat capabilities, allocating core structures, etc. More...

Functions

unsigned avformat_version (void)
 Return the LIBAVFORMAT_VERSION_INT constant. More...
 
const char * avformat_configuration (void)
 Return the libavformat build-time configuration. More...
 
const char * avformat_license (void)
 Return the libavformat license. More...
 
void av_register_all (void)
 Initialize libavformat and register all the muxers, demuxers and protocols. More...
 
void av_register_input_format (AVInputFormat *format)
 
void av_register_output_format (AVOutputFormat *format)
 
int avformat_network_init (void)
 Do global initialization of network components. More...
 
int avformat_network_deinit (void)
 Undo the initialization done by avformat_network_init. More...
 
AVInputFormatav_iformat_next (const AVInputFormat *f)
 If f is NULL, returns the first registered input format, if f is non-NULL, returns the next registered input format after f or NULL if f is the last one. More...
 
AVOutputFormatav_oformat_next (const AVOutputFormat *f)
 If f is NULL, returns the first registered output format, if f is non-NULL, returns the next registered output format after f or NULL if f is the last one. More...
 
AVFormatContextavformat_alloc_context (void)
 Allocate an AVFormatContext. More...
 
void avformat_free_context (AVFormatContext *s)
 Free an AVFormatContext and all its streams. More...
 
const AVClassavformat_get_class (void)
 Get the AVClass for AVFormatContext. More...
 
AVStreamavformat_new_stream (AVFormatContext *s, const AVCodec *c)
 Add a new stream to a media file. More...
 
uint8_t * av_stream_new_side_data (AVStream *stream, enum AVPacketSideDataType type, int size)
 Allocate new information from stream. More...
 
uint8_t * av_stream_get_side_data (const AVStream *stream, enum AVPacketSideDataType type, int *size)
 Get side information from stream. More...
 
AVProgramav_new_program (AVFormatContext *s, int id)
 

Detailed Description

Functions for querying libavformat capabilities, allocating core structures, etc.

Function Documentation

◆ avformat_version()

unsigned avformat_version ( void  )

Return the LIBAVFORMAT_VERSION_INT constant.

◆ avformat_configuration()

const char* avformat_configuration ( void  )

Return the libavformat build-time configuration.

◆ avformat_license()

const char* avformat_license ( void  )

Return the libavformat license.

◆ av_register_all()

void av_register_all ( void  )

Initialize libavformat and register all the muxers, demuxers and protocols.

If you do not call this function, then you can select exactly which formats you want to support.

See also
av_register_input_format()
av_register_output_format()
Examples:
avio_reading.c, demuxing_decoding.c, filtering_audio.c, filtering_video.c, http_multiclient.c, metadata.c, muxing.c, remuxing.c, transcode_aac.c, and transcoding.c.

Referenced by main().

◆ av_register_input_format()

void av_register_input_format ( AVInputFormat format)

◆ av_register_output_format()

void av_register_output_format ( AVOutputFormat format)

◆ avformat_network_init()

int avformat_network_init ( void  )

Do global initialization of network components.

This is optional, but recommended, since it avoids the overhead of implicitly doing the setup for each session.

Calling this function will become mandatory if using network protocols at some major version bump.

Examples:
http_multiclient.c.

Referenced by main().

◆ avformat_network_deinit()

int avformat_network_deinit ( void  )

Undo the initialization done by avformat_network_init.

Referenced by main().

◆ av_iformat_next()

AVInputFormat* av_iformat_next ( const AVInputFormat f)

If f is NULL, returns the first registered input format, if f is non-NULL, returns the next registered input format after f or NULL if f is the last one.

◆ av_oformat_next()

AVOutputFormat* av_oformat_next ( const AVOutputFormat f)

If f is NULL, returns the first registered output format, if f is non-NULL, returns the next registered output format after f or NULL if f is the last one.

◆ avformat_alloc_context()

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.

Examples:
avio_reading.c, and transcode_aac.c.

Referenced by main(), and open_output_file().

◆ avformat_free_context()

void avformat_free_context ( AVFormatContext s)

Free an AVFormatContext and all its streams.

Parameters
scontext to free
Examples:
muxing.c, remuxing.c, transcode_aac.c, and transcoding.c.

Referenced by main(), and open_output_file().

◆ avformat_get_class()

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.

See also
av_opt_find().

◆ avformat_new_stream()

AVStream* avformat_new_stream ( AVFormatContext s,
const 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 avcodec_close() and avformat_free_context() to clean up the allocation by avformat_new_stream().

Parameters
smedia file handle
cIf non-NULL, the AVCodecContext corresponding to the new stream will be initialized to use this codec. This is needed for e.g. codec-specific defaults to be set, so codec should be provided if it is known.
Returns
newly created stream or NULL on error.
Examples:
muxing.c, remuxing.c, transcode_aac.c, and transcoding.c.

Referenced by add_stream(), main(), and open_output_file().

◆ av_stream_new_side_data()

uint8_t* av_stream_new_side_data ( AVStream stream,
enum AVPacketSideDataType  type,
int  size 
)

Allocate new information from stream.

Parameters
streamstream
typedesired side information type
sizeside information size
Returns
pointer to fresh allocated data or NULL otherwise

◆ av_stream_get_side_data()

uint8_t* av_stream_get_side_data ( const AVStream stream,
enum AVPacketSideDataType  type,
int *  size 
)

Get side information from stream.

Parameters
streamstream
typedesired side information type
sizepointer for side information size to store (optional)
Returns
pointer to data if present or NULL otherwise

◆ av_new_program()

AVProgram* av_new_program ( AVFormatContext s,
int  id 
)