AVFormatContext

Format I/O context. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVFormatContext) must not be used outside libav*, use avformat_alloc_context() to create an AVFormatContext.

@nogc nothrow extern (C)
struct AVFormatContext {}

Members

Variables

_debug
int _debug;

Flags to enable debugging.

audio_codec
AVCodec* audio_codec;

Forced audio codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user via av_format_set_audio_codec (NO direct access).

audio_codec_id
AVCodecID audio_codec_id;

Forced audio codec_id. Demuxing: Set by user.

audio_preload
int audio_preload;

Audio preload in microseconds. Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user via AVOptions (NO direct access) - decoding: unused

av_class
AVClass* av_class;

A class for logging and @ref avoptions. Set by avformat_alloc_context(). Exports (de)muxer private options if they exist.

avio_flags
int avio_flags;

avio flags, used to force AVIO_FLAG_DIRECT. - encoding: unused - decoding: Set by user via AVOptions (NO direct access)

avoid_negative_ts
int avoid_negative_ts;

Avoid negative timestamps during muxing. Any value of the AVFMT_AVOID_NEG_TS_* constants. Note, this only works when using av_interleaved_write_frame. (interleave_packet_per_dts is in use) - muxing: Set by user - demuxing: unused

bit_rate
int64_t bit_rate;

Total stream bitrate in bit/s, 0 if not available. Never set it directly if the file_size and the duration are known as FFmpeg can compute it automatically.

chapters
AVChapter** chapters;
Undocumented in source.
codec_whitelist
char* codec_whitelist;

',' separated list of allowed decoders. If NULL then all are allowed - encoding: unused - decoding: set by user through AVOptions (NO direct access)

control_message_cb
av_format_control_message control_message_cb;

Callback used by devices to communicate with application.

correct_ts_overflow
uint correct_ts_overflow;

Correct single timestamp overflows - encoding: unused - decoding: Set by user via AVOPtions (NO direct access)

ctx_flags
int ctx_flags;

Flags signalling stream properties. A combination of AVFMTCTX_*. Set by libavformat.

data_codec
AVCodec* data_codec;

Forced data codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user via av_format_set_data_codec (NO direct access).

data_codec_id
AVCodecID data_codec_id;

Forced Data codec_id. Demuxing: Set by user.

dump_separator
uint8_t* dump_separator;

dump format separator. can be ", " or "\n " or anything else Code outside libavformat should access this field using AVOptions (NO direct access). - muxing: Set by user. - demuxing: Set by user.

duration
int64_t duration;

Duration of the stream, in AV_TIME_BASE fractional seconds. Only set this value if you know none of the individual stream durations and also do not set any of them. This is deduced from the AVStream values if not set.

duration_estimation_method
AVDurationEstimationMethod duration_estimation_method;

The duration field can be estimated through various ways, and this field can be used to know how the duration was estimated. - encoding: unused - decoding: Read by user via AVOptions (NO direct access)

error_recognition
int error_recognition;

Error recognition; higher values will detect more errors but may misdetect some more or less valid parts as errors. Demuxing only, set by the caller before avformat_open_input().

event_flags
int event_flags;

Flags for the user to detect events happening on the file. Flags must be cleared by the user once the event has been handled. A combination of AVFMT_EVENT_FLAG_*.

filename
char[1024] filename;

input or output filename

flags
int flags;

Flags modifying the (de)muxer behaviour. A combination of AVFMT_FLAG_*. Set by the user before avformat_open_input() / avformat_write_header().

flush_packets
int flush_packets;

Flush the I/O context after each packet. - encoding: Set by user via AVOptions (NO direct access) - decoding: unused

format_probesize
int format_probesize;

number of bytes to read maximally to identify format. - encoding: unused - decoding: set by user through AVOPtions (NO direct access)

format_whitelist
char* format_whitelist;

',' separated list of allowed demuxers. If NULL then all are allowed - encoding: unused - decoding: set by user through AVOptions (NO direct access)

fps_probe_size
int fps_probe_size;

The number of frames used for determining the framerate in avformat_find_stream_info(). Demuxing only, set by the caller before avformat_find_stream_info().

iformat
AVInputFormat* iformat;

The input container format.

internal
AVFormatInternal* internal;

An opaque field for libavformat internal usage. Must not be accessed in any way by callers.

interrupt_callback
AVIOInterruptCB interrupt_callback;

Custom interrupt callbacks for the I/O layer.

io_close
void function(AVFormatContext* s, AVIOContext* pb) io_close;

A callback for closing the streams opened with AVFormatContext.io_open().

io_open
int function(AVFormatContext* s, AVIOContext** pb, const char* url, int flags, AVDictionary** options) io_open;
Undocumented in source.
io_repositioned
int io_repositioned;

IO repositioned flag. This is set by avformat when the underlaying IO context read pointer is repositioned, for example when doing byte based seeking. Demuxers can use the flag to detect such changes.

key
uint8_t* key;
Undocumented in source.
keylen
int keylen;
Undocumented in source.
max_analyze_duration
int64_t max_analyze_duration;

Maximum duration (in AV_TIME_BASE units) of the data read from input in avformat_find_stream_info(). Demuxing only, set by the caller before avformat_find_stream_info(). Can be set to 0 to let avformat choose using a heuristic.

