83 #define MAX_ODML_DEPTH 1000 103 {
'R',
'I',
'F',
'F',
'A',
'V',
'I',
' ' },
104 {
'R',
'I',
'F',
'F',
'A',
'V',
'I',
'X' },
105 {
'R',
'I',
'F',
'F',
'A',
'V',
'I', 0x19 },
106 {
'O',
'N',
'2',
' ',
'O',
'N',
'2',
'f' },
107 {
'R',
'I',
'F',
'F',
'A',
'M',
'V',
' ' },
113 {
"isbj",
"subject" },
115 {
"iart",
"artist" },
116 {
"icop",
"copyright" },
117 {
"icmt",
"comment" },
119 {
"iprd",
"product" },
120 {
"isft",
"software" },
129 #define print_tag(s, str, tag, size) \ 130 av_log(s, AV_LOG_TRACE, "pos:%"PRIX64" %s: tag=%s size=0x%x\n", \ 131 avio_tell(pb), str, av_fourcc2str(tag), size) \ 161 if (header[7] == 0x19)
163 "This file has been generated by a totally broken muxer.\n");
173 int index_sub_type =
avio_r8(pb);
178 int stream_id = ((chunk_id & 0xFF) -
'0') * 10 +
179 ((chunk_id >> 8 & 0xFF) -
'0');
183 int64_t last_pos = -1;
184 int64_t filesize = avi->
fsize;
187 "longs_per_entry:%d index_type:%d entries_in_use:%d " 188 "chunk_id:%X base:%16"PRIX64
" frame_num:%d\n",
196 if (stream_id >= s->
nb_streams || stream_id < 0)
206 if (index_type && longs_per_entry != 2)
211 if (filesize > 0 && base >= filesize) {
213 if (base >> 32 == (base & 0xFFFFFFFF) &&
214 (base & 0xFFFFFFFF) < filesize &&
215 filesize <= 0xFFFFFFFF)
221 for (i = 0; i < entries_in_use; i++) {
233 if (last_pos == pos || pos == base - 8)
235 if (last_pos != pos && len)
258 if (
avio_seek(pb, offset + 8, SEEK_SET) < 0)
298 for (j = 0; j <
size; j +=
max)
313 if (size == UINT_MAX)
318 if (
avio_read(pb, value, size) != size) {
330 static const char months[12][4] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
331 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" };
335 char month[4], time[9],
buffer[64];
338 if (sscanf(date,
"%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d",
339 month, &day, time, &year) == 4) {
340 for (i = 0; i < 12; i++)
342 snprintf(buffer,
sizeof(buffer),
"%.4d-%.2d-%.2d %s",
343 year, i + 1, day, time);
346 }
else if (date[4] ==
'/' && date[7] ==
'/') {
347 date[4] = date[7] =
'-';
358 case MKTAG(
'n',
'c',
't',
'g'):
368 FFMIN(size,
sizeof(buffer) - 1));
377 name =
"creation_time";
378 if (buffer[4] ==
':' && buffer[7] ==
':')
379 buffer[4] = buffer[7] =
'-';
402 if (!data || data_size < 8) {
408 tag = bytestream2_get_le32(&gb);
411 case MKTAG(
'A',
'V',
'I',
'F'):
420 case MKTAG(
'C',
'A',
'S',
'I'):
423 case MKTAG(
'Z',
'o',
'r',
'a'):
454 if (lensum*9/10 > maxpos || lensum < maxpos*9/10)
477 #define RETURN_ERROR(code) do { ret = (code); goto fail; } while (0) 488 int avih_width = 0, avih_height = 0;
489 int amv_file_format = 0;
490 uint64_t list_end = 0;
520 case MKTAG(
'L',
'I',
'S',
'T'):
527 if (tag1 ==
MKTAG(
'm',
'o',
'v',
'i')) {
535 }
else if (tag1 ==
MKTAG(
'I',
'N',
'F',
'O'))
537 else if (tag1 ==
MKTAG(
'n',
'c',
'd',
't'))
541 case MKTAG(
'I',
'D',
'I',
'T'):
543 unsigned char date[64] = { 0 };
550 case MKTAG(
'd',
'm',
'l',
'h'):
554 case MKTAG(
'a',
'm',
'v',
'h'):
556 case MKTAG(
'a',
'v',
'i',
'h'):
572 case MKTAG(
's',
't',
'r',
'h'):
578 if (tag1 ==
MKTAG(
'p',
'a',
'd',
's')) {
587 st->
id = stream_index;
594 tag1 = stream_index ?
MKTAG(
'a',
'u',
'd',
's')
595 :
MKTAG(
'v',
'i',
'd',
's');
599 if (tag1 ==
MKTAG(
'i',
'a',
'v',
's') ||
600 tag1 ==
MKTAG(
'i',
'v',
'a',
's')) {
608 if (handler !=
MKTAG(
'd',
'v',
's',
'd') &&
609 handler !=
MKTAG(
'd',
'v',
'h',
'd') &&
610 handler !=
MKTAG(
'd',
'v',
's',
'l'))
613 if (!CONFIG_DV_DEMUXER)
633 if (ast->
scale > 0 && ast->
rate > 0 && dv_dur > 0) {
656 "scale/rate is %"PRIu32
"/%"PRIu32
" which is invalid. " 657 "(This file has been generated by broken software.)\n",
662 ast->
scale = frame_period;
686 case MKTAG(
'v',
'i',
'd',
's'):
692 case MKTAG(
'a',
'u',
'd',
's'):
695 case MKTAG(
't',
'x',
't',
's'):
698 case MKTAG(
'd',
'a',
't',
's'):
708 "Invalid sample_size %d at stream %d\n",
714 "Invalid sample_size %d at stream %d " 731 case MKTAG(
's',
't',
'r',
'f'):
741 if (cur_pos < list_end)
742 size =
FFMIN(size, list_end - cur_pos);
748 switch (codec_type) {
750 if (amv_file_format) {
760 if (tag1 ==
MKTAG(
'D',
'X',
'S',
'B') ||
761 tag1 ==
MKTAG(
'D',
'X',
'S',
'A')) {
769 if (esize == size-1 && (esize&1)) {
802 for (i = 0; i < pal_size / 4; i++)
803 ast->
pal[i] = 0xFFU<<24 |
AV_RL32(pal_src + 4 * i);
819 "mov tag found in avi (fourcc %s)\n",
830 ast->
handler == MKTAG(
'X',
'V',
'I',
'D'))
872 "sample size (%d) != block align (%d)\n",
900 if (amv_file_format) {
931 case MKTAG(
's',
't',
'r',
'd'):
938 if (cur_pos < list_end)
939 size =
FFMIN(size, list_end - cur_pos);
959 case MKTAG(
'i',
'n',
'd',
'x'):
968 case MKTAG(
'v',
'p',
'r',
'p'):
969 if (stream_index < (
unsigned)s->
nb_streams && size > 9 * 4) {
985 if (active_aspect.
num && active_aspect.
den &&
986 active.
num && active.
den) {
989 active_aspect.
num, active_aspect.
den,
996 case MKTAG(
's',
't',
'r',
'n'):
997 case MKTAG(
'i',
's',
'b',
'j'):
998 case MKTAG(
'i',
'n',
'a',
'm'):
999 case MKTAG(
'i',
'a',
'r',
't'):
1000 case MKTAG(
'i',
'c',
'o',
'p'):
1001 case MKTAG(
'i',
'c',
'm',
't'):
1002 case MKTAG(
'i',
'g',
'n',
'r'):
1003 case MKTAG(
'i',
'p',
'o',
'd'):
1004 case MKTAG(
'i',
's',
'o',
'f'):
1012 if (size > 1000000) {
1014 "Something went wrong during header parsing, " 1015 "tag %s has size %u, " 1016 "I will ignore it and try to continue anyway.\n",
1025 case MKTAG(
'i',
'd',
'x',
'1'):
1050 if (dict_entry && !strcmp(dict_entry->
value,
"PotEncoder"))
1069 "Non-interleaved AVI without index, switching to interleaved\n");
1089 if (pkt->
size >= 7 &&
1099 unsigned int desc_len;
1130 if (strcmp(sub_demuxer->name,
"srt") && strcmp(sub_demuxer->name,
"ass"))
1165 int64_t ts, next_ts, ts_min = INT64_MAX;
1177 if (ts <= next_ts && ts < ts_min) {
1197 if (d[0] >=
'0' && d[0] <=
'9' &&
1198 d[1] >=
'0' && d[1] <=
'9') {
1199 return (d[0] -
'0') * 10 + (d[1] -
'0');
1219 memset(d, -1,
sizeof(d));
1223 for (j = 0; j < 7; j++)
1227 size = d[4] + (d[5] << 8) + (d[6] << 16) + (d[7] << 24);
1230 ff_tlog(s,
"%X %X %X %X %X %X %X %X %"PRId64
" %u %d\n",
1231 d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n);
1232 if (i*(avi->
io_fsize>0) + (uint64_t)size > avi->
fsize || d[0] > 127)
1236 if ((d[0] ==
'i' && d[1] ==
'x' && n < s->
nb_streams) ||
1238 (d[0] ==
'J' && d[1] ==
'U' && d[2] ==
'N' && d[3] ==
'K') ||
1239 (d[0] ==
'i' && d[1] ==
'd' && d[2] ==
'x' && d[3] ==
'1') ||
1240 (d[0] ==
'i' && d[1] ==
'n' && d[2] ==
'd' && d[3] ==
'x')) {
1246 if (d[0] ==
'L' && d[1] ==
'I' && d[2] ==
'S' && d[3] ==
'T') {
1258 if (d[2] ==
'i' && d[3] ==
'x' && n < s->nb_streams) {
1263 if (d[2] ==
'w' && d[3] ==
'c' && n < s->nb_streams) {
1272 if (n < s->nb_streams) {
1287 if ( d[2] ==
'w' && d[3] ==
'b' 1291 && ast->
prefix ==
'd'*256+
'c' 1298 "Invalid stream + prefix combination, assuming audio.\n");
1302 if (d[2] ==
'p' && d[3] ==
'c' && size <= 4 * 256 + 4) {
1304 int last = (k +
avio_r8(pb) - 1) & 0xFF;
1309 for (; k <= last; k++)
1315 d[2] < 128 && d[3] < 128) ||
1316 d[2] * 256 + d[3] == ast->
prefix 1321 if (d[2] * 256 + d[3] == ast->
prefix)
1324 ast->
prefix = d[2] * 256 + d[3];
1365 int best_stream_index = 0;
1368 int64_t best_ts = INT64_MAX;
1393 best_stream_index =
i;
1437 if (CONFIG_DV_DEMUXER && avi->
dv_demux) {
1455 int dv_demux = CONFIG_DV_DEMUXER && avi->
dv_demux;
1478 if (ast->
has_pal && pkt->
size < (
unsigned)INT_MAX / 2 && !dv_demux) {
1485 "Failed to allocate data for palette\n");
1492 if (CONFIG_DV_DEMUXER && dv_demux) {
1529 if (state == 0x1B6 && ptr < end) {
1530 key = !(*ptr & 0xC0);
1583 int nb_index_entries,
i;
1588 int64_t last_pos = -1;
1589 unsigned last_idx = -1;
1590 int64_t idx1_pos, first_packet_pos = 0, data_offset = 0;
1593 nb_index_entries = size / 16;
1594 if (nb_index_entries <= 0)
1605 first_packet_pos = 0;
1610 for (i = 0; i < nb_index_entries; i++) {
1619 i, tag, flags, pos, len);
1621 index = ((tag & 0xff) -
'0') * 10;
1622 index += (tag >> 8 & 0xff) -
'0';
1630 if ((tag >> 16 & 0xff) ==
'p' && (tag >> 24 & 0xff) ==
'c')
1633 if (first_packet && first_packet_pos) {
1634 if (avi->
movi_list + 4 != pos || pos + 500 > first_packet_pos)
1635 data_offset = first_packet_pos -
pos;
1644 if (last_pos == pos)
1646 if (last_idx != pos && len) {
1656 for (index = 0; index < s->
nb_streams; index++) {
1669 int64_t min_pos,
pos;
1674 for (min_pos = pos = 0; min_pos != INT64_MAX; pos = min_pos + 1LU) {
1675 int64_t max_dts = INT64_MIN / 2;
1676 int64_t min_dts = INT64_MAX / 2;
1677 int64_t max_buffer = 0;
1679 min_pos = INT64_MAX;
1692 min_dts =
FFMIN(min_dts, dts);
1700 if (idx[i] && min_dts != INT64_MAX / 2) {
1701 int64_t dts, delta_dts;
1706 max_dts =
FFMAX(max_dts, dts);
1707 max_buffer =
FFMAX(max_buffer,
1714 max_buffer > 1024 * 1024 * 8 * 8) {
1726 int64_t last_start = 0;
1727 int64_t first_end = INT64_MAX;
1747 last_start = INT64_MAX;
1749 last_start = INT64_MAX;
1759 if (last_start > first_end)
1782 next =
avio_tell(pb) + size + (size & 1);
1784 if (tag ==
MKTAG(
'i',
'd',
'x',
'1') &&
1788 }
else if (tag ==
MKTAG(
'L',
'I',
'S',
'T')) {
1791 if (tag1 ==
MKTAG(
'I',
'N',
'F',
'O'))
1816 int64_t timestamp,
int flags)
1821 int64_t
pos, pos_min;
1837 st = s->
streams[stream_index];
1844 av_log(s,
AV_LOG_DEBUG,
"Failed to find timestamp %"PRId64
" in index %"PRId64
" .. %"PRId64
"\n",
1858 if (CONFIG_DV_DEMUXER && avi->
dv_demux) {
1972 .extensions =
"avi",
1978 .priv_class = &demuxer_class,
int ff_read_riff_info(AVFormatContext *s, int64_t size)
static AVStream * get_subtitle_pkt(AVFormatContext *s, AVStream *next_st, AVPacket *pkt)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t avio_size(AVIOContext *s)
Get the filesize.
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
ptrdiff_t const GLvoid * data
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.
AVFormatContext * sub_ctx
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
unsigned char * buf_ptr
Current position in the buffer.
unsigned char * buf_end
End of the data, may be less than buffer+buffer_size if the read function returned less data than req...
int64_t pos
byte position in stream, -1 if unknown
#define print_tag(s, str, tag, size)
#define avpriv_request_sample(...)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * av_default_item_name(void *ptr)
Return the context name.
enum AVMediaType codec_type
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
static int get_duration(AVIStream *ast, int len)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static void error(const char *err)
static int ni_prepare_read(AVFormatContext *s)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
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.
static int check_stream_max_drift(AVFormatContext *s)
static const AVMetadataConv avi_metadata_conv[]
const AVCodecTag ff_codec_movvideo_tags[]
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Opaque data information usually continuous.
static int avi_read_close(AVFormatContext *s)
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
unsigned int avio_rb32(AVIOContext *s)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
enum AVStreamParseType need_parsing
int id
Format-specific stream ID.
GLsizei GLboolean const GLfloat * value
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
static void clean_index(AVFormatContext *s)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int flags
Flags modifying the (de)muxer behaviour.
static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
#define AVERROR_EOF
End of file.
static av_cold int read_close(AVFormatContext *ctx)
const AVCodecTag ff_codec_bmp_tags_unofficial[]
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const uint8_t header[24]
const uint8_t * avpriv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int size, int big_endian)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define AVIF_MUSTUSEINDEX
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.
ff_const59 AVInputFormat * av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max)
Guess the file format.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette...
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
unsigned int avio_rl32(AVIOContext *s)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
int64_t timestamp
Timestamp in AVStream.time_base units, preferably the time from which on correctly decoded frames are...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
preferred ID for decoding MPEG audio layer 1, 2 or 3
#define av_fourcc2str(fourcc)
enum AVMediaType codec_type
General type of the encoded data.
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
int request_probe
stream probing state -1 -> probing finished 0 -> no probing requested rest -> perform probing with re...
static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)
simple assert() macros that are a bit more flexible than ISO C assert().
static int get_stream_idx(const unsigned *d)
AVRational avg_frame_rate
Average framerate.
int flags
A combination of AV_PKT_FLAG values.
int extradata_size
Size of the extradata content in bytes.
int avio_r8(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
common internal API header
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int block_align
Audio only.
static int avi_probe(const AVProbeData *p)
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define AV_TIME_BASE
Internal time base represented as integer.
const AVCodecTag ff_codec_bmp_tags[]
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
static int avi_read_header(AVFormatContext *s)
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static const char months[12][4]
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static void seek_subtitle(AVStream *st, AVStream *st2, int64_t timestamp)
static int avi_extract_stream_metadata(AVFormatContext *s, AVStream *st)
#define AV_EF_EXPLODE
abort decoding on minor error detection
Usually treated as AVMEDIA_TYPE_DATA.
preferred ID for MPEG-1/2 video decoding
static int calculate_bitrate(AVFormatContext *s)
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static const char avi_headers[][8]
static av_always_inline int bytestream2_tell(GetByteContext *g)
static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
#define AV_LOG_INFO
Standard information.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
AVStreamInternal * internal
An opaque field for libavformat internal usage.
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
AVIOContext * pb
I/O context.
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.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static const AVOption options[]
Describe the class of an AVClass context structure.
static int avi_read_idx1(AVFormatContext *s, int size)
Rational number (pair of numerator and denominator).
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
discard useless packets like 0 size packets in avi
int error
contains the error code or 0 if no error happened
This structure contains the data a format has to probe a 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.
const AVMetadataConv ff_riff_info_conv[]
#define flags(name, subs,...)
static int avi_load_index(AVFormatContext *s)
#define AVERROR_DEMUXER_NOT_FOUND
Demuxer not found.
AVInputFormat ff_avi_demuxer
int64_t duration
Decoding: duration of the stream, in stream time base.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
A reference to a data buffer.
static const AVClass demuxer_class
unsigned int avio_rl16(AVIOContext *s)
static void avi_read_nikon(AVFormatContext *s, uint64_t end)
static void avi_metadata_creation_time(AVDictionary **metadata, char *date)
common internal api header.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
int error_recognition
Error recognition; higher values will detect more errors but may misdetect some more or less valid pa...
static int get_riff(AVFormatContext *s, AVIOContext *pb)
void avio_context_free(AVIOContext **s)
Free the supplied IO context and everything associated with it.
int64_t nb_frames
number of frames in this stream if known or 0
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...
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
static int guess_ni_flag(AVFormatContext *s)
void * priv_data
Format private data.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
static int64_t fsize(FILE *f)
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
static int read_odml_index(AVFormatContext *s, int frame_num)
#define MKTAG(a, b, c, d)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.
uint64_t avio_rl64(AVIOContext *s)
static int avi_sync(AVFormatContext *s, int exit_early)
#define RETURN_ERROR(code)
void * av_mallocz_array(size_t nmemb, size_t size)
DVDemuxContext * dv_demux