87 #define MODE_MATROSKAv2 0x01
88 #define MODE_WEBM 0x02
119 #define MAX_SEEKENTRY_SIZE 21
123 #define MAX_CUETRACKPOS_SIZE 22
126 #define MAX_CUEPOINT_SIZE(num_tracks) 12 + MAX_CUETRACKPOS_SIZE * num_tracks
130 return (
av_log2(
id + 1) - 1) / 7 + 1;
159 while ((num + 1) >> bytes * 7)
175 assert(num < (1ULL << 56) - 1);
179 bytes = needed_bytes;
182 assert(bytes >= needed_bytes);
184 num |= 1ULL << bytes * 7;
185 for (i = bytes - 1; i >= 0; i--)
198 for (i = bytes - 1; i >= 0; i--)
210 const void *buf,
int size)
243 while (
avio_tell(pb) < currentpos + size)
248 uint64_t expectedsize)
269 for (i = 0; i < size / 255; i++)
294 if (numelements > 0) {
315 sizeof(*seekhead->
entries))) < 0) {
370 currentpos = seekhead->
filepos;
397 sizeof(*cues->
entries))) < 0) {
421 uint64_t pts = entry->
pts;
428 for (j = 0; j < cues->
num_entries - i && entry[j].
pts == pts; j++) {
446 int first_header_size;
450 first_header_size = 30;
452 first_header_size = 42;
455 first_header_size, header_start, header_len) < 0) {
461 for (j = 0; j < 2; j++) {
464 for (j = 0; j < 3; j++)
465 avio_write(pb, header_start[j], header_len[j]);
499 av_dict_set(&dict,
"WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
524 int *sample_rate,
int *output_sample_rate)
531 "Error parsing AAC extradata, unable to determine samplerate.\n");
560 "Invalid extradata found, ALAC expects a 36-byte "
581 int ret, codecpriv_size;
632 int display_width, display_height;
633 int h_width = 1, h_height = 1;
640 int stereo_mode = atoi(tag->
value);
642 stereo_mode != 10 && stereo_mode != 12) {
655 switch (stereo->
type) {
711 display_width = codec->
width / h_width;
712 display_height = codec->
height / h_height;
736 int output_sample_rate = 0;
794 "Only VP8 or VP9 video and Vorbis or Opus audio are supported for WebM.\n");
814 else if (!native_id) {
844 if (output_sample_rate)
859 av_log(s,
AV_LOG_ERROR,
"Only audio, video, and subtitles are supported for Matroska.\n");
904 if (ret < 0)
return ret;
945 if ((p = strrchr(p,
'-')) &&
953 else if (*p >=
'a' && *p <=
'z')
978 if (ret < 0)
return ret;
1007 if (ret < 0)
return ret;
1017 if (ret < 0)
return ret;
1027 if (ret < 0)
return ret;
1049 if (ret < 0)
return ret;
1057 const char *mimetype =
NULL;
1072 mimetype = t->
value;
1083 "it cannot be deduced from the codec id.\n", i);
1137 if (ret < 0)
return ret;
1144 uint32_t segment_uid[4];
1149 for (i = 0; i < 4; i++)
1220 int size = pkt_size + 4;
1231 int sh, sm, ss, sc, eh, em, es, ec;
1232 uint64_t start, end;
1234 if (sscanf(p,
"%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",
1235 &sh, &sm, &ss, &sc, &eh, &em, &es, &ec) != 8)
1237 start = 3600000 * sh + 60000 * sm + 1000 * ss + 10 * sc;
1238 end = 3600000 * eh + 60000 * em + 1000 * es + 10 * ec;
1246 int i, layer = 0, max_duration = 0,
size, line_size, data_size = pkt->
size;
1253 max_duration =
FFMAX(duration, max_duration);
1254 end = memchr(data,
'\n', data_size);
1255 size = line_size = end ? end - data + 1 : data_size;
1256 size -= end ? (end[-1] ==
'\r') + 1 : 0;
1258 for (i = 0; i < 3; i++, start++)
1259 if (!(start = memchr(start,
',',
size - (start - data))))
1260 return max_duration;
1262 sscanf(data,
"Dialogue: %d,", &layer);
1263 i = snprintf(buffer,
sizeof(buffer),
"%" PRId64
",%d,",
1266 memcpy(buffer + i, start,
size - i);
1269 "Writing block at offset %" PRIu64
", size %d, "
1270 "pts %" PRId64
", duration %d\n",
1285 data_size -= line_size;
1288 return max_duration;
1329 memcpy(dst + offset, src, header.
blocksize);
1354 "pts %" PRId64
", dts %" PRId64
", duration %d, flags %d\n",
1386 if (data != pkt->
data)
1394 for (i = 0; i < 2 && !
duration; i++) {
1395 int s_hour, s_min, s_sec, s_hsec, e_hour, e_min, e_sec, e_hsec;
1396 if (sscanf(*buf,
"%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d",
1397 &s_hour, &s_min, &s_sec, &s_hsec,
1398 &e_hour, &e_min, &e_sec, &e_hsec) == 8) {
1399 s_min += 60 * s_hour;
1400 e_min += 60 * e_hour;
1401 s_sec += 60 * s_min;
1403 e_sec += 60 * e_min;
1404 s_hsec += 1000 * s_sec;
1405 e_hsec += 1000 * e_sec;
1407 duration = e_hsec - s_hsec;
1409 *buf += strcspn(*buf,
"\n") + 1;
1507 int64_t cluster_time;
1531 cluster_size > 4 * 1024))) {
1533 "Starting new cluster at offset %" PRIu64
" bytes, "
1534 "pts %" PRIu64
"dts %" PRIu64
"\n",
1549 "Could not write cached audio packet ret:%d\n", ret);
1579 "Flushing cluster at offset %" PRIu64
" bytes\n",
1596 int64_t currentpos, cuespos;
1605 "Could not write cached audio packet ret:%d\n", ret);
1635 "Insufficient space reserved for cues: %d "
1636 "(needed: %" PRId64
").\n",
1641 if (cues_end < cuespos + mkv->reserve_cues_space)
1643 (cues_end - cuespos));
1692 #define OFFSET(x) offsetof(MatroskaMuxContext, x)
1693 #define FLAGS AV_OPT_FLAG_ENCODING_PARAM
1695 {
"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 },
1696 {
"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 },
1697 {
"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 },
1701 #if CONFIG_MATROSKA_MUXER
1702 static const AVClass matroska_class = {
1712 .mime_type =
"video/x-matroska",
1713 .extensions =
"mkv",
1729 .priv_class = &matroska_class,
1733 #if CONFIG_WEBM_MUXER
1734 static const AVClass webm_class = {
1744 .mime_type =
"video/webm",
1745 .extensions =
"webm",
1754 .priv_class = &webm_class,
1758 #if CONFIG_MATROSKA_AUDIO_MUXER
1759 static const AVClass mka_class = {
1768 .mime_type =
"audio/x-matroska",
1769 .extensions =
"mka",
1780 .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
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 AVERROR_INVALIDDATA
Invalid data found when processing input.
Views are packed per line, as if interlaced.
void av_free_packet(AVPacket *pkt)
Free a packet.
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.
static void mkv_write_simpletag(AVIOContext *pb, AVDictionaryEntry *t)
#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)
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 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.
#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
int av_dup_packet(AVPacket *pkt)
#define MATROSKA_ID_EDITIONFLAGDEFAULT
#define MATROSKA_ID_CLUSTERTIMECODE
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory 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...
static int mkv_write_native_codecprivate(AVFormatContext *s, AVCodecContext *codec, AVIOContext *dyn_cp)
enum AVSampleFormat sample_fmt
audio sample format
#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
#define MATROSKA_ID_TIMECODESCALE
#define MATROSKA_ID_SIMPLEBLOCK
#define MATROSKA_ID_EDITIONFLAGHIDDEN
int nb_side_data
The number of elements in the AVStream.side_data array.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int mkv_write_srt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
AVStream ** streams
A list of all streams in the file.
#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ
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 MATROSKA_ID_VIDEODISPLAYWIDTH
static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int *sample_rate, int *output_sample_rate)
static EbmlSyntax ebml_header[]
static int put_flac_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec)
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)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define MATROSKA_ID_SEGMENTUID
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.
#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.
#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.
static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define MATROSKA_ID_FILEMIMETYPE
int64_t convergence_duration
Time difference in AVStream->time_base units from the pts of this packet to the point at which the ou...
#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)
AVBufferRef * buf
A reference to the reference-counted buffer where the packet data is stored.
static int ebml_num_size(uint64_t num)
Calculate how many bytes are needed to represent a given number in EBML.
enum AVPacketSideDataType type
void av_log(void *avcl, int level, const char *fmt,...)
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.
uint64_t channel_layout
Audio channel layout.
static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, unsigned int blockid, AVPacket *pkt, int flags)
AVCodecContext * codec
Codec context associated with this stream.
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
int width
picture width / height.
#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
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.
enum AVMediaType codec_type
#define MATROSKA_ID_SEEKID
char * av_strdup(const char *s)
Duplicate the string s.
int sample_rate
samples per second
AVIOContext * pb
I/O context.
void avio_w8(AVIOContext *s, int b)
main external API structure.
#define MATROSKA_ID_BLOCK
#define MATROSKA_ID_TAGTARGETS_TRACKUID
#define MATROSKA_ID_TAGLANG
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
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)
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 int ass_get_duration(const uint8_t *p)
static void put_ebml_id(AVIOContext *pb, unsigned int id)
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
static int put_wv_codecpriv(AVIOContext *pb, AVCodecContext *codec)
Views are on top of each other.
#define MATROSKA_ID_ATTACHMENTS
void avio_wb16(AVIOContext *s, unsigned int val)
#define MATROSKA_ID_CHAPTERDISPLAY
#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
Views are next to each other.
static int mkv_write_trailer(AVFormatContext *s)
#define MATROSKA_ID_CUETRACK
#define MATROSKA_ID_SEEKPOSITION
#define MATROSKA_ID_CODECDELAY
#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_codecprivate(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int native_id, int qt_id)
static int mkv_write_flush_packet(AVFormatContext *s, AVPacket *pkt)
int disposition
AV_DISPOSITION_* bit field.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc)
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
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
#define MATROSKA_ID_POINTENTRY
mkv_seekhead_entry * entries
int channels
number of audio channels
#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)
#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.
static int mkv_write_stereo_mode(AVFormatContext *s, AVIOContext *pb, AVStream *st, int mode)
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 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[]