max_chunk_duration
int max_chunk_duration;

Max chunk time in microseconds. Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user via AVOptions (NO direct access) - decoding: unused

max_chunk_size
int max_chunk_size;

Max chunk size in bytes Note, not all formats support this and unpredictable things may happen if it is used when not supported. - encoding: Set by user via AVOptions (NO direct access) - decoding: unused

max_delay
int max_delay;
Undocumented in source.
max_index_size
uint max_index_size;

Maximum amount of memory in bytes to use for the index of each stream. If the index exceeds this size, entries will be discarded as needed to maintain a smaller size. This can lead to slower or less accurate seeking (depends on demuxer). Demuxers for which a full in-memory index is mandatory will ignore this. - muxing: unused - demuxing: set by user

max_interleave_delta
int64_t max_interleave_delta;

Maximum buffering duration for interleaving.

max_picture_buffer
uint max_picture_buffer;

Maximum amount of memory in bytes to use for buffering frames obtained from realtime capture devices.

max_ts_probe
int max_ts_probe;

Maximum number of packets to read while waiting for the first timestamp. Decoding only.

metadata
AVDictionary* metadata;

Metadata that applies to the whole file.

metadata_header_padding
int metadata_header_padding;

Number of bytes to be written as padding in a metadata header. Demuxing: Unused. Muxing: Set by user via av_format_set_metadata_header_padding.

nb_chapters
uint nb_chapters;

Number of chapters in AVChapter array. When muxing, chapters are normally written in the file header, so nb_chapters should normally be initialized before write_header is called. Some muxers (e.g. mov and mkv) can also write chapters in the trailer. To write chapters in the trailer, nb_chapters must be zero when write_header is called and non-zero when write_trailer is called. - muxing: set by user - demuxing: set by libavformat

nb_programs
uint nb_programs;
Undocumented in source.
nb_streams
uint nb_streams;

Number of elements in AVFormatContext.streams.

oformat
AVOutputFormat* oformat;

The output container format.

opaque
void* opaque;

User data. This is a place for some private data of the user. Mostly usable with control_message_cb or any future callbacks in device's context.

open_cb
deprecated int function(AVFormatContext* s, AVIOContext** p, const char* url, int flags, const AVIOInterruptCB* int_cb, AVDictionary** options) open_cb;

Called to open further IO contexts when needed for demuxing.

output_ts_offset
int64_t output_ts_offset;

Output timestamp offset, in microseconds. Muxing: set by user via AVOptions (NO direct access)

packet_size
uint packet_size;
Undocumented in source.
pb
AVIOContext* pb;

I/O context.

priv_data
void* priv_data;

Format private data. This is an AVOptions-enabled struct if and only if iformat/oformat.priv_class is not NULL.

probe_score
int probe_score;

format probing score. The maximal score is AVPROBE_SCORE_MAX, its set when the demuxer probes the format. - encoding: unused - decoding: set by avformat, read by user via av_format_get_probe_score() (NO direct access)

probesize
int64_t probesize;

@deprecated deprecated in favor of probesize2

programs
AVProgram** programs;
Undocumented in source.
protocol_whitelist
char* protocol_whitelist;

',' separated list of allowed protocols. - encoding: unused - decoding: set by user through AVOptions (NO direct access)

seek2any
int seek2any;

Force seeking to any (also non key) frames. - encoding: unused - decoding: Set by user via AVOPtions (NO direct access)

skip_initial_bytes
int64_t skip_initial_bytes;

Skip initial bytes when opening stream - encoding: unused - decoding: Set by user via AVOptions (NO direct access)

start_time
int64_t start_time;

Position of the first frame of the component, in AV_TIME_BASE fractional seconds. NEVER set this value directly: It is deduced from the AVStream values.

start_time_realtime
int64_t start_time_realtime;

Start time of the stream in real world time, in microseconds since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the stream was captured at this real world time. - muxing: Set by the caller before avformat_write_header(). If set to either 0 or AV_NOPTS_VALUE, then the current wall-time will be used. - demuxing: Set by libavformat. AV_NOPTS_VALUE if unknown. Note that the value may become known after some number of frames have been received.

streams
AVStream** streams;

A list of all streams in the file. New streams are created with avformat_new_stream().

strict_std_compliance
int strict_std_compliance;

Allow non-standard and experimental extension @see AVCodecContext.strict_std_compliance

subtitle_codec
AVCodec* subtitle_codec;

Forced subtitle codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user via av_format_set_subtitle_codec (NO direct access).

subtitle_codec_id
AVCodecID subtitle_codec_id;

Forced subtitle codec_id. Demuxing: Set by user.

ts_id
int ts_id;

Transport stream id. This will be moved into demuxer private options. Thus no API/ABI compatibility

use_wallclock_as_timestamps
int use_wallclock_as_timestamps;

forces the use of wallclock timestamps as pts/dts of packets This has undefined results in the presence of B frames. - encoding: unused - decoding: Set by user via AVOptions (NO direct access)

video_codec
AVCodec* video_codec;

Forced video codec. This allows forcing a specific decoder, even when there are multiple with the same codec_id. Demuxing: Set by user via av_format_set_video_codec (NO direct access).

video_codec_id
AVCodecID video_codec_id;

Forced video codec_id. Demuxing: Set by user.

Meta