85 #define MAX_ODML_DEPTH 1000
105 {
'R',
'I',
'F',
'F',
'A',
'V',
'I',
' ' },
106 {
'R',
'I',
'F',
'F',
'A',
'V',
'I',
'X' },
107 {
'R',
'I',
'F',
'F',
'A',
'V',
'I', 0x19 },
108 {
'O',
'N',
'2',
' ',
'O',
'N',
'2',
'f' },
109 {
'R',
'I',
'F',
'F',
'A',
'M',
'V',
' ' },
115 {
"isbj",
"subject" },
117 {
"iart",
"artist" },
118 {
"icop",
"copyright" },
119 {
"icmt",
"comment" },
121 {
"iprd",
"product" },
122 {
"isft",
"software" },
131 #define print_tag(s, str, tag, size) \
132 av_log(s, AV_LOG_TRACE, "pos:%"PRIX64" %s: tag=%s size=0x%x\n", \
133 avio_tell(pb), str, av_fourcc2str(tag), size) \
165 "This file has been generated by a totally broken muxer.\n");
175 int index_sub_type =
avio_r8(pb);
180 int stream_id = ((chunk_id & 0xFF) -
'0') * 10 +
181 ((chunk_id >> 8 & 0xFF) -
'0');
189 "longs_per_entry:%d index_type:%d entries_in_use:%d "
190 "chunk_id:%X base:%16"PRIX64
" frame_num:%"PRId64
"\n",
198 if (stream_id >=
s->nb_streams || stream_id < 0)
200 st =
s->streams[stream_id];
203 if (index_sub_type || entries_in_use < 0)
208 if (index_type && longs_per_entry != 2)
213 if (filesize > 0 &&
base >= filesize) {
215 if (
base >> 32 == (
base & 0xFFFFFFFF) &&
216 (
base & 0xFFFFFFFF) < filesize &&
217 filesize <= 0xFFFFFFFF)
223 for (
i = 0;
i < entries_in_use;
i++) {
244 if (last_pos !=
pos &&
len)
294 for (
i = 0;
i <
s->nb_streams;
i++) {
311 for (j = 0; j <
size; j +=
max)
326 if (
size == UINT_MAX)
343 static const char months[12][4] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
344 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" };
348 char month[4], time[9],
buffer[64];
351 if (sscanf(date,
"%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d",
352 month, &day, time, &year) == 4) {
353 for (
i = 0;
i < 12;
i++)
356 year,
i + 1, day, time);
359 }
else if (date[4] ==
'/' && date[7] ==
'/') {
360 date[4] = date[7] =
'-';
371 case MKTAG(
'n',
'c',
't',
'g'):
390 name =
"creation_time";
415 if (!
data || data_size < 8) {
421 tag = bytestream2_get_le32(&gb);
424 case MKTAG(
'A',
'V',
'I',
'F'):
433 case MKTAG(
'C',
'A',
'S',
'I'):
436 case MKTAG(
'Z',
'o',
'r',
'a'):
453 for (
i = 0;
i<
s->nb_streams;
i++) {
467 if (lensum*9/10 > maxpos || lensum < maxpos*9/10)
470 for (
i = 0;
i<
s->nb_streams;
i++) {
490 #define RETURN_ERROR(code) do { ret = (code); goto fail; } while (0)
501 int avih_width = 0, avih_height = 0;
502 int amv_file_format = 0;
503 uint64_t list_end = 0;
533 case MKTAG(
'L',
'I',
'S',
'T'):
540 if (tag1 ==
MKTAG(
'm',
'o',
'v',
'i')) {
548 }
else if (tag1 ==
MKTAG(
'I',
'N',
'F',
'O'))
550 else if (tag1 ==
MKTAG(
'n',
'c',
'd',
't'))
554 case MKTAG(
'I',
'D',
'I',
'T'):
556 unsigned char date[64] = { 0 };
563 case MKTAG(
'd',
'm',
'l',
'h'):
567 case MKTAG(
'a',
'm',
'v',
'h'):
569 case MKTAG(
'a',
'v',
'i',
'h'):
585 case MKTAG(
's',
't',
'r',
'h'):
591 if (tag1 ==
MKTAG(
'p',
'a',
'd',
's')) {
600 st->
id = stream_index;
607 tag1 = stream_index ?
MKTAG(
'a',
'u',
'd',
's')
608 :
MKTAG(
'v',
'i',
'd',
's');
612 if (tag1 ==
MKTAG(
'i',
'a',
'v',
's') ||
613 tag1 ==
MKTAG(
'i',
'v',
'a',
's')) {
618 if (
s->nb_streams != 1)
629 ast =
s->streams[0]->priv_data;
639 s->streams[0]->priv_data = ast;
646 if (ast->
scale > 0 && ast->
rate > 0 && dv_dur > 0) {
653 stream_index =
s->nb_streams - 1;
669 "scale/rate is %"PRIu32
"/%"PRIu32
" which is invalid. "
670 "(This file has been generated by broken software.)\n",
675 ast->
scale = frame_period;
699 case MKTAG(
'v',
'i',
'd',
's'):
705 case MKTAG(
'a',
'u',
'd',
's'):
708 case MKTAG(
't',
'x',
't',
's'):
711 case MKTAG(
'd',
'a',
't',
's'):
721 "Invalid sample_size %d at stream %d\n",
727 "Invalid sample_size %d at stream %d "
744 case MKTAG(
's',
't',
'r',
'f'):
749 if (stream_index >= (
unsigned)
s->nb_streams || avi->
dv_demux) {
754 if (cur_pos < list_end)
756 st =
s->streams[stream_index];
763 if (amv_file_format) {
773 if (tag1 ==
MKTAG(
'D',
'X',
'S',
'B') ||
774 tag1 ==
MKTAG(
'D',
'X',
'S',
'A')) {
781 if (
size > 10 * 4 &&
size < (1 << 30) && size < avi->
fsize) {
782 if (esize ==
size-1 && (esize&1)) {
815 for (
i = 0;
i < pal_size / 4;
i++)
832 "mov tag found in avi (fourcc %s)\n",
887 "sample size (%d) != block align (%d)\n",
915 if (amv_file_format) {
946 case MKTAG(
's',
't',
'r',
'd'):
947 if (stream_index >= (
unsigned)
s->nb_streams
948 ||
s->streams[stream_index]->codecpar->extradata_size
949 ||
s->streams[stream_index]->codecpar->codec_tag ==
MKTAG(
'H',
'2',
'6',
'4')) {
953 if (cur_pos < list_end)
955 st =
s->streams[stream_index];
974 case MKTAG(
'i',
'n',
'd',
'x'):
983 case MKTAG(
'v',
'p',
'r',
'p'):
984 if (stream_index < (
unsigned)
s->nb_streams &&
size > 9 * 4) {
987 st =
s->streams[stream_index];
1000 if (active_aspect.
num && active_aspect.
den &&
1001 active.
num && active.
den) {
1004 active_aspect.
num, active_aspect.
den,
1011 case MKTAG(
's',
't',
'r',
'n'):
1012 case MKTAG(
'i',
's',
'b',
'j'):
1013 case MKTAG(
'i',
'n',
'a',
'm'):
1014 case MKTAG(
'i',
'a',
'r',
't'):
1015 case MKTAG(
'i',
'c',
'o',
'p'):
1016 case MKTAG(
'i',
'c',
'm',
't'):
1017 case MKTAG(
'i',
'g',
'n',
'r'):
1018 case MKTAG(
'i',
'p',
'o',
'd'):
1019 case MKTAG(
'i',
's',
'o',
'f'):
1020 if (
s->nb_streams) {
1027 if (
size > 1000000) {
1029 "Something went wrong during header parsing, "
1030 "tag %s has size %u, "
1031 "I will ignore it and try to continue anyway.\n",
1040 case MKTAG(
'i',
'd',
'x',
'1'):
1050 if (stream_index !=
s->nb_streams - 1) {
1065 if (dict_entry && !strcmp(dict_entry->
value,
"PotEncoder"))
1066 for (
i = 0;
i <
s->nb_streams;
i++) {
1073 for (
i = 0;
i <
s->nb_streams;
i++) {
1084 "Non-interleaved AVI without index, switching to interleaved\n");
1114 unsigned int desc_len;
1149 if (strcmp(sub_demuxer->name,
"srt") && strcmp(sub_demuxer->name,
"ass"))
1188 int64_t ts, next_ts, ts_min = INT64_MAX;
1195 for (
i = 0;
i <
s->nb_streams;
i++) {
1200 if (ts <= next_ts && ts < ts_min) {
1220 if (d[0] >=
'0' && d[0] <=
'9' &&
1221 d[1] >=
'0' && d[1] <=
'9') {
1222 return (d[0] -
'0') * 10 + (d[1] -
'0');
1242 memset(d, -1,
sizeof(d));
1246 for (j = 0; j < 7; j++)
1250 size = d[4] + (d[5] << 8) + (d[6] << 16) + (d[7] << 24);
1253 ff_tlog(
s,
"%X %X %X %X %X %X %X %X %"PRId64
" %u %d\n",
1254 d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
i,
size, n);
1259 if ((d[0] ==
'i' && d[1] ==
'x' && n < s->
nb_streams) ||
1261 (d[0] ==
'J' && d[1] ==
'U' && d[2] ==
'N' && d[3] ==
'K') ||
1262 (d[0] ==
'i' && d[1] ==
'd' && d[2] ==
'x' && d[3] ==
'1') ||
1263 (d[0] ==
'i' && d[1] ==
'n' && d[2] ==
'd' && d[3] ==
'x')) {
1269 if (d[0] ==
'L' && d[1] ==
'I' && d[2] ==
'S' && d[3] ==
'T') {
1281 if (d[2] ==
'i' && d[3] ==
'x' && n < s->
nb_streams) {
1286 if (d[2] ==
'w' && d[3] ==
'c' && n < s->
nb_streams) {
1306 if (
s->nb_streams >= 2) {
1310 if (ast1 && d[2] ==
'w' && d[3] ==
'b'
1314 && ast->
prefix ==
'd'*256+
'c'
1321 "Invalid stream + prefix combination, assuming audio.\n");
1325 if (d[2] ==
'p' && d[3] ==
'c' &&
size <= 4 * 256 + 4) {
1327 int last = (k +
avio_r8(pb) - 1) & 0xFF;
1332 for (; k <= last; k++)
1338 d[2] < 128 && d[3] < 128) ||
1339 d[2] * 256 + d[3] == ast->
prefix
1344 if (d[2] * 256 + d[3] == ast->
prefix)
1347 ast->
prefix = d[2] * 256 + d[3];
1388 int best_stream_index = 0;
1394 for (
i = 0;
i <
s->nb_streams;
i++) {
1416 best_stream_index =
i;
1501 if (ast->
has_pal &&
pkt->
size < (
unsigned)INT_MAX / 2 && !dv_demux) {
1508 "Failed to allocate data for palette\n");
1552 if (
state == 0x1B6 && ptr < end) {
1553 key = !(*ptr & 0xC0);
1606 int nb_index_entries,
i;
1612 unsigned last_idx = -1;
1613 int64_t idx1_pos, first_packet_pos = 0, data_offset = 0;
1616 nb_index_entries =
size / 16;
1617 if (nb_index_entries <= 0)
1627 if (
s->nb_streams == 1 &&
s->streams[0]->codecpar->codec_tag ==
AV_RL32(
"MMES")) {
1628 first_packet_pos = 0;
1633 for (
i = 0;
i < nb_index_entries;
i++) {
1646 if (
index >=
s->nb_streams)
1653 if ((
tag >> 16 & 0xff) ==
'p' && (
tag >> 24 & 0xff) ==
'c')
1656 if (first_packet && first_packet_pos) {
1658 data_offset = first_packet_pos -
pos;
1667 if (last_pos ==
pos)
1669 if (last_idx !=
pos &&
len) {
1697 for (min_pos =
pos = 0; min_pos != INT64_MAX;
pos = min_pos + 1L
U) {
1698 int64_t max_dts = INT64_MIN / 2;
1699 int64_t min_dts = INT64_MAX / 2;
1702 min_pos = INT64_MAX;
1704 for (
i = 0;
i <
s->nb_streams;
i++) {
1715 min_dts =
FFMIN(min_dts, dts);
1719 for (
i = 0;
i <
s->nb_streams;
i++) {
1723 if (idx[
i] && min_dts != INT64_MAX / 2) {
1729 max_dts =
FFMAX(max_dts, dts);
1730 max_buffer =
FFMAX(max_buffer,
1737 max_buffer > 1024 * 1024 * 8 * 8) {
1750 int64_t first_end = INT64_MAX;
1753 for (
i = 0;
i <
s->nb_streams;
i++) {
1770 last_start = INT64_MAX;
1772 last_start = INT64_MAX;
1782 if (last_start > first_end)
1806 if (next < 0 || next > INT64_MAX -
size - (
size & 1))
1810 if (
tag ==
MKTAG(
'i',
'd',
'x',
'1') &&
1814 }
else if (
tag ==
MKTAG(
'L',
'I',
'S',
'T')) {
1817 if (tag1 ==
MKTAG(
'I',
'N',
'F',
'O'))
1863 st =
s->streams[stream_index];
1870 av_log(
s,
AV_LOG_DEBUG,
"Failed to find timestamp %"PRId64
" in index %"PRId64
" .. %"PRId64
"\n",
1901 for (
i = 0;
i <
s->nb_streams;
i++) {
1930 for (
i = 0;
i <
s->nb_streams;
i++) {
1949 if (
avio_seek(
s->pb, pos_min, SEEK_SET) < 0) {
1963 for (
i = 0;
i <
s->nb_streams;
i++) {
1998 .extensions =
"avi",
static int64_t fsize(FILE *f)
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_EF_EXPLODE
abort decoding on minor error detection
#define AVIF_MUSTUSEINDEX
static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)
static AVStream * get_subtitle_pkt(AVFormatContext *s, AVStream *next_st, AVPacket *pkt)
static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int avi_sync(AVFormatContext *s, int exit_early)
static int avi_extract_stream_metadata(AVFormatContext *s, AVStream *st)
static int avi_load_index(AVFormatContext *s)
static const AVOption options[]
static int get_riff(AVFormatContext *s, AVIOContext *pb)
static void avi_metadata_creation_time(AVDictionary **metadata, char *date)
static int avi_read_idx1(AVFormatContext *s, int size)
static int get_duration(AVIStream *ast, int len)
static int check_stream_max_drift(AVFormatContext *s)
static const AVMetadataConv avi_metadata_conv[]
static void avi_read_nikon(AVFormatContext *s, uint64_t end)
static int calculate_bitrate(AVFormatContext *s)
static const AVClass demuxer_class
static int read_odml_index(AVFormatContext *s, int64_t frame_num)
static int avi_probe(const AVProbeData *p)
#define print_tag(s, str, tag, size)
static const char avi_headers[][8]
static int ni_prepare_read(AVFormatContext *s)
#define RETURN_ERROR(code)
AVInputFormat ff_avi_demuxer
static int avi_read_close(AVFormatContext *s)
static int avi_read_header(AVFormatContext *s)
static void seek_subtitle(AVStream *st, AVStream *st2, int64_t timestamp)
static int get_stream_idx(const unsigned *d)
static void clean_index(AVFormatContext *s)
static int guess_ni_flag(AVFormatContext *s)
static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
static const char months[12][4]
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int64_t avio_size(AVIOContext *s)
Get the filesize.
int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a UTF-16 string from pb and convert it to UTF-8.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
AVIOContext * avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
Allocate and initialize an AVIOContext for buffered I/O.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
void avio_context_free(AVIOContext **s)
Free the supplied IO context and everything associated with it.
unsigned int avio_rb32(AVIOContext *s)
int avio_r8(AVIOContext *s)
uint64_t avio_rl64(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t size)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static av_always_inline int bytestream2_tell(GetByteContext *g)
#define flags(name, subs,...)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
#define MKTAG(a, b, c, d)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define CONFIG_DV_DEMUXER
int avpriv_exif_decode_ifd(void *logctx, const uint8_t *buf, int size, int le, int depth, AVDictionary **metadata)
Recursively decodes all IFD's and adds included TAGS into the metadata dictionary.
static int read_header(FFV1Context *f)
@ AV_CODEC_ID_ADPCM_IMA_AMV
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
@ AVDISCARD_ALL
discard all
@ AVDISCARD_DEFAULT
discard useless packets like 0 size packets in avi
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Seek to timestamp ts.
ff_const59 AVInputFormat * av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max)
Guess the file format.
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AVERROR_DEMUXER_NOT_FOUND
Demuxer not found.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().
#define av_fourcc2str(fourcc)
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define AV_TIME_BASE
Internal time base represented as integer.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
#define LIBAVUTIL_VERSION_INT
const AVCodecTag ff_codec_movvideo_tags[]
common internal api header.
const uint8_t * avpriv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static void handler(vbi_event *ev, void *user_data)
@ AV_CLASS_CATEGORY_DEMUXER
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
const AVCodecTag ff_codec_bmp_tags_unofficial[]
const AVCodecTag ff_codec_bmp_tags[]
const AVMetadataConv ff_riff_info_conv[]
internal header for RIFF based (de)muxers do NOT include this in end user applications
int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size)
Read BITMAPINFOHEADER structure and set AVStream codec width, height and bits_per_encoded_sample fiel...
int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian)
int ff_read_riff_info(AVFormatContext *s, int64_t size)
enum AVMediaType codec_type
static const uint8_t header[24]
A reference to a data buffer.
Describe the class of an AVClass context structure.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int extradata_size
Size of the extradata content in bytes.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
Audio only.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
AVIOContext * pb
I/O context.
AVStream ** streams
A list of all streams in the file.
DVDemuxContext * dv_demux
unsigned char * buf_end
End of the data, may be less than buffer+buffer_size if the read function returned less data than req...
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
unsigned char * buf_ptr
Current position in the buffer.
int error
contains the error code or 0 if no error happened
AVFormatContext * sub_ctx
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
This structure stores compressed data.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int flags
A combination of AV_PKT_FLAG values.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
int64_t pos
byte position in stream, -1 if unknown
This structure contains the data a format has to probe a file.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Rational number (pair of numerator and denominator).
int request_probe
stream probing state -1 -> probing finished 0 -> no probing requested rest -> perform probing with re...
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int64_t nb_frames
number of frames in this stream if known or 0
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
int64_t duration
Decoding: duration of the stream, in stream time base.
int id
Format-specific stream ID.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
AVRational avg_frame_rate
Average framerate.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
enum AVStreamParseType need_parsing
AVStreamInternal * internal
An opaque field for libavformat internal usage.
#define avpriv_request_sample(...)
static void error(const char *err)
static const uint8_t offset[127][2]