Modules
Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are meant to be passed to
av_codec_get_id()/av_codec_get_tag() as in the following code:
Macros
Ignore truncated output instead of returning an error.
More...
Functions
Send a nice hexadecimal dump of a buffer to the specified file stream.
More...
Send a nice hexadecimal dump of a buffer to the log.
More...
Send a nice dump of a packet to the specified file stream.
More...
Send a nice dump of a packet to the log.
More...
Get the AVCodecID for the given codec tag tag.
More...
Get the codec tag for the given codec id id.
More...
Get the codec tag for the given codec id.
More...
Get the index for a specific timestamp.
More...
Add an index entry into a sorted list.
More...
void
av_url_split (char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
More...
Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base.
More...
Return in 'buf' the path with 'd' replaced by a number.
More...
Check whether filename actually is a numbered sequence generator.
More...
Generate an SDP for an RTP session.
More...
int
av_match_ext (const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
More...
Test if the given container can store a codec.
More...
Guess the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio.
More...
Guess the frame rate, based on both the container and codec information.
More...
Check if the stream st contained in s is matched by the stream specifier spec.
More...
Detailed Description
Miscellaneous utility functions related to both muxing and demuxing (or neither).
Macro Definition Documentation
◆ AV_FRAME_FILENAME_FLAGS_MULTIPLE
#define AV_FRAME_FILENAME_FLAGS_MULTIPLE 1
◆ AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION
#define AV_FRAME_FILENAME_FLAGS_IGNORE_TRUNCATION 2
Ignore truncated output instead of returning an error.
Definition at line 2821 of file avformat.h.
Function Documentation
◆ av_hex_dump()
void av_hex_dump
(
FILE *
f,
const uint8_t *
buf,
int
size
)
Send a nice hexadecimal dump of a buffer to the specified file stream.
- Parameters
-
f The file stream pointer where the dump should be sent to.
buf buffer
size buffer size
- See also
- av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
Definition at line 83 of file dump.c.
◆ av_hex_dump_log()
void av_hex_dump_log
(
void *
avcl,
int
level,
const uint8_t *
buf,
int
size
)
◆ av_pkt_dump2()
void av_pkt_dump2
(
FILE *
f,
int
dump_payload,
)
Send a nice dump of a packet to the specified file stream.
- Parameters
-
f The file stream pointer where the dump should be sent to.
pkt packet to dump
dump_payload True if the payload must be displayed, too.
Definition at line 117 of file dump.c.
◆ av_pkt_dump_log2()
void av_pkt_dump_log2
(
void *
avcl,
int
level,
int
dump_payload,
)
Send a nice dump of a packet to the log.
- Parameters
-
avcl A pointer to an arbitrary struct of which the first field is a pointer to an
AVClass struct.
level The importance level of the message, lower values signifying higher importance.
pkt packet to dump
dump_payload True if the payload must be displayed, too.
Definition at line 122 of file dump.c.
Referenced by input_thread().
◆ av_codec_get_id()
◆ av_codec_get_tag()
unsigned int av_codec_get_tag
(
const struct
AVCodecTag *const *
tags,
)
◆ av_codec_get_tag2()
int av_codec_get_tag2
(
const struct
AVCodecTag *const *
tags,
unsigned int *
tag
)
Get the codec tag for the given codec id.
- Parameters
-
id codec id that should be searched for in the list
tag A pointer to the found tag
- Returns
- 0 if id was not found in tags, > 0 if it was found
Referenced by avformat_query_codec(), and streamcopy_init().
◆ av_find_default_stream_index()
◆ av_index_search_timestamp()
int av_index_search_timestamp
(
AVStream *
st,
int
flags
)
Get the index for a specific timestamp.
- Parameters
-
st stream that the timestamp belongs to
timestamp timestamp to retrieve the index for
flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond to the timestamp which is <= the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
- Returns
- < 0 if no such timestamp could be found
Definition at line 245 of file seek.c.
Referenced by ape_read_seek(), asf_read_seek(), avi_read_packet(), avi_read_seek(), dhav_read_seek(), ff_seek_frame_binary(), film_read_seek(), find_prev_closest_index(), flac_seek(), gxf_seek(), ifv_read_seek(), img_read_seek(), mov_seek_stream(), mp3_seek(), mpc8_read_seek(), mpc_read_seek(), mv_read_seek(), ni_prepare_read(), nsv_read_seek(), nut_write_packet(), pdv_read_seek(), read_packet(), read_seek(), rka_read_seek(), rl2_read_seek(), seek_frame_generic(), smacker_read_seek(), tta_read_seek(), and voc_read_seek().
◆ avformat_index_get_entries_count()
int avformat_index_get_entries_count
(
const
AVStream *
st )
Get the index entry count for the given AVStream.
- Parameters
-
st stream
- Returns
- the number of index entries in the stream
Definition at line 252 of file seek.c.
◆ avformat_index_get_entry()
Get the AVIndexEntry corresponding to the given index.
- Parameters
-
idx The desired index.
- Returns
- A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
- Note
- The pointer returned by this function is only guaranteed to be valid until any function that takes the stream or the parent AVFormatContext as input argument is called.
Definition at line 257 of file seek.c.
◆ avformat_index_get_entry_from_timestamp()
Get the AVIndexEntry corresponding to the given timestamp.
- Parameters
-
wanted_timestamp
Timestamp to retrieve the index entry for.
flags If AVSEEK_FLAG_BACKWARD then the returned entry will correspond to the timestamp which is <= the requested one, if backward is 0, then it will be >= if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise.
- Returns
- A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
- Note
- The pointer returned by this function is only guaranteed to be valid until any function that takes the stream or the parent AVFormatContext as input argument is called.
Definition at line 266 of file seek.c.
◆ av_add_index_entry()
int
size,
int
distance,
int
flags
)
Add an index entry into a sorted list.
Update the entry if the list already contains it.
- Parameters
-
timestamp timestamp in the time base of the given stream
Definition at line 122 of file seek.c.
Referenced by add_keyframes_index(), ape_read_header(), asf_build_simple_index(), asf_read_pts(), asf_read_simple_index(), asf_read_timestamp(), av_read_frame(), avi_read_idx1(), avi_sync(), cine_read_header(), clean_index(), ff_img_read_packet(), ff_voc_get_packet(), film_read_header(), find_and_decode_index(), flac_read_header(), flv_read_packet(), gxf_read_index(), mpc8_parse_seektable(), mpc_read_packet(), mpegps_read_pes_header(), mpegts_get_dts(), mv_read_header(), nsv_parse_NSVs_header(), nut_write_packet(), nuv_read_dts(), pdv_read_header(), pmp_header(), pva_read_header(), read_frame_internal(), read_header(), read_index(), read_odml_index(), read_pakt_chunk(), read_part_of_packet(), read_xing_toc(), rka_read_header(), rl2_read_header(), rm_read_dts(), rm_read_index(), rm_read_packet(), rpl_read_header(), smacker_read_header(), tta_read_header(), and xwma_read_header().
◆ av_url_split()
void av_url_split
(
char *
proto,
int
proto_size,
char *
authorization,
int
authorization_size,
char *
hostname,
int
hostname_size,
int *
port_ptr,
char *
path,
int
path_size,
const char *
url
)
Split a URL string into components.
The pointers to buffers for storing individual components may be null, in order to ignore that component. Buffers for components not found are set to empty strings. If the port is not found, it is set to a negative value.
- Parameters
-
proto the buffer for the protocol
proto_size the size of the proto buffer
authorization the buffer for the authorization
authorization_size the size of the authorization buffer
hostname the buffer for the host name
hostname_size the size of the hostname buffer
port_ptr a pointer to store the port number in
path the buffer for the path
path_size the size of the path buffer
url the URL to split
Definition at line 361 of file utils.c.
Referenced by amqp_proto_open(), ff_http_do_new_request2(), ff_rtp_set_remote_url(), ff_tls_open_underlying(), ff_udp_set_remote_url(), ftp_connect(), ftp_move(), gopher_open(), http_listen(), http_open_cnx_internal(), icecast_open(), libsrt_setup(), libssh_connect(), libssh_move(), mms_open(), mmsh_open_internal(), parse_command_line(), prompeg_open(), resetup_tcp(), rtmp_http_open(), rtmp_open(), rtmpe_open(), rtp_open(), rtsp_listen(), sap_read_header(), sap_write_header(), sctp_open(), srtp_open(), tcp_open(), test2(), test_same_origin(), and udp_open().
◆ av_dump_format()
int
index,
const char *
url,
int
is_output
)
Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base.
- Parameters
-
ic the context to analyze
index index of the stream to dump information about
url the URL to print, such as source or destination file
is_output Select whether the specified context is an input(0) or output(1)
- Examples
- avio_read_callback.c, demux_decode.c, extract_mvs.c, mux.c, remux.c, and transcode.c.
Definition at line 848 of file dump.c.
Referenced by create_streams(), ifile_open(), main(), mux_check_init(), open_input_file(), open_output_file(), and read_thread().
◆ av_get_frame_filename2()
int av_get_frame_filename2
(
char *
buf,
int
buf_size,
const char *
path,
int
number,
int
flags
)
Return in 'buf' the path with 'd' replaced by a number.
Also handles the '%0nd' format where 'n' is the total number of digits and '%'.
- Parameters
-
buf destination buffer
buf_size destination buffer size
path numbered sequence string
number frame number
flags AV_FRAME_FILENAME_FLAGS_*
- Returns
- 0 if OK, -1 on format error
Definition at line 351 of file utils.c.
◆ av_get_frame_filename()
int av_get_frame_filename
(
char *
buf,
int
buf_size,
const char *
path,
int
number
)
◆ av_filename_number_test()
int av_filename_number_test
(
const char *
filename )
◆ av_sdp_create()
int
n_files,
char *
buf,
int
size
)
Generate an SDP for an RTP session.
Note, this overwrites the id values of AVStreams in the muxer contexts for getting unique dynamic payload types.
- Parameters
-
ac array of AVFormatContexts describing the RTP streams. If the array is composed by only one context, such context can contain multiple AVStreams (one
AVStream per RTP stream). Otherwise, all the contexts in the array (an
AVCodecContext per RTP stream) must contain only one
AVStream.
n_files number of AVCodecContexts contained in ac
buf buffer where the SDP will be stored (must be allocated by the caller)
size the size of the buffer
- Returns
- 0 if OK, AVERROR_xxx on error
Definition at line 950 of file sdp.c.
Referenced by ff_rtsp_setup_output_streams(), print_sdp(), and sap_write_header().
◆ av_match_ext()
int av_match_ext
(
const char *
filename,
const char *
extensions
)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
- Parameters
-
filename file name to check against the given extensions
extensions a comma-separated list of filename extensions
Definition at line 41 of file format.c.
Referenced by av_guess_format(), av_probe_input_format3(), avs3video_probe(), dash_init(), hls_probe(), img_read_probe(), modplug_probe(), mov_find_codec_tag(), mpegts_init(), nsv_probe(), open_url(), pgm_probe(), pgmyuv_probe(), read_probe(), seg_init(), and test_segment().
◆ avformat_query_codec()
Test if the given container can store a codec.
- Parameters
-
ofmt container to check for compatibility
codec_id codec to potentially store in container
std_compliance standards compliance level, one of FF_COMPLIANCE_*
- Returns
- 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot. A negative number if this information is not available.
Definition at line 32 of file mux_utils.c.
Referenced by map_auto_video().
◆ av_guess_sample_aspect_ratio()
Guess the sample aspect ratio of a frame, based on both the stream and the frame aspect ratio.
Since the frame aspect ratio is set by the codec but the stream aspect ratio is set by the demuxer, these two may not be equal. This function tries to return the value that you should use if you would like to display the frame.
Basic logic is to use the stream aspect ratio if it is set to something sane otherwise use the frame aspect ratio. This way a container setting, which is usually easy to modify can override the coded value in the frames.
- Parameters
-
format the format context which the stream is part of
stream the stream which the frame is part of
frame the frame with the aspect ratio to be determined
- Returns
- the guessed (valid) sample_aspect_ratio, 0/1 if no idea
Definition at line 660 of file avformat.c.
Referenced by get_video_frame(), read_thread(), show_frame(), and show_stream().
◆ av_guess_frame_rate()
Guess the frame rate, based on both the container and codec information.
- Parameters
-
ctx the format context which the stream is part of
stream the stream which the frame is part of
frame the frame for which the frame rate should be determined, may be NULL
- Returns
- the guessed (valid) frame rate, 0/1 if no idea
Definition at line 683 of file avformat.c.
Referenced by configure_video_filters(), ist_filter_add(), open_input_file(), and video_thread().
◆ avformat_match_stream_specifier()
Check if the stream st contained in s is matched by the stream specifier spec.
See the "stream specifiers" chapter in the documentation for the syntax of spec.
- Returns
- >0 if st is matched by spec; 0 if st is not matched by spec; AVERROR code if spec is invalid
- Note
- A stream specifier can match several streams in the format.
Definition at line 614 of file avformat.c.
Referenced by find_stream(), open_slave(), probe_file(), read_thread(), and select_reference_stream().
◆ avformat_queue_attached_pictures()