#include <time.h>#include <stdio.h>#include "libavcodec/codec.h"#include "libavcodec/codec_par.h"#include "libavcodec/defs.h"#include "libavcodec/packet.h"#include "libavutil/dict.h"#include "libavutil/log.h"#include "avio.h"#include "libavformat/version_major.h"Go to the source code of this file.
Main libavformat public API header
Definition in file avformat.h.
Definition at line 460 of file avformat.h.
Definition at line 461 of file avformat.h.
score for file extension
Definition at line 463 of file avformat.h.
score for file mime type
Definition at line 464 of file avformat.h.
maximum score
Definition at line 465 of file avformat.h.
extra allocated bytes at the end of the probe buffer
Definition at line 467 of file avformat.h.
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition at line 470 of file avformat.h.
Needs 'd' in filename.
Definition at line 471 of file avformat.h.
The muxer/demuxer is experimental and should be used with caution.
Definition at line 478 of file avformat.h.
Show format stream IDs numbers.
Definition at line 479 of file avformat.h.
Format wants global header.
Definition at line 480 of file avformat.h.
Format does not need / have any timestamps.
Definition at line 481 of file avformat.h.
Use generic index building code.
Definition at line 482 of file avformat.h.
Format allows timestamp discontinuities.
Note, muxers always require valid (monotone) timestamps
Definition at line 483 of file avformat.h.
Format allows variable fps.
Definition at line 484 of file avformat.h.
Format does not need width/height.
Definition at line 485 of file avformat.h.
Format does not require any streams.
Definition at line 486 of file avformat.h.
Format does not allow to fall back on binary search via read_timestamp.
Definition at line 487 of file avformat.h.
Format does not allow to fall back on generic search.
Definition at line 488 of file avformat.h.
Format does not allow seeking by bytes.
Definition at line 489 of file avformat.h.
Format allows flushing.
If not set, the muxer will not receive a NULL packet in the write_packet function.
Definition at line 490 of file avformat.h.
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition at line 491 of file avformat.h.
Format allows muxing negative timestamps.
If not set the timestamp will be shifted in av_write_frame and av_interleaved_write_frame so they start from 0. The user or muxer can override this through AVFormatContext.avoid_negative_ts
Definition at line 494 of file avformat.h.
Seeking is based on PTS.
Definition at line 503 of file avformat.h.
Definition at line 815 of file avformat.h.
Definition at line 816 of file avformat.h.
The stream should be chosen by default among other streams of the same type, unless the user has explicitly specified otherwise.
Definition at line 826 of file avformat.h.
The stream is not in original language.
Definition at line 834 of file avformat.h.
The stream is in original language.
Definition at line 840 of file avformat.h.
The stream is a commentary track.
Definition at line 844 of file avformat.h.
The stream contains song lyrics.
Definition at line 848 of file avformat.h.
The stream contains karaoke audio.
Definition at line 852 of file avformat.h.
Track should be used during playback by default.
Useful for subtitle track that should be displayed even when user did not explicitly ask for subtitles.
Definition at line 859 of file avformat.h.
The stream is intended for hearing impaired audiences.
Definition at line 863 of file avformat.h.
The stream is intended for visually impaired audiences.
Definition at line 867 of file avformat.h.
The audio stream contains music and sound effects without voice.
Definition at line 871 of file avformat.h.
The stream is stored in the file as an attached picture/"cover art" (e.g.
APIC frame in ID3v2). The first (usually only) packet associated with it will be returned among the first few packets read from the file unless seeking takes place. It can also be accessed at any time in AVStream.attached_pic.
Definition at line 879 of file avformat.h.
The stream is sparse, and contains thumbnail images, often corresponding to chapter markers.
Only ever used with AV_DISPOSITION_ATTACHED_PIC.
Definition at line 884 of file avformat.h.
The stream is intended to be mixed with a spatial audio track.
For example, it could be used for narration or stereo music, and may remain unchanged by listener head rotation.
Definition at line 891 of file avformat.h.
The subtitle stream contains captions, providing a transcription and possibly a translation of audio.
Typically intended for hearing-impaired audiences.
Definition at line 897 of file avformat.h.
The subtitle stream contains a textual description of the video content.
Typically intended for visually-impaired audiences or for the cases where the video cannot be seen.
Definition at line 903 of file avformat.h.
The subtitle stream contains time-aligned metadata that is not intended to be directly presented to the user.
Definition at line 908 of file avformat.h.
The audio stream is intended to be mixed with another stream before presentation.
Corresponds to mix_type=0 in mpegts.
Definition at line 914 of file avformat.h.
The video stream contains still images.
Definition at line 918 of file avformat.h.
Options for behavior on timestamp wrap detection.
ignore the wrap
Definition at line 937 of file avformat.h.
add the format specific offset on wrap detection
Definition at line 938 of file avformat.h.
subtract the format specific offset on wrap detection
Definition at line 939 of file avformat.h.
Definition at line 1081 of file avformat.h.
Definition at line 1087 of file avformat.h.
Definition at line 1129 of file avformat.h.
signal that no header is present (streams are added dynamically)
Definition at line 1164 of file avformat.h.
signal that the stream is definitely not seekable, and attempts to call the seek function will fail.
For some network protocols (e.g. HLS), this can change dynamically at runtime.
Definition at line 1166 of file avformat.h.
Generate missing pts even if it requires parsing future frames.
Definition at line 1332 of file avformat.h.
Ignore index.
Definition at line 1333 of file avformat.h.
Do not block when reading packets from input.
Definition at line 1334 of file avformat.h.
Ignore DTS on frames that contain both DTS & PTS.
Definition at line 1335 of file avformat.h.
Do not infer any values from other values, just return what is stored in the container.
Definition at line 1336 of file avformat.h.
Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled.
Definition at line 1337 of file avformat.h.
Do not buffer frames when possible.
Definition at line 1338 of file avformat.h.
The caller has supplied a custom AVIOContext, don't avio_close() it.
Definition at line 1339 of file avformat.h.
Discard frames marked corrupted.
Definition at line 1340 of file avformat.h.
Flush the AVIOContext every packet.
Definition at line 1341 of file avformat.h.
When muxing, try to avoid writing any random/volatile data to the output.
This includes any random IDs, real-time timestamps/dates, muxer version, etc.
This flag is mainly intended for testing.
Definition at line 1348 of file avformat.h.
try to interleave outputted packets by dts (using this flag can slow demuxing down)
Definition at line 1349 of file avformat.h.
Enable fast, but inaccurate seeks for some formats.
Definition at line 1353 of file avformat.h.
Stop muxing when the shortest stream stops.
Definition at line 1354 of file avformat.h.
Add bitstream filters as requested by the muxer.
Definition at line 1355 of file avformat.h.
Definition at line 1486 of file avformat.h.
Definition at line 1530 of file avformat.h.
Enabled when required by target format.
Definition at line 1546 of file avformat.h.
Do not shift timestamps even when they are negative.
Definition at line 1547 of file avformat.h.
Shift timestamps so they are non negative.
Definition at line 1548 of file avformat.h.
Shift timestamps so that they start at 0.
Definition at line 1549 of file avformat.h.
seek backward
Definition at line 2289 of file avformat.h.
seeking based on position in bytes
Definition at line 2290 of file avformat.h.
seek to any frame, even non-keyframes
Definition at line 2291 of file avformat.h.
seeking based on frame number
Definition at line 2292 of file avformat.h.
Callback used by devices to communicate with application.
Definition at line 1183 of file avformat.h.
Definition at line 1186 of file avformat.h.
| Enumerator | |
|---|---|
| AVSTREAM_PARSE_NONE | |
| AVSTREAM_PARSE_FULL | full parsing and repack |
| AVSTREAM_PARSE_HEADERS | Only parse headers, do not repack. |
| AVSTREAM_PARSE_TIMESTAMPS | full parsing and interpolation of timestamps for frames not starting on a packet boundary |
| AVSTREAM_PARSE_FULL_ONCE | full parsing and repack of the first frame only, only implemented for H.264 currently |
| AVSTREAM_PARSE_FULL_RAW | full parsing and repack with timestamp and position generation by parser for raw this assumes that each packet in the file contains no demuxer level headers and just codec level data, otherwise position generation would fail |
Definition at line 796 of file avformat.h.
The duration of a video can be estimated through various ways, and this enum can be used to know how the duration was estimated.
| Enumerator | |
|---|---|
| AVFMT_DURATION_FROM_PTS | Duration accurately estimated from PTSes. |
| AVFMT_DURATION_FROM_STREAM | Duration estimated from a stream with a known duration. |
| AVFMT_DURATION_FROM_BITRATE | Duration estimated from bitrate (less accurate) |
Definition at line 1193 of file avformat.h.
Allocate and read the payload of a packet and initialize its fields with default values.
Definition at line 102 of file utils.c.
Referenced by aa_read_packet(), aal_read_packet(), aax_read_packet(), ace_read_packet(), adp_read_packet(), ads_read_packet(), adts_aac_read_packet(), adx_read_packet(), aea_read_packet(), afc_read_packet(), aiff_read_packet(), aix_read_packet(), apc_read_packet(), aptx_hd_read_packet(), aptx_read_packet(), argo_brp_read_packet(), asf_read_header(), asf_read_subpayload(), ast_read_packet(), av_append_packet(), avi_read_packet(), bfi_read_packet(), cdata_read_packet(), cdxl_read_packet(), cin_read_packet(), cine_read_packet(), codec2_read_packet(), dat_read_packet(), daud_packet(), dcstr_read_packet(), dfa_read_packet(), dhav_read_packet(), dsf_read_packet(), dxa_read_packet(), ea_read_packet(), ff_add_attached_pic(), ff_pcm_read_packet(), ff_rm_parse_packet(), ff_rm_retrieve_cache(), ff_voc_get_packet(), film_read_packet(), flv_data_packet(), flv_read_packet(), fourxm_read_packet(), frm_read_packet(), fsb_read_packet(), g726_read_packet(), g729_read_packet(), gdv_read_packet(), genh_read_packet(), gif_read_packet(), gsm_read_packet(), gxf_packet(), hca_read_packet(), hnm_read_packet(), idcin_read_packet(), iff_read_packet(), ifv_read_packet(), ilbc_read_packet(), ingenient_read_packet(), iss_read_packet(), lmlm4_read_packet(), load_ipmovie_packet(), lvf_read_packet(), mmf_read_packet(), mods_read_packet(), mov_read_packet(), mp3_read_packet(), mpc8_read_packet(), mpegps_read_packet(), mpjpeg_read_packet(), msf_read_packet(), msnwc_tcp_read_packet(), msp_read_packet(), mtaf_read_packet(), mtv_read_packet(), musx_read_packet(), mv_read_packet(), mxf_decrypt_triplet(), mxf_get_d10_aes3_packet(), mxf_get_eia608_packet(), mxf_read_packet(), nc_read_packet(), nsv_read_chunk(), nuv_packet(), pmp_packet(), pp_bnk_read_packet(), pva_read_packet(), qcp_read_packet(), r3d_read_reda(), r3d_read_redv(), raw_read_packet(), rawvideo_read_packet(), read_dst_frame(), read_packet(), redspark_read_packet(), rl2_read_packet(), roq_read_packet(), rpl_read_packet(), rsd_read_packet(), s337m_read_packet(), scd_read_packet(), sdr2_read_packet(), seq_read_packet(), ser_read_packet(), siff_read_packet(), simbiosis_imx_read_packet(), smacker_read_packet(), smjpeg_read_packet(), smush_read_packet(), sol_read_packet(), sup_read_packet(), svag_read_packet(), svs_read_packet(), swf_read_packet(), thp_read_packet(), threedostr_read_packet(), tmv_read_packet(), tta_read_packet(), txd_read_packet(), vag_read_packet(), vc1t_read_packet(), vid_read_packet(), viv_read_packet(), vivo_read_packet(), vpk_read_packet(), wc3_read_packet(), wsaud_read_packet(), wsvqa_read_packet(), xa_read_packet(), xmv_fetch_audio_packet(), xmv_fetch_video_packet(), xvag_read_packet(), xwma_read_packet(), yop_read_packet(), and yuv4_read_packet().
Read data and append it to the current content of the AVPacket.
If pkt->size is 0 this is identical to av_get_packet. Note that this uses av_grow_packet and thus involves a realloc which is inefficient. Thus this function should only be used when there is no reasonable way to know (an upper bound of) the final size.
Definition at line 118 of file utils.c.
Referenced by adts_aac_read_packet(), apng_read_packet(), dfa_read_packet(), ea_read_packet(), handle_id3(), moflex_read_packet(), mpjpeg_read_packet(), msp_read_packet(), read_packet(), sup_read_packet(), vivo_read_packet(), wc3_read_header(), wc3_read_packet(), and wsvqa_read_packet().
Definition at line 334 of file options.c.
Referenced by show_dispositions().
Definition at line 32 of file demux_utils.c.
Referenced by process_input_packet().
Returns the pts of the last muxed packet + its duration.
the retuned value is undefined when used with a demuxer.
Definition at line 32 of file mux_utils.c.
Referenced by print_report().
This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek.
Definition at line 83 of file demux_utils.c.
Referenced by read_thread().
Allocate an AVFormatContext for an output format.
avformat_free_context() can be used to free the context and everything allocated by the framework within it.
Definition at line 91 of file mux.c.
Referenced by avdevice_list_output_sinks(), fifo_mux_init(), hls_mux_init(), initialize_fifo_tst_muxer_chain(), main(), mov_init_ttml_writer(), open_output_file(), open_slave(), segment_mux_init(), webm_chunk_init(), and write_muxed_file().