87 #define MODE_MATROSKAv2 0x01 88 #define MODE_WEBM 0x02 120 #define MAX_SEEKENTRY_SIZE 21 124 #define MAX_CUETRACKPOS_SIZE 22 127 #define MAX_CUEPOINT_SIZE(num_tracks) 12 + MAX_CUETRACKPOS_SIZE * num_tracks 131 return (
av_log2(
id + 1) - 1) / 7 + 1;
160 while ((num + 1) >> bytes * 7)
176 assert(num < (1ULL << 56) - 1);
180 bytes = needed_bytes;
183 assert(bytes >= needed_bytes);
185 num |= 1ULL << bytes * 7;
186 for (i = bytes - 1; i >= 0; i--)
199 for (i = bytes - 1; i >= 0; i--)
211 const void *buf,
int size)
244 while (
avio_tell(pb) < currentpos + size)
249 uint64_t expectedsize)
270 for (i = 0; i < size / 255; i++)
295 if (numelements > 0) {
316 sizeof(*seekhead->
entries))) < 0) {
371 currentpos = seekhead->
filepos;
398 sizeof(*cues->
entries))) < 0) {
422 uint64_t
pts = entry->
pts;
447 int first_header_size;
451 first_header_size = 30;
453 first_header_size = 42;
456 first_header_size, header_start, header_len) < 0) {
462 for (j = 0; j < 2; j++) {
465 for (j = 0; j < 3; j++)
466 avio_write(pb, header_start[j], header_len[j]);
500 av_dict_set(&dict,
"WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
525 int *sample_rate,
int *output_sample_rate)
532 "Error parsing AAC extradata, unable to determine samplerate.\n");
562 "Invalid extradata found, ALAC expects a 36-byte " 579 int native_id,
int qt_id)
583 int ret, codecpriv_size;
633 switch (field_order) {
648 switch (field_order) {
673 int display_width, display_height;
674 int h_width = 1, h_height = 1;
681 int stereo_mode = atoi(tag->
value);
683 stereo_mode != 10 && stereo_mode != 12) {
696 switch (stereo->
type) {
752 display_width = par->
width / h_width;
753 display_height = par->
height / h_height;
777 int output_sample_rate = 0;
841 "Only VP8 or VP9 video and Vorbis or Opus audio are supported for WebM.\n");
862 else if (!native_id) {
894 if (output_sample_rate)
909 av_log(s,
AV_LOG_ERROR,
"Only audio, video, and subtitles are supported for Matroska.\n");
954 if (ret < 0)
return ret;
966 if (chapterstart < 0 || chapterstart > chapterend || chapterend < 0) {
968 "Invalid chapter start (%"PRId64
") or end (%"PRId64
").\n",
969 chapterstart, chapterend);
1004 if ((p = strrchr(p,
'-')) &&
1012 else if (*p >=
'a' && *p <=
'z')
1038 if (ret < 0)
return ret;
1073 if (ret < 0)
return ret;
1083 if (ret < 0)
return ret;
1093 if (ret < 0)
return ret;
1115 if (ret < 0)
return ret;
1123 const char *mimetype =
NULL;
1138 mimetype = t->
value;
1154 "it cannot be deduced from the codec id.\n", i);
1208 if (ret < 0)
return ret;
1215 uint32_t segment_uid[4];
1220 for (i = 0; i < 4; i++)
1291 int size = pkt_size + 4;
1302 int sh, sm, ss, sc, eh, em, es, ec;
1303 uint64_t start, end;
1305 if (sscanf(p,
"%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",
1306 &sh, &sm, &ss, &sc, &eh, &em, &es, &ec) != 8)
1309 if (sh > 9 || sm > 59 || ss > 59 || sc > 99 ||
1310 eh > 9 || em > 59 || es > 59 || ec > 99) {
1312 "Non-standard time reference %d:%d:%d.%d,%d:%d:%d.%d\n",
1313 sh, sm, ss, sc, eh, em, es, ec);
1317 start = 3600000 * sh + 60000 * sm + 1000 * ss + 10 * sc;
1318 end = 3600000 * eh + 60000 * em + 1000 * es + 10 * ec;
1322 "Unexpected time reference %d:%d:%d.%d,%d:%d:%d.%d\n",
1323 sh, sm, ss, sc, eh, em, es, ec);
1334 int i, layer = 0, max_duration = 0,
size, line_size, data_size = pkt->
size;
1341 max_duration =
FFMAX(duration, max_duration);
1342 end = memchr(data,
'\n', data_size);
1343 size = line_size = end ? end - data + 1 : data_size;
1344 size -= end ? (end[-1] ==
'\r') + 1 : 0;
1346 for (i = 0; i < 3; i++, start++)
1347 if (!(start = memchr(start,
',',
size - (start - data))))
1348 return max_duration;
1350 sscanf(data,
"Dialogue: %d,", &layer);
1351 i = snprintf(buffer,
sizeof(buffer),
"%" PRId64
",%d,",
1354 memcpy(buffer + i, start,
size - i);
1357 "Writing block at offset %" PRIu64
", size %d, " 1358 "pts %" PRId64
", duration %d\n",
1373 data_size -= line_size;
1376 return max_duration;
1417 memcpy(dst + offset, src, header.
blocksize);
1442 "pts %" PRId64
", dts %" PRId64
", duration %" PRId64
", flags %d\n",
1474 if (data != pkt->
data)
1482 for (i = 0; i < 2 && !
duration; i++) {
1483 int s_hour, s_min, s_sec, s_hsec, e_hour, e_min, e_sec, e_hsec;
1484 if (sscanf(*buf,
"%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d",
1485 &s_hour, &s_min, &s_sec, &s_hsec,
1486 &e_hour, &e_min, &e_sec, &e_hsec) == 8) {
1487 s_min += 60 * s_hour;
1488 e_min += 60 * e_hour;
1489 s_sec += 60 * s_min;
1491 e_sec += 60 * e_min;
1492 s_hsec += 1000 * s_sec;
1493 e_hsec += 1000 * e_sec;
1495 duration = e_hsec - s_hsec;
1497 *buf += strcspn(*buf,
"\n") + 1;
1576 #if FF_API_CONVERGENCE_DURATION 1604 int64_t cluster_time;
1628 cluster_size > 4 * 1024))) {
1630 "Starting new cluster at offset %" PRIu64
" bytes, " 1631 "pts %" PRIu64
"dts %" PRIu64
"\n",
1651 "Could not write cached audio packet ret:%d\n", ret);
1676 "Flushing cluster at offset %" PRIu64
" bytes\n",
1693 int64_t currentpos, cuespos;
1702 "Could not write cached audio packet ret:%d\n", ret);
1732 "Insufficient space reserved for cues: %d " 1733 "(needed: %" PRId64
").\n",
1738 if (cues_end < cuespos + mkv->reserve_cues_space)
1740 (cues_end - cuespos));
1789 #define OFFSET(x) offsetof(MatroskaMuxContext, x) 1790 #define FLAGS AV_OPT_FLAG_ENCODING_PARAM 1792 {
"reserve_index_space",
"Reserve a given amount of space (in bytes) at the beginning of the file for the index (cues).",
OFFSET(reserve_cues_space),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX,
FLAGS },
1793 {
"cluster_size_limit",
"Store at most the provided amount of bytes in a cluster. ",
OFFSET(cluster_size_limit),
AV_OPT_TYPE_INT , { .i64 = -1 }, -1, INT_MAX, FLAGS },
1794 {
"cluster_time_limit",
"Store at most the provided number of milliseconds in a cluster.",
OFFSET(cluster_time_limit),
AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, FLAGS },
1798 #if CONFIG_MATROSKA_MUXER 1799 static const AVClass matroska_class = {
1809 .mime_type =
"video/x-matroska",
1810 .extensions =
"mkv",
1826 .priv_class = &matroska_class,
1830 #if CONFIG_WEBM_MUXER 1831 static const AVClass webm_class = {
1841 .mime_type =
"video/webm",
1842 .extensions =
"webm",
1851 .priv_class = &webm_class,
1855 #if CONFIG_MATROSKA_AUDIO_MUXER 1856 static const AVClass mka_class = {
1865 .mime_type =
"audio/x-matroska",
1866 .extensions =
"mka",
1877 .priv_class = &mka_class,
unsigned int nb_chapters
Number of chapters in AVChapter array.
void avio_wb64(AVIOContext *s, uint64_t val)
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define MATROSKA_ID_TRACKDEFAULTDURATION
enum AVFieldOrder field_order
Video only.
void avio_wl16(AVIOContext *s, unsigned int val)
static void put_ebml_size_unknown(AVIOContext *pb, int bytes)
Write an EBML size meaning "unknown size".
#define MATROSKA_ID_VIDEOFLAGINTERLACED
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Views are packed per line, as if interlaced.
int sizebytes
how many bytes were reserved for the size
#define MATROSKA_ID_TRACKFLAGLACING
#define MATROSKA_ID_TRACKENTRY
#define MATROSKA_ID_VIDEODISPLAYHEIGHT
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int64_t cluster_pos
file offset of the cluster containing the block
Views are alternated temporally.
#define MATROSKA_ID_CUETRACKPOSITION
#define MATROSKA_ID_CODECPRIVATE
#define AV_LOG_WARNING
Something somehow does not look correct.
#define MATROSKA_ID_AUDIOBITDEPTH
#define MATROSKA_ID_TRACKFLAGDEFAULT
This side data should be associated with a video stream and contains Stereoscopic 3D information in f...
static int mkv_write_attachments(AVFormatContext *s)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, 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)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define MATROSKA_ID_FILEDATA
#define EBML_ID_DOCTYPEREADVERSION
static int mkv_write_header(AVFormatContext *s)
#define MATROSKA_ID_TRACKTYPE
enum AVMediaType codec_type
#define MATROSKA_ID_TAGTARGETS_CHAPTERUID
int ff_flac_is_native_layout(uint64_t channel_layout)
static av_always_inline uint64_t av_double2int(double f)
Reinterpret a double as a 64-bit integer.
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
#define MATROSKA_ID_MUXINGAPP
int64_t cluster_time_limit
#define MATROSKA_ID_AUDIOCHANNELS
AVPacketSideData * side_data
An array of side data that applies to the whole stream (i.e.
#define MATROSKA_ID_CUECLUSTERPOSITION
#define MATROSKA_ID_EDITIONFLAGDEFAULT
#define MATROSKA_ID_CLUSTERTIMECODE
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
This struct describes the properties of an encoded stream.
#define MATROSKA_ID_CHAPTERTIMEEND
int64_t pos
absolute offset in the file where the master's elements start
MatroskaVideoStereoModeType
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
static int64_t mkv_write_cues(AVIOContext *pb, mkv_cues *cues, int num_tracks)
#define MATROSKA_ID_FILEDESC
int64_t cluster_pos
file offset of the current cluster
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 MATROSKA_ID_CHAPLANG
static int srt_get_duration(uint8_t **buf)
static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid, unsigned int uid, ebml_master *tags)
#define MATROSKA_ID_TRACKLANGUAGE
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
const AVCodecTag ff_codec_movvideo_tags[]
static int ebml_id_size(unsigned int id)
int ff_mkv_stereo3d_conv(AVStream *st, MatroskaVideoStereoModeType stereo_mode)
int id
unique ID to identify the chapter
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define MATROSKA_ID_TIMECODESCALE
static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int native_id, int qt_id)
#define MATROSKA_ID_SIMPLEBLOCK
#define MATROSKA_ID_EDITIONFLAGHIDDEN
int nb_side_data
The number of elements in the AVStream.side_data array.
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
Mark the written bytestream as a specific type.
static int mkv_write_srt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
AVStream ** streams
A list of all streams in the file.
A point in the output bytestream where a demuxer can start parsing (for non self synchronizing bytest...
#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ
int initial_padding
Audio only.
static double av_q2d(AVRational a)
Convert rational to double.
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.
#define CONFIG_LIBVPX_VP9_ENCODER
#define MATROSKA_ID_VIDEODISPLAYWIDTH
static EbmlSyntax ebml_header[]
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
#define MATROSKA_ID_TRACKNUMBER
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define MATROSKA_ID_SEGMENTUID
uint64_t channel_layout
Audio only.
static void put_ebml_num(AVIOContext *pb, uint64_t num, int bytes)
Write a number in EBML variable length format.
static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos)
int64_t segment_offset
the file offset to the beginning of the segment
struct AVOutputFormat * oformat
The output container format.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static int get_aac_sample_rates(AVFormatContext *s, AVCodecParameters *par, int *sample_rate, int *output_sample_rate)
#define MATROSKA_ID_TRACKUID
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static int mkv_write_simpletag(AVIOContext *pb, AVDictionaryEntry *t)
#define MATROSKA_ID_VIDEOSTEREOMODE
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
AVCodecID
Identify the syntax and semantics of the bitstream.
static int mkv_write_tags(AVFormatContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
AVDictionary * metadata
Metadata that applies to the whole file.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int flags
Additional information about the frame packing.
#define MATROSKA_ID_BLOCKDURATION
#define EBML_ID_EBMLREADVERSION
#define MAX_CUETRACKPOS_SIZE
per-cuepoint-track - 3 1-byte EBML IDs, 3 1-byte EBML sizes, 2 8-byte uint max
static int mkv_write_ass_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
int reserved_size
-1 if appending to file
#define MATROSKA_ID_CLUSTER
const char * av_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
Convert a language code to a target codespace.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define MATROSKA_ID_FILEMIMETYPE
#define MATROSKA_ID_WRITINGAPP
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
static int mkv_blockgroup_size(int pkt_size)
enum AVMediaType codec_type
General type of the encoded data.
static int ebml_num_size(uint64_t num)
Calculate how many bytes are needed to represent a given number in EBML.
enum AVPacketSideDataType type
enum AVMediaType avcodec_get_type(enum AVCodecID codec_id)
Get the type of the given codec.
static int mkv_write_chapters(AVFormatContext *s)
#define EBML_ID_EBMLMAXIDLENGTH
#define MATROSKA_ID_CHAPTERFLAGHIDDEN
Video is not stereoscopic (and metadata has to be there).
AVRational avg_frame_rate
Average framerate.
const AVCodecTag ff_codec_wav_tags[]
static mkv_seekhead * mkv_start_seekhead(AVIOContext *pb, int64_t segment_offset, int numelements)
Initialize a mkv_seekhead element to be ready to index level 1 Matroska elements. ...
int ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size)
int flags
A combination of AV_PKT_FLAG values.
static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, unsigned int blockid, AVPacket *pkt, int flags)
int extradata_size
Size of the extradata content in bytes.
static void mkv_write_field_order(AVIOContext *pb, enum AVFieldOrder field_order)
const CodecMime ff_mkv_mime_tags[]
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 void avio_flush(AVIOContext *s)
audio channel layout utility functions
#define EBML_ID_EBMLVERSION
#define MATROSKA_ID_TAGTARGETS
const AVCodecTag ff_codec_bmp_tags[]
int av_strcasecmp(const char *a, const char *b)
#define MATROSKA_ID_TAGNAME
static int put_wv_codecpriv(AVIOContext *pb, AVCodecParameters *par)
#define MATROSKA_ID_CHAPTERFLAGENABLED
int ff_wv_parse_header(WvHeader *wv, const uint8_t *data)
Parse a WavPack block header.
#define MATROSKA_ID_SIMPLETAG
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
int ff_flac_write_header(AVIOContext *pb, uint8_t *extradata, int extradata_size, int last_block)
#define MATROSKA_ID_CHAPTERATOM
#define CONFIG_LIBVORBIS_ENCODER
Opaque data information usually sparse.
#define MATROSKA_ID_CHAPTERS
static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)
#define MATROSKA_ID_AUDIOSAMPLINGFREQ
static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
static void put_ebml_string(AVIOContext *pb, unsigned int elementid, const char *str)
int64_t end
chapter start/end time in time_base units
enum AVStereo3DType type
How views are packed within the video.
#define MATROSKA_ID_TRACKFLAGFORCED
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
#define MATROSKA_ID_SEEKID
char * av_strdup(const char *s)
Duplicate the string s.
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
#define MATROSKA_ID_BLOCK
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
#define MATROSKA_ID_TAGTARGETS_TRACKUID
#define MATROSKA_ID_TAGLANG
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
#define MATROSKA_ID_TRACKS
#define MATROSKA_ID_TRACKNAME
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define MATROSKA_ID_SEEKENTRY
Describe the class of an AVClass context structure.
#define MATROSKA_ID_EDITIONENTRY
#define FF_COMPLIANCE_NORMAL
#define MAX_CUEPOINT_SIZE(num_tracks)
per-cuepoint - 2 1-byte EBML IDs, 2 1-byte EBML sizes, 8-byte uint max
#define MATROSKA_ID_BLOCKGROUP
#define MATROSKA_ID_VIDEOPIXELHEIGHT
static int mkv_write_tracks(AVFormatContext *s)
rational number numerator/denominator
static void put_ebml_uint(AVIOContext *pb, unsigned int elementid, uint64_t val)
#define MATROSKA_ID_CUETIME
static int64_t mkv_write_seekhead(AVIOContext *pb, mkv_seekhead *seekhead)
Write the seek head to the file and free it.
int avpriv_split_xiph_headers(uint8_t *extradata, int extradata_size, int first_header_size, uint8_t *header_start[3], int header_len[3])
Split a single extradata buffer into the three headers that most Xiph codecs use. ...
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, const AVCodecTag *tags, int for_asf)
static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
#define MATROSKA_ID_TITLE
#define MATROSKA_ID_TRACKVIDEO
static int mkv_strip_wavpack(const uint8_t *src, uint8_t **pdst, int *size)
static void put_ebml_id(AVIOContext *pb, unsigned int id)
#define CONFIG_LIBOPUS_ENCODER
Views are on top of each other.
#define MATROSKA_ID_ATTACHMENTS
static int64_t pts
Global timestamp for the audio frames.
void avio_wb16(AVIOContext *s, unsigned int val)
#define MATROSKA_ID_CHAPTERDISPLAY
static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
#define MATROSKA_ID_FILENAME
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
const AVMetadataConv ff_mkv_metadata_conv[]
#define MATROSKA_ID_CODECID
static int put_flac_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
#define MATROSKA_ID_VIDEOFIELDORDER
Views are next to each other.
int sample_rate
Audio only.
static int mkv_write_trailer(AVFormatContext *s)
attribute_deprecated int64_t convergence_duration
#define MATROSKA_ID_CUETRACK
#define MATROSKA_ID_SEEKPOSITION
#define MATROSKA_ID_CODECDELAY
#define FF_DISABLE_DEPRECATION_WARNINGS
#define MATROSKA_ID_CHAPTERTIMESTART
static void put_ebml_binary(AVIOContext *pb, unsigned int elementid, const void *buf, int size)
static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, int i, AVIOContext *pb)
static int mkv_write_flush_packet(AVFormatContext *s, AVPacket *pkt)
int disposition
AV_DISPOSITION_* bit field.
static void put_ebml_void(AVIOContext *pb, uint64_t size)
Write a void element of a given size.
AVRational time_base
time base in which the start/end timestamps are specified
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
#define MATROSKA_ID_SEGMENT
static int ass_get_duration(AVFormatContext *s, const uint8_t *p)
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int bit_size, int sync_extension)
Parse MPEG-4 systems extradata to retrieve audio configuration.
#define MATROSKA_ID_SEEKHEAD
int av_packet_ref(AVPacket *dst, AVPacket *src)
Setup a new reference to the data described by a given packet.
A point in the output bytestream where a decoder can start decoding (i.e.
#define FF_ENABLE_DEPRECATION_WARNINGS
#define MATROSKA_ID_POINTENTRY
mkv_seekhead_entry * entries
static int mkv_write_native_codecprivate(AVFormatContext *s, AVCodecParameters *par, AVIOContext *dyn_cp)
#define MATROSKA_ID_FILEUID
Views are packed in a checkerboard-like structure per pixel.
void * priv_data
Format private data.
#define MATROSKA_ID_CHAPTERUID
Views are packed per column.
static void write_header(FFV1Context *f)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
#define MATROSKA_ID_VIDEODISPLAYUNIT
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
static void mkv_flush_dynbuf(AVFormatContext *s)
static const AVOption options[]
#define EBML_ID_EBMLMAXSIZELENGTH
#define MATROSKA_ID_CHAPSTRING
#define MATROSKA_ID_TAGSTRING
#define AV_DICT_IGNORE_SUFFIX
uint32_t av_get_random_seed(void)
Get random data.
const CodecMime ff_mkv_image_mime_tags[]
AVCodecParameters * codecpar
static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb, AVStream *st, int mode)
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt)
#define MATROSKA_ID_DURATION
#define MAX_SEEKENTRY_SIZE
2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit offset, 4 bytes for target EBML I...
static mkv_cues * mkv_start_cues(int64_t segment_offset)
#define EBML_ID_DOCTYPEVERSION
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static void end_ebml_master(AVIOContext *pb, ebml_master master)
#define CONFIG_LIBX264_ENCODER
#define MATROSKA_ID_ATTACHEDFILE
static ebml_master start_ebml_master(AVIOContext *pb, unsigned int elementid, uint64_t expectedsize)
mkv_seekhead * main_seekhead
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 mkv_query_codec(enum AVCodecID codec_id, int std_compliance)
static void put_xiph_size(AVIOContext *pb, int size)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define MATROSKA_ID_VIDEOPIXELWIDTH
int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len)
#define MATROSKA_ID_TRACKAUDIO
#define AV_NOPTS_VALUE
Undefined timestamp value.
const CodecTags ff_mkv_codec_tags[]