98 }
else if (num >= den) {
110 unsigned int tag = 0;
193 "(%d/%d) and encoder layer (%d/%d)\n",
217 "Tag %s/0x%08x incompatible with output codec id '%d'\n",
229 "Codec for stream %d does not use global headers "
230 "but container format requires global headers\n", i);
320 av_dlog(s,
"compute_pkt_fields2: pts:%" PRId64
" dts:%" PRId64
" cur_dts:%" PRId64
" b:%d size:%d st:%d\n",
359 "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %" PRId64
" >= %" PRId64
"\n",
368 av_dlog(s,
"av_write_frame: pts2:%"PRId64
" dts2:%"PRId64
"\n",
422 this_pktl->
pkt = *pkt;
433 while (!compare(s, &(*next_point)->pkt, pkt))
434 next_point = &(*next_point)->
next;
440 assert(!*next_point);
445 this_pktl->
next = *next_point;
448 *next_point = this_pktl;
467 int stream_count = 0;
477 if (stream_count && (s->
nb_streams == stream_count || flush)) {
495 #if FF_API_INTERLEAVE_PACKET
535 av_dlog(s,
"av_interleaved_write_frame size:%d dts:%" PRId64
" pts:%" PRId64
"\n",
543 av_dlog(s,
"av_interleaved_write_frame FLUSH\n");
#define CODEC_FLAG_BITEXACT
void av_free_packet(AVPacket *pkt)
Free a packet.
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file ensuring correct interleaving.
int avformat_write_header(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and write the stream header to an output media file.
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file.
int64_t pts_buffer[MAX_REORDER_DELAY+1]
int max_b_frames
maximum number of B-frames between non-B-frames Note: The output will be delayed by max_b_frames+1 re...
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int index
stream index in AVFormatContext
int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush)
Interleave a packet per dts in an output media file.
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag)
Put a string representing the codec tag codec_tag in buf.
av_dlog(ac->avr,"%d samples - audio_convert: %s to %s (%s)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic?ac->func_descr_generic:ac->func_descr)
int av_dup_packet(AVPacket *pkt)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
struct AVPacketList * packet_buffer
This buffer is only needed when packets were already buffered but not decoded, for example to get the...
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 LIBAVFORMAT_IDENT
#define FFSWAP(type, a, b)
static void frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
f = val + (num / den) + 0.5.
#define AVFMT_ALLOW_FLUSH
#define AVFMT_NODIMENSIONS
#define AVFMT_GLOBALHEADER
static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush)
Interleave an AVPacket correctly so it can be muxed.
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
struct AVOutputFormat * oformat
void(* destruct)(struct AVPacket *)
static const uint8_t frame_size[4]
void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
AVCodecID
Identify the syntax and semantics of the bitstream.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
static int validate_codec_tag(AVFormatContext *s, AVStream *st)
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
simple assert() macros that are a bit more flexible than ISO C assert().
void av_log(void *avcl, int level, const char *fmt,...)
The exact value of the fractional number is: 'val + num / den'.
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b)
Compare 2 timestamps each in its own timebases.
AVCodecContext * codec
Codec context associated with this stream.
unsigned int nb_streams
A list of all streams in the file.
int void avio_flush(AVIOContext *s)
#define MAX_REORDER_DELAY
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int width
picture width / height.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
static int init_muxer(AVFormatContext *s, AVDictionary **options)
#define AVFMT_NOTIMESTAMPS
enum AVMediaType codec_type
int av_opt_set_dict(void *obj, AVDictionary **options)
int sample_rate
samples per second
AVIOContext * pb
I/O context.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Describe the class of an AVClass context structure.
unsigned int avpriv_toupper4(unsigned int x)
void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, int(*compare)(AVFormatContext *, AVPacket *, AVPacket *))
Add packet to AVFormatContext->packet_buffer list, determining its interleaved position using compare...
struct AVPacketList * packet_buffer_end
#define FF_COMPLIANCE_NORMAL
static int ff_interleave_compare_dts(AVFormatContext *s, AVPacket *next, AVPacket *pkt)
#define CODEC_FLAG_GLOBAL_HEADER
const OptionDef options[]
void av_opt_free(void *obj)
Free all string and binary options in obj.
common internal api header.
struct AVPacketList * next
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
#define AVERROR_INVALIDDATA
static int init_pts(AVFormatContext *s)
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
int64_t nb_frames
number of frames in this stream if known or 0
static void frac_add(AVFrac *f, int64_t incr)
Fractional addition to f: f = f + (incr / f->den).
struct AVFrac pts
encoding: pts generation when outputting stream
int channels
number of audio channels
void * priv_data
Format private data.
#define AVFMT_TS_NONSTRICT
static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
static void comp(unsigned char *dst, int dst_stride, unsigned char *src, int src_stride, int add)
unbuffered private I/O API
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
unsigned int av_codec_get_tag(const struct AVCodecTag *const *tags, enum AVCodecID id)
Get the codec tag for the given codec id id.
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 ...
int strict_std_compliance
strictly follow the standard (MPEG4, ...).
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
struct AVPacketList * last_in_packet_buffer
last packet in packet_buffer for this stream when muxing.
if(!(ptr_align%ac->ptr_align)&&samples_align >=aligned_len)