26 #include "libavutil/intreadwrite.h"
27 #include "libavutil/dict.h"
38 #define AVI_INDEX_CLUSTER_SIZE 16384
70 const char *riff_tag,
const char *list_tag)
91 tag[0] =
'0' + index / 10;
92 tag[1] =
'0' + index % 10;
112 int n, au_byterate, au_ssize, au_scale, nb_frames = 0;
145 int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale;
148 int64_t list1, list2, strh, strf;
214 for (i = 0; i < n; i++) {
229 "Subtitle streams other than DivX XSUB are not supported by the AVI muxer.\n");
310 unsigned char tag[5];
375 for (i = 0; i < 248; i += 4)
386 for (i = 0; i < 1016; i += 4)
403 char ix_tag[] =
"ix00";
436 (ie->
flags & 0x10 ? 0 : 0x80000000));
467 int empty, stream_id = -1;
483 if (empty || tie->pos < ie->
pos) {
509 unsigned char tag[5];
510 unsigned int flags = 0;
523 empty_packet.
size = 0;
556 (cl + 1) *
sizeof(*idx->
cluster))) < 0) {
588 int i, j, n, nb_frames;
606 for (n = nb_frames = 0; n < s->
nb_streams; n++) {
611 if (nb_frames < avist->packet_count)
640 .mime_type =
"video/x-msvideo",
void ff_end_tag(AVIOContext *pb, int64_t start)
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
#define AVI_MAX_RIFF_SIZE
AVCodecContext * codec
Codec context associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
#define AVI_MASTER_INDEX_SIZE
static char * avi_stream2fourcc(char *tag, int index, enum AVMediaType type)
AVOutputFormat ff_avi_muxer
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define AVIF_ISINTERLEAVED
Opaque data information usually continuous.
static double av_q2d(AVRational a)
Convert rational to double.
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
AVRational av_mul_q(AVRational b, AVRational c) av_const
Multiply two rationals.
static int64_t avi_start_new_riff(AVFormatContext *s, AVIOContext *pb, const char *riff_tag, const char *list_tag)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AVI_MAX_STREAM_COUNT
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static int avi_write_idx1(AVFormatContext *s)
void ff_parse_specific_params(AVStream *st, int *au_rate, int *au_ssize, int *au_scale)
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str)
Write a single RIFF info tag.
preferred ID for decoding MPEG audio layer 1, 2 or 3
const AVCodecTag ff_codec_wav_tags[]
int flags
A combination of AV_PKT_FLAG values.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int bit_rate
the average bitrate
const AVCodecTag ff_codec_bmp_tags[]
int width
picture width / height.
AVStream ** streams
A list of all streams in the file.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
static av_always_inline av_const long int lrintf(float x)
static int avi_write_trailer(AVFormatContext *s)
static int avi_write_header(AVFormatContext *s)
#define AVERROR_PATCHWELCOME
Not yet implemented in Libav, patches welcome.
static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
enum AVMediaType codec_type
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
void ff_riff_write_info(AVFormatContext *s)
Write all recognized RIFF tags from s->metadata.
#define AVI_INDEX_CLUSTER_SIZE
rational number numerator/denominator
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
static AVIIentry * avi_get_ientry(AVIIndex *idx, int ent_id)
static void write_header(FFV1Context *f)
static int avi_write_counters(AVFormatContext *s, int riff_id)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
This structure stores compressed data.
static int avi_write_ix(AVFormatContext *s)
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...