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;
146 int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale;
148 int64_t list1, list2, strh, strf;
225 av_log(s,
AV_LOG_ERROR,
"Subtitle streams other than DivX XSUB are not supported by the AVI muxer.\n");
296 unsigned char tag[5];
360 for (i = 0; i < 248; i+= 4)
371 for (i = 0; i < 1016; i += 4)
388 char ix_tag[] =
"ix00";
421 (ie->
flags & 0x10 ? 0 : 0x80000000));
452 int empty, stream_id = -1;
468 if (empty || tie->pos < ie->
pos) {
496 unsigned char tag[5];
497 unsigned int flags=0;
507 empty_packet.
size= 0;
572 int i, j, n, nb_frames;
595 if (nb_frames < avist->packet_count)
624 .mime_type =
"video/x-msvideo",
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void avio_wl16(AVIOContext *s, unsigned int val)
void ff_end_tag(AVIOContext *pb, int64_t start)
int64_t ff_start_tag(AVIOContext *pb, const char *tag)
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale)
#define AVI_MAX_RIFF_SIZE
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVI_MASTER_INDEX_SIZE
static char * avi_stream2fourcc(char *tag, int index, enum AVMediaType type)
AVDictionaryEntry * av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
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...
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define AVIF_ISINTERLEAVED
void avio_wl32(AVIOContext *s, unsigned int val)
Opaque data information usually continuous.
AVStream ** streams
A list of all streams in the file.
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)
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 int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
void avio_wl64(AVIOContext *s, uint64_t val)
#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)
#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
void av_log(void *avcl, int level, const char *fmt,...)
const AVCodecTag ff_codec_wav_tags[]
int flags
A combination of AV_PKT_FLAG values.
AVCodecContext * codec
Codec context associated with this stream.
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
int void avio_flush(AVIOContext *s)
const AVCodecTag ff_codec_bmp_tags[]
int width
picture width / height.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
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
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
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)
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)
void * priv_data
Format private data.
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...
This structure stores compressed data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int avi_write_ix(AVFormatContext *s)
#define AV_NOPTS_VALUE
Undefined timestamp value.