FFmpeg
Loading...
Searching...
No Matches
matroskaenc.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "config_components.h"
#include "av1.h"
#include "avc.h"
#include "hevc.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avlanguage.h"
#include "dovi_isom.h"
#include "flacenc.h"
#include "internal.h"
#include "isom.h"
#include "nal.h"
#include "matroska.h"
#include "mux.h"
#include "riff.h"
#include "version.h"
#include "vorbiscomment.h"
#include "vvc.h"
#include "wv.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/dict.h"
#include "libavutil/hdr_dynamic_metadata.h"
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/lfg.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/random_seed.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
#include "libavutil/stereo3d.h"
#include "libavcodec/av1.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/codec_desc.h"
#include "libavcodec/codec_par.h"
#include "libavcodec/defs.h"
#include "libavcodec/itut35.h"
#include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/opus/tab.h"

Go to the source code of this file.

Data Structures

struct  ebml_master
 
struct  ebml_stored_master
 
struct  BlockContext
 
struct  EbmlMaster
 
struct  EbmlElement
 
struct  EbmlWriter
 
struct  mkv_seekhead_entry
 
struct  mkv_seekhead
 
struct  mkv_cuepoint
 
struct  mkv_cues
 
struct  mkv_track
 
struct  MatroskaMuxContext
 

Macros

#define MAX_SEEKHEAD_ENTRIES   7
 
#define MAX_EBML_LENGTH   ((1ULL << 56) - 2)
 
#define MAX_SUPPORTED_EBML_LENGTH   FFMIN(MAX_EBML_LENGTH, INT_MAX)
 
#define MODE_MATROSKAv2   0x01
 
#define MODE_WEBM   0x02
 
#define IS_WEBM(mkv)
 
#define IS_SEEKABLE(pb, mkv)
 
#define EBML_WRITER(max_nb_elems)
 
#define MAX_SEEKENTRY_SIZE   21
 2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit offset, 4 bytes for target EBML ID
 
#define MAX_CUETRACKPOS_SIZE   40
 4 * (1-byte EBML ID, 1-byte EBML size, 8-byte uint max)
 
#define DURATION_STRING_LENGTH   19
 DURATION_STRING_LENGTH must be <= 112 or the containing simpletag will need more than one byte for its length field.
 
#define DURATION_SIMPLETAG_SIZE   (2 + 1 + (2 + 1 + 8) + (2 + 1 + DURATION_STRING_LENGTH))
 2 + 1 Simpletag header, 2 + 1 + 8 Name "DURATION", rest for TagString
 
#define OPUS_SEEK_PREROLL   80000000
 Seek preroll value for opus.
 
#define MAX_VIDEO_COLOR_ELEMS   20
 
#define MAX_VIDEO_PROJECTION_ELEMS   6
 
#define MAX_FIELD_ORDER_ELEMS   2
 
#define MAX_STEREO_MODE_ELEMS   1
 
#define FLAG(STEREOMODETYPE, BOOL)
 
#define WDIV1(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM)
 
#define WDIV2(STEREOMODETYPE, WDIV, HDIV, WEBM)
 
#define HDIV1(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM)
 
#define HDIV2(STEREOMODETYPE, WDIV, HDIV, WEBM)
 
#define WEBM1(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM)
 
#define WEBM2(STEREOMODETYPE, WDIV, HDIV, WEBM)
 
#define STEREOMODE(STEREOMODETYPE, STEREO3DTYPE, FLAGS, WDIV, HDIV, WEBM)
 
#define NOTHING(STEREOMODETYPE, WDIV, HDIV, WEBM)
 
#define CASE(type, variable)
 
#define SMPTE_2094_APP5_MAX_SIZE   855
 
#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM
 

Enumerations

enum  { DEFAULT_MODE_INFER , DEFAULT_MODE_INFER_NO_SUBS , DEFAULT_MODE_PASSTHROUGH }
 
enum  EbmlType {
  EBML_UINT , EBML_SINT , EBML_FLOAT , EBML_UID ,
  EBML_STR , EBML_UTF8 = EBML_STR , EBML_BIN , EBML_BLOCK ,
  EBML_MASTER
}
 

Functions

static int parse_opus_packet_duration (const uint8_t *buf, int buf_size)
 Returns the duration of an Opus packet in samples.
 
static int ebml_id_size (uint32_t id)
 
static void put_ebml_id (AVIOContext *pb, uint32_t id)
 
static void put_ebml_size_unknown (AVIOContext *pb, int bytes)
 Write an EBML size meaning "unknown size".
 
static int ebml_num_size (uint64_t num)
 Returns how many bytes are needed to represent a number as EBML variable length integer.
 
static int ebml_length_size (uint64_t length)
 Calculate how many bytes are needed to represent the length field of an EBML element whose payload has a given length.
 
static void put_ebml_num (AVIOContext *pb, uint64_t num, int bytes)
 Write a number as EBML variable length integer on bytes bytes.
 
static void put_ebml_length (AVIOContext *pb, uint64_t length, int bytes)
 Write a length as EBML variable length integer.
 
static void put_ebml_uid (AVIOContext *pb, uint32_t elementid, uint64_t uid)
 Write a (random) UID with fixed size to make the output more deterministic.
 
static void put_ebml_uint (AVIOContext *pb, uint32_t elementid, uint64_t val)
 
static void put_ebml_float (AVIOContext *pb, uint32_t elementid, double val)
 
static void put_ebml_binary (AVIOContext *pb, uint32_t elementid, const void *buf, int size)
 
static void put_ebml_string (AVIOContext *pb, uint32_t elementid, const char *str)
 
static void put_ebml_void (AVIOContext *pb, int size)
 Write a void element of a given size.
 
static ebml_master start_ebml_master (AVIOContext *pb, uint32_t elementid, uint64_t expectedsize)
 
static void end_ebml_master (AVIOContext *pb, ebml_master master)
 
static EbmlElementebml_writer_add (EbmlWriter *writer, uint32_t id, EbmlType type)
 
static void ebml_writer_open_master (EbmlWriter *writer, uint32_t id)
 
static void ebml_writer_close_master (EbmlWriter *writer)
 
static void ebml_writer_close_or_discard_master (EbmlWriter *writer)
 
static void ebml_writer_add_string (EbmlWriter *writer, uint32_t id, const char *str)
 
static void ebml_writer_add_bin (EbmlWriter *writer, uint32_t id, const uint8_t *data, size_t size)
 
static void ebml_writer_add_float (EbmlWriter *writer, uint32_t id, double val)
 
static void ebml_writer_add_uid (EbmlWriter *writer, uint32_t id, uint64_t val)
 
static void ebml_writer_add_uint (EbmlWriter *writer, uint32_t id, uint64_t val)
 
static void ebml_writer_add_sint (EbmlWriter *writer, uint32_t id, int64_t val)
 
static void ebml_writer_add_block (EbmlWriter *writer, MatroskaMuxContext *mkv)
 
static int ebml_writer_str_len (EbmlElement *elem)
 
static av_const int uint_size (uint64_t val)
 
static int ebml_writer_uint_len (EbmlElement *elem)
 
static av_const int sint_size (int64_t val)
 
static int ebml_writer_sint_len (EbmlElement *elem)
 
static int ebml_writer_elem_len (EbmlWriter *writer, EbmlElement *elem, int remaining_elems)
 
static int ebml_writer_master_len (EbmlWriter *writer, EbmlElement *elem, int remaining_elems)
 
static int ebml_writer_block_len (EbmlElement *elem)
 
static void ebml_writer_write_block (const EbmlElement *elem, AVIOContext *pb)
 
static int ebml_writer_elem_write (const EbmlElement *elem, AVIOContext *pb)
 
static int ebml_writer_write (EbmlWriter *writer, AVIOContext *pb)
 
static void mkv_add_seekhead_entry (MatroskaMuxContext *mkv, uint32_t elementid, uint64_t filepos)
 
static int start_ebml_master_crc32 (AVIOContext **dyn_cp, MatroskaMuxContext *mkv)
 
static int end_ebml_master_crc32 (AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv, uint32_t id, int length_size, int keep_buffer, int add_seekentry)
 
static int end_ebml_master_crc32_tentatively (AVIOContext *pb, ebml_stored_master *elem, MatroskaMuxContext *mkv, uint32_t id)
 Output EBML master.
 
static void put_xiph_size (AVIOContext *pb, int size)
 
static void mkv_deinit (AVFormatContext *s)
 Free the members allocated in the mux context.
 
static void mkv_start_seekhead (MatroskaMuxContext *mkv, AVIOContext *pb)
 Initialize the SeekHead element to be ready to index level 1 Matroska elements.
 
static int mkv_write_seekhead (AVIOContext *pb, MatroskaMuxContext *mkv, int error_on_seek_failure, int64_t destpos)
 Write the SeekHead to the file at the location reserved for it and seek to destpos afterwards.
 
static int mkv_add_cuepoint (MatroskaMuxContext *mkv, int stream, int64_t ts, int64_t cluster_pos, int64_t relative_pos, int64_t duration)
 
static int mkv_assemble_cues (AVStream **streams, AVIOContext *dyn_cp, AVIOContext *cuepoint, const mkv_cues *cues, mkv_track *tracks, int num_tracks, uint64_t offset)
 
static int put_xiph_codecpriv (AVFormatContext *s, AVIOContext *pb, const AVCodecParameters *par, const uint8_t *extradata, int extradata_size)
 
static int mkv_assemble_native_codecprivate (AVFormatContext *s, AVIOContext *dyn_cp, const AVCodecParameters *par, const uint8_t *extradata, int extradata_size, unsigned *size_to_reserve)
 
static int mkv_assemble_codecprivate (AVFormatContext *s, AVIOContext *dyn_cp, AVCodecParameters *par, const uint8_t *extradata, int extradata_size, int native_id, int qt_id, uint8_t **codecpriv, int *codecpriv_size, unsigned *max_payload_size)
 
static void mkv_put_codecprivate (AVIOContext *pb, unsigned max_payload_size, const uint8_t *codecpriv, unsigned codecpriv_size)
 
static int mkv_update_codecprivate (AVFormatContext *s, MatroskaMuxContext *mkv, uint8_t *side_data, int side_data_size, AVCodecParameters *par, AVIOContext *pb, mkv_track *track, unsigned alternative_size)
 
static void mkv_write_video_color (EbmlWriter *writer, const AVStream *st, const AVCodecParameters *par)
 
static void mkv_handle_rotation (void *logctx, const AVCodecParameters *par, double *yaw, double *roll)
 
static int mkv_handle_spherical (void *logctx, EbmlWriter *writer, const AVCodecParameters *par, uint8_t private[], double *yaw, double *pitch, double *roll)
 
static void mkv_write_video_projection (void *logctx, EbmlWriter *wr, const AVCodecParameters *par, uint8_t private[])
 
static void mkv_write_field_order (EbmlWriter *writer, int is_webm, enum AVFieldOrder field_order)
 
static int mkv_write_stereo_mode (AVFormatContext *s, EbmlWriter *writer, const AVCodecParameters *par, const AVStream *st, int is_webm, int *h_width, int *h_height)
 
static void mkv_write_blockadditionmapping (AVFormatContext *s, const MatroskaMuxContext *mkv, const AVCodecParameters *par, AVIOContext *pb, mkv_track *track, const AVStream *st)
 
static bool codec_has_blockadditional_alpha (AVFormatContext *s, const AVStream *st, const AVCodecParameters *par)
 
static int mkv_write_track_video (AVFormatContext *s, MatroskaMuxContext *mkv, const AVStream *st, const AVCodecParameters *par, AVIOContext *pb)
 
static void mkv_write_default_duration (mkv_track *track, AVIOContext *pb, AVRational duration)
 
static int mkv_write_track (AVFormatContext *s, MatroskaMuxContext *mkv, AVStream *st, mkv_track *track, AVIOContext *pb, int is_default)
 
static int mkv_write_tracks (AVFormatContext *s)
 
static int mkv_write_simpletag (AVIOContext *pb, const AVDictionaryEntry *t)
 
static void mkv_write_tag_targets (MatroskaMuxContext *mkv, AVIOContext *pb, uint32_t elementid, uint64_t uid)
 
static int mkv_check_tag_name (const char *name, uint32_t elementid)
 
static int mkv_write_tag (MatroskaMuxContext *mkv, const AVDictionary *m, AVIOContext **pb, unsigned reserved_size, uint32_t elementid, uint64_t uid)
 
static int mkv_write_tags (AVFormatContext *s)
 
static int mkv_new_chapter_ids_needed (const AVFormatContext *s)
 
static int mkv_write_chapters (AVFormatContext *s)
 
static const char * get_mimetype (const AVStream *st)
 
static int mkv_write_attachments (AVFormatContext *s)
 
static int64_t get_metadata_duration (AVFormatContext *s)
 
static void ebml_write_header (AVIOContext *pb, const char *doctype, int version)
 
static int mkv_write_info (AVFormatContext *s)
 
static int mkv_write_header (AVFormatContext *s)
 
static int mkv_reformat_av1 (MatroskaMuxContext *mkv, AVIOContext *pb, const AVPacket *pkt, int *size)
 
static int webm_reformat_vtt (MatroskaMuxContext *mkv, AVIOContext *pb, const AVPacket *pkt, int *size)
 
static void mkv_write_blockadditional (EbmlWriter *writer, const uint8_t *buf, size_t size, uint64_t additional_id)
 
static int mkv_write_block (void *logctx, MatroskaMuxContext *mkv, AVIOContext *pb, const AVStream *st, mkv_track *track, const AVPacket *pkt, int keyframe, int64_t ts, uint64_t duration, int force_blockgroup, int64_t relative_packet_pos)
 
static int mkv_end_cluster (AVFormatContext *s)
 
static int mkv_check_new_extra_data (AVFormatContext *s, const AVPacket *pkt)
 
static int mkv_write_packet_internal (AVFormatContext *s, const AVPacket *pkt)
 
static int mkv_write_packet (AVFormatContext *s, const AVPacket *pkt)
 
static int mkv_write_flush_packet (AVFormatContext *s, AVPacket *pkt)
 
static int mkv_write_trailer (AVFormatContext *s)
 
static uint64_t mkv_get_uid (const mkv_track *tracks, int i, AVLFG *c)
 
static int mkv_init (struct AVFormatContext *s)
 
static int mkv_check_bitstream (AVFormatContext *s, AVStream *st, const AVPacket *pkt)
 

Variables

static const AVCodecTag additional_audio_tags []
 
static const AVCodecTag additional_subtitle_tags []
 
static const AVOption options []
 
static const AVClass matroska_webm_class
 

Macro Definition Documentation

◆ MAX_SEEKHEAD_ENTRIES

#define MAX_SEEKHEAD_ENTRIES   7

Definition at line 77 of file matroskaenc.c.

Referenced by mkv_add_seekhead_entry(), and mkv_start_seekhead().

◆ MAX_EBML_LENGTH

#define MAX_EBML_LENGTH   ((1ULL << 56) - 2)

Definition at line 80 of file matroskaenc.c.

◆ MAX_SUPPORTED_EBML_LENGTH

#define MAX_SUPPORTED_EBML_LENGTH   FFMIN(MAX_EBML_LENGTH, INT_MAX)

Definition at line 83 of file matroskaenc.c.

Referenced by ebml_writer_elem_len(), and ebml_writer_master_len().

◆ MODE_MATROSKAv2

#define MODE_MATROSKAv2   0x01

Definition at line 85 of file matroskaenc.c.

Referenced by mkv_init().

◆ MODE_WEBM

#define MODE_WEBM   0x02

Definition at line 86 of file matroskaenc.c.

Referenced by mkv_init().

◆ IS_WEBM

#define IS_WEBM ( mkv)
Value:
(CONFIG_WEBM_MUXER && CONFIG_MATROSKA_MUXER ? \
((mkv)->mode == MODE_WEBM) : CONFIG_WEBM_MUXER)
#define MODE_WEBM
Definition matroskaenc.c:86

Definition at line 88 of file matroskaenc.c.

Referenced by mkv_init(), mkv_write_chapters(), mkv_write_header(), mkv_write_info(), mkv_write_tags(), mkv_write_track(), and mkv_write_track_video().

◆ IS_SEEKABLE

#define IS_SEEKABLE ( pb,
mkv )
Value:
(((pb)->seekable & AVIO_SEEKABLE_NORMAL) && \
!(mkv)->is_live)
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition avio.h:41

Definition at line 90 of file matroskaenc.c.

Referenced by end_ebml_master_crc32_tentatively(), mkv_write_blockadditionmapping(), mkv_write_header(), mkv_write_packet_internal(), mkv_write_tags(), and mkv_write_trailer().

◆ EBML_WRITER

#define EBML_WRITER ( max_nb_elems)
Value:
EbmlElement elements[max_nb_elems]; \
EbmlWriter writer = (EbmlWriter){ .elements = elements, \
.current_master_element = -1 }
static const ElemCat * elements[ELEMENT_COUNT]
Definition signature.h:565

Definition at line 156 of file matroskaenc.c.

Referenced by ebml_write_header(), mkv_write_attachments(), mkv_write_block(), mkv_write_chapters(), mkv_write_simpletag(), and mkv_write_track_video().

◆ MAX_SEEKENTRY_SIZE

#define MAX_SEEKENTRY_SIZE   21

2 bytes * 3 for EBML IDs, 3 1-byte EBML lengths, 8 bytes for 64 bit offset, 4 bytes for target EBML ID

Definition at line 271 of file matroskaenc.c.

Referenced by mkv_start_seekhead(), and mkv_write_seekhead().

◆ MAX_CUETRACKPOS_SIZE

#define MAX_CUETRACKPOS_SIZE   40

4 * (1-byte EBML ID, 1-byte EBML size, 8-byte uint max)

Definition at line 274 of file matroskaenc.c.

Referenced by mkv_assemble_cues().

◆ DURATION_STRING_LENGTH

#define DURATION_STRING_LENGTH   19

DURATION_STRING_LENGTH must be <= 112 or the containing simpletag will need more than one byte for its length field.

Definition at line 278 of file matroskaenc.c.

Referenced by mkv_write_trailer().

◆ DURATION_SIMPLETAG_SIZE

#define DURATION_SIMPLETAG_SIZE   (2 + 1 + (2 + 1 + 8) + (2 + 1 + DURATION_STRING_LENGTH))

2 + 1 Simpletag header, 2 + 1 + 8 Name "DURATION", rest for TagString

Definition at line 281 of file matroskaenc.c.

Referenced by mkv_write_tags().

◆ OPUS_SEEK_PREROLL

#define OPUS_SEEK_PREROLL   80000000

Seek preroll value for opus.

Definition at line 284 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ MAX_VIDEO_COLOR_ELEMS

#define MAX_VIDEO_COLOR_ELEMS   20

Definition at line 1371 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ MAX_VIDEO_PROJECTION_ELEMS

#define MAX_VIDEO_PROJECTION_ELEMS   6

Definition at line 1454 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ MAX_FIELD_ORDER_ELEMS

#define MAX_FIELD_ORDER_ELEMS   2

Definition at line 1593 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ MAX_STEREO_MODE_ELEMS

#define MAX_STEREO_MODE_ELEMS   1

Definition at line 1633 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ FLAG

#define FLAG ( STEREOMODETYPE,
BOOL )
Value:
| (BOOL) << (STEREOMODETYPE)

◆ WDIV1

#define WDIV1 ( STEREOMODETYPE,
STEREO3DTYPE,
FLAGS,
WDIV,
HDIV,
WEBM )
Value:
FLAG(STEREOMODETYPE, WDIV)
#define FLAG(STEREOMODETYPE, BOOL)

Referenced by mkv_write_stereo_mode().

◆ WDIV2

#define WDIV2 ( STEREOMODETYPE,
WDIV,
HDIV,
WEBM )
Value:
FLAG(STEREOMODETYPE, WDIV)

Referenced by mkv_write_stereo_mode().

◆ HDIV1

#define HDIV1 ( STEREOMODETYPE,
STEREO3DTYPE,
FLAGS,
WDIV,
HDIV,
WEBM )
Value:
FLAG(STEREOMODETYPE, HDIV)

Referenced by mkv_write_stereo_mode().

◆ HDIV2

#define HDIV2 ( STEREOMODETYPE,
WDIV,
HDIV,
WEBM )
Value:
FLAG(STEREOMODETYPE, HDIV)

Referenced by mkv_write_stereo_mode().

◆ WEBM1

#define WEBM1 ( STEREOMODETYPE,
STEREO3DTYPE,
FLAGS,
WDIV,
HDIV,
WEBM )
Value:
FLAG(STEREOMODETYPE, WEBM)

Referenced by mkv_write_stereo_mode().

◆ WEBM2

#define WEBM2 ( STEREOMODETYPE,
WDIV,
HDIV,
WEBM )
Value:
FLAG(STEREOMODETYPE, WEBM)

Referenced by mkv_write_stereo_mode().

◆ STEREOMODE

#define STEREOMODE ( STEREOMODETYPE,
STEREO3DTYPE,
FLAGS,
WDIV,
HDIV,
WEBM )
Value:
[(STEREO3DTYPE)][!!((FLAGS) & AV_STEREO3D_FLAG_INVERT)] = (STEREOMODETYPE) + 1,
#define FLAGS
Definition cmdutils.c:598
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
Definition stereo3d.h:194

Referenced by mkv_write_stereo_mode().

◆ NOTHING

#define NOTHING ( STEREOMODETYPE,
WDIV,
HDIV,
WEBM )

◆ CASE

#define CASE ( type,
variable )
Value:
case AVMEDIA_TYPE_ ## type: \
variable ## _idx = i; \
if (st->disposition & AV_DISPOSITION_DEFAULT) \
variable ## _default_idx = i; \
break;
#define AV_DISPOSITION_DEFAULT
The stream should be chosen by default among other streams of the same type, unless the user has expl...
Definition avformat.h:639
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
cl_device_type type

Referenced by mkv_write_tracks().

◆ SMPTE_2094_APP5_MAX_SIZE

#define SMPTE_2094_APP5_MAX_SIZE   855

Referenced by mkv_write_block().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 3671 of file matroskaenc.c.

◆ FLAGS

#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 3672 of file matroskaenc.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_MODE_INFER 
DEFAULT_MODE_INFER_NO_SUBS 
DEFAULT_MODE_PASSTHROUGH 

Definition at line 93 of file matroskaenc.c.

◆ EbmlType

enum EbmlType
Enumerator
EBML_UINT 
EBML_SINT 
EBML_FLOAT 
EBML_UID 
EBML_STR 
EBML_UTF8 
EBML_BIN 
EBML_BLOCK 

pseudo-type for writing (Simple)Blocks

EBML_MASTER 

Definition at line 109 of file matroskaenc.c.

Function Documentation

◆ parse_opus_packet_duration()

static int parse_opus_packet_duration ( const uint8_t * buf,
int buf_size )
static

Returns the duration of an Opus packet in samples.

Definition at line 289 of file matroskaenc.c.

Referenced by mkv_write_block().

◆ ebml_id_size()

static int ebml_id_size ( uint32_t id)
static

Definition at line 314 of file matroskaenc.c.

Referenced by ebml_writer_master_len(), mkv_write_seekhead(), and put_ebml_id().

◆ put_ebml_id()

◆ put_ebml_size_unknown()

static void put_ebml_size_unknown ( AVIOContext * pb,
int bytes )
static

Write an EBML size meaning "unknown size".

Parameters
bytesThe number of bytes the size should occupy (maximum: 8).

Definition at line 331 of file matroskaenc.c.

Referenced by mkv_write_header(), and start_ebml_master().

◆ ebml_num_size()

static int ebml_num_size ( uint64_t num)
static

Returns how many bytes are needed to represent a number as EBML variable length integer.

Definition at line 344 of file matroskaenc.c.

Referenced by ebml_length_size(), and mkv_init().

◆ ebml_length_size()

static int ebml_length_size ( uint64_t length)
static

Calculate how many bytes are needed to represent the length field of an EBML element whose payload has a given length.

Definition at line 357 of file matroskaenc.c.

Referenced by ebml_writer_elem_len(), mkv_put_codecprivate(), mkv_write_blockadditionmapping(), mkv_write_trailer(), put_ebml_length(), and start_ebml_master().

◆ put_ebml_num()

static void put_ebml_num ( AVIOContext * pb,
uint64_t num,
int bytes )
static

Write a number as EBML variable length integer on bytes bytes.

bytes is taken literally without checking.

Definition at line 366 of file matroskaenc.c.

Referenced by ebml_writer_elem_write(), ebml_writer_write_block(), and put_ebml_length().

◆ put_ebml_length()

static void put_ebml_length ( AVIOContext * pb,
uint64_t length,
int bytes )
static

Write a length as EBML variable length integer.

Parameters
bytesThe number of bytes that need to be used to write the number. If zero, the minimal number of bytes will be used.

Definition at line 379 of file matroskaenc.c.

Referenced by end_ebml_master(), end_ebml_master_crc32(), end_ebml_master_crc32_tentatively(), mkv_put_codecprivate(), mkv_write_seekhead(), mkv_write_trailer(), put_ebml_binary(), put_ebml_float(), put_ebml_uid(), put_ebml_uint(), and put_ebml_void().

◆ put_ebml_uid()

static void put_ebml_uid ( AVIOContext * pb,
uint32_t elementid,
uint64_t uid )
static

Write a (random) UID with fixed size to make the output more deterministic.

Definition at line 397 of file matroskaenc.c.

Referenced by mkv_write_tag_targets(), and mkv_write_track().

◆ put_ebml_uint()

◆ put_ebml_float()

static void put_ebml_float ( AVIOContext * pb,
uint32_t elementid,
double val )
static

◆ put_ebml_binary()

static void put_ebml_binary ( AVIOContext * pb,
uint32_t elementid,
const void * buf,
int size )
static

◆ put_ebml_string()

static void put_ebml_string ( AVIOContext * pb,
uint32_t elementid,
const char * str )
static

◆ put_ebml_void()

static void put_ebml_void ( AVIOContext * pb,
int size )
static

Write a void element of a given size.

Useful for reserving space in the file to be written to later.

Parameters
sizeThe number of bytes to reserve, which must be at least 2.

Definition at line 444 of file matroskaenc.c.

Referenced by mkv_put_codecprivate(), mkv_start_seekhead(), mkv_write_blockadditionmapping(), mkv_write_header(), mkv_write_info(), mkv_write_seekhead(), mkv_write_tag(), mkv_write_trailer(), and start_ebml_master_crc32().

◆ start_ebml_master()

static ebml_master start_ebml_master ( AVIOContext * pb,
uint32_t elementid,
uint64_t expectedsize )
static

◆ end_ebml_master()

◆ ebml_writer_add()

◆ ebml_writer_open_master()

◆ ebml_writer_close_master()

static void ebml_writer_close_master ( EbmlWriter * writer)
static

◆ ebml_writer_close_or_discard_master()

static void ebml_writer_close_or_discard_master ( EbmlWriter * writer)
static

◆ ebml_writer_add_string()

static void ebml_writer_add_string ( EbmlWriter * writer,
uint32_t id,
const char * str )
static

◆ ebml_writer_add_bin()

static void ebml_writer_add_bin ( EbmlWriter * writer,
uint32_t id,
const uint8_t * data,
size_t size )
static

◆ ebml_writer_add_float()

static void ebml_writer_add_float ( EbmlWriter * writer,
uint32_t id,
double val )
static

Definition at line 553 of file matroskaenc.c.

Referenced by mkv_write_video_color(), and mkv_write_video_projection().

◆ ebml_writer_add_uid()

static void ebml_writer_add_uid ( EbmlWriter * writer,
uint32_t id,
uint64_t val )
static

Definition at line 561 of file matroskaenc.c.

Referenced by mkv_write_attachments().

◆ ebml_writer_add_uint()

static void ebml_writer_add_uint ( EbmlWriter * writer,
uint32_t id,
uint64_t val )
static

◆ ebml_writer_add_sint()

static void ebml_writer_add_sint ( EbmlWriter * writer,
uint32_t id,
int64_t val )
static

Definition at line 575 of file matroskaenc.c.

Referenced by mkv_write_block().

◆ ebml_writer_add_block()

static void ebml_writer_add_block ( EbmlWriter * writer,
MatroskaMuxContext * mkv )
static

Definition at line 582 of file matroskaenc.c.

Referenced by mkv_write_block().

◆ ebml_writer_str_len()

static int ebml_writer_str_len ( EbmlElement * elem)
static

Definition at line 588 of file matroskaenc.c.

Referenced by ebml_writer_elem_len().

◆ uint_size()

static av_const int uint_size ( uint64_t val)
static

Definition at line 598 of file matroskaenc.c.

Referenced by ebml_writer_uint_len(), and sint_size().

◆ ebml_writer_uint_len()

static int ebml_writer_uint_len ( EbmlElement * elem)
static

Definition at line 607 of file matroskaenc.c.

Referenced by ebml_writer_elem_len().

◆ sint_size()

static av_const int sint_size ( int64_t val)
static

Definition at line 613 of file matroskaenc.c.

Referenced by ebml_writer_sint_len().

◆ ebml_writer_sint_len()

static int ebml_writer_sint_len ( EbmlElement * elem)
static

Definition at line 619 of file matroskaenc.c.

Referenced by ebml_writer_elem_len().

◆ ebml_writer_elem_len()

static int ebml_writer_elem_len ( EbmlWriter * writer,
EbmlElement * elem,
int remaining_elems )
static

Definition at line 700 of file matroskaenc.c.

Referenced by ebml_writer_master_len(), and ebml_writer_write().

◆ ebml_writer_master_len()

static int ebml_writer_master_len ( EbmlWriter * writer,
EbmlElement * elem,
int remaining_elems )
static

Definition at line 628 of file matroskaenc.c.

Referenced by ebml_writer_elem_len().

◆ ebml_writer_block_len()

static int ebml_writer_block_len ( EbmlElement * elem)
static

Definition at line 654 of file matroskaenc.c.

Referenced by ebml_writer_elem_len().

◆ ebml_writer_write_block()

static void ebml_writer_write_block ( const EbmlElement * elem,
AVIOContext * pb )
static

Definition at line 679 of file matroskaenc.c.

Referenced by ebml_writer_elem_write().

◆ ebml_writer_elem_write()

static int ebml_writer_elem_write ( const EbmlElement * elem,
AVIOContext * pb )
static

Definition at line 734 of file matroskaenc.c.

Referenced by ebml_writer_elem_write(), and ebml_writer_write().

◆ ebml_writer_write()

static int ebml_writer_write ( EbmlWriter * writer,
AVIOContext * pb )
static

◆ mkv_add_seekhead_entry()

static void mkv_add_seekhead_entry ( MatroskaMuxContext * mkv,
uint32_t elementid,
uint64_t filepos )
static

Definition at line 787 of file matroskaenc.c.

Referenced by end_ebml_master_crc32(), and end_ebml_master_crc32_tentatively().

◆ start_ebml_master_crc32()

◆ end_ebml_master_crc32()

static int end_ebml_master_crc32 ( AVIOContext * pb,
AVIOContext ** dyn_cp,
MatroskaMuxContext * mkv,
uint32_t id,
int length_size,
int keep_buffer,
int add_seekentry )
static

◆ end_ebml_master_crc32_tentatively()

static int end_ebml_master_crc32_tentatively ( AVIOContext * pb,
ebml_stored_master * elem,
MatroskaMuxContext * mkv,
uint32_t id )
static

Output EBML master.

Keep the buffer if seekable, allowing for later updates. Furthermore always add a SeekHead Entry for this element.

Definition at line 848 of file matroskaenc.c.

Referenced by mkv_write_info(), mkv_write_tags(), and mkv_write_tracks().

◆ put_xiph_size()

static void put_xiph_size ( AVIOContext * pb,
int size )
static

Definition at line 871 of file matroskaenc.c.

Referenced by put_xiph_codecpriv().

◆ mkv_deinit()

static void mkv_deinit ( AVFormatContext * s)
static

Free the members allocated in the mux context.

Definition at line 880 of file matroskaenc.c.

◆ mkv_start_seekhead()

static void mkv_start_seekhead ( MatroskaMuxContext * mkv,
AVIOContext * pb )
static

Initialize the SeekHead element to be ready to index level 1 Matroska elements.

Enough space to write MAX_SEEKHEAD_ENTRIES SeekHead entries will be reserved at the current file location.

Definition at line 901 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_seekhead()

static int mkv_write_seekhead ( AVIOContext * pb,
MatroskaMuxContext * mkv,
int error_on_seek_failure,
int64_t destpos )
static

Write the SeekHead to the file at the location reserved for it and seek to destpos afterwards.

When error_on_seek_failure is not set, failure to seek to the position designated for the SeekHead is not considered an error and it is presumed that destpos is the current position; failure to seek to destpos afterwards is always an error.

Returns
0 on success, < 0 on error.

Definition at line 921 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

◆ mkv_add_cuepoint()

static int mkv_add_cuepoint ( MatroskaMuxContext * mkv,
int stream,
int64_t ts,
int64_t cluster_pos,
int64_t relative_pos,
int64_t duration )
static

Definition at line 962 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

◆ mkv_assemble_cues()

static int mkv_assemble_cues ( AVStream ** streams,
AVIOContext * dyn_cp,
AVIOContext * cuepoint,
const mkv_cues * cues,
mkv_track * tracks,
int num_tracks,
uint64_t offset )
static

Definition at line 994 of file matroskaenc.c.

Referenced by mkv_write_trailer().

◆ put_xiph_codecpriv()

static int put_xiph_codecpriv ( AVFormatContext * s,
AVIOContext * pb,
const AVCodecParameters * par,
const uint8_t * extradata,
int extradata_size )
static

Definition at line 1036 of file matroskaenc.c.

Referenced by mkv_assemble_native_codecprivate().

◆ mkv_assemble_native_codecprivate()

static int mkv_assemble_native_codecprivate ( AVFormatContext * s,
AVIOContext * dyn_cp,
const AVCodecParameters * par,
const uint8_t * extradata,
int extradata_size,
unsigned * size_to_reserve )
static

Definition at line 1150 of file matroskaenc.c.

Referenced by mkv_assemble_codecprivate().

◆ mkv_assemble_codecprivate()

static int mkv_assemble_codecprivate ( AVFormatContext * s,
AVIOContext * dyn_cp,
AVCodecParameters * par,
const uint8_t * extradata,
int extradata_size,
int native_id,
int qt_id,
uint8_t ** codecpriv,
int * codecpriv_size,
unsigned * max_payload_size )
static

Definition at line 1230 of file matroskaenc.c.

Referenced by mkv_update_codecprivate(), and mkv_write_track().

◆ mkv_put_codecprivate()

static void mkv_put_codecprivate ( AVIOContext * pb,
unsigned max_payload_size,
const uint8_t * codecpriv,
unsigned codecpriv_size )
static

Definition at line 1305 of file matroskaenc.c.

Referenced by mkv_update_codecprivate(), and mkv_write_track().

◆ mkv_update_codecprivate()

static int mkv_update_codecprivate ( AVFormatContext * s,
MatroskaMuxContext * mkv,
uint8_t * side_data,
int side_data_size,
AVCodecParameters * par,
AVIOContext * pb,
mkv_track * track,
unsigned alternative_size )
static

Definition at line 1334 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data().

◆ mkv_write_video_color()

static void mkv_write_video_color ( EbmlWriter * writer,
const AVStream * st,
const AVCodecParameters * par )
static

Definition at line 1372 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ mkv_handle_rotation()

static void mkv_handle_rotation ( void * logctx,
const AVCodecParameters * par,
double * yaw,
double * roll )
static

Definition at line 1455 of file matroskaenc.c.

Referenced by mkv_write_video_projection().

◆ mkv_handle_spherical()

static int mkv_handle_spherical ( void * logctx,
EbmlWriter * writer,
const AVCodecParameters * par,
uint8_t private[],
double * yaw,
double * pitch,
double * roll )
static

Definition at line 1510 of file matroskaenc.c.

Referenced by mkv_write_video_projection().

◆ mkv_write_video_projection()

static void mkv_write_video_projection ( void * logctx,
EbmlWriter * wr,
const AVCodecParameters * par,
uint8_t private[] )
static

Definition at line 1570 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ mkv_write_field_order()

static void mkv_write_field_order ( EbmlWriter * writer,
int is_webm,
enum AVFieldOrder field_order )
static

Definition at line 1594 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ mkv_write_stereo_mode()

static int mkv_write_stereo_mode ( AVFormatContext * s,
EbmlWriter * writer,
const AVCodecParameters * par,
const AVStream * st,
int is_webm,
int * h_width,
int * h_height )
static

Definition at line 1634 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ mkv_write_blockadditionmapping()

static void mkv_write_blockadditionmapping ( AVFormatContext * s,
const MatroskaMuxContext * mkv,
const AVCodecParameters * par,
AVIOContext * pb,
mkv_track * track,
const AVStream * st )
static

Definition at line 1734 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ codec_has_blockadditional_alpha()

static bool codec_has_blockadditional_alpha ( AVFormatContext * s,
const AVStream * st,
const AVCodecParameters * par )
static

Definition at line 1811 of file matroskaenc.c.

Referenced by mkv_write_track_video().

◆ mkv_write_track_video()

static int mkv_write_track_video ( AVFormatContext * s,
MatroskaMuxContext * mkv,
const AVStream * st,
const AVCodecParameters * par,
AVIOContext * pb )
static

Definition at line 1825 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ mkv_write_default_duration()

static void mkv_write_default_duration ( mkv_track * track,
AVIOContext * pb,
AVRational duration )
static

Definition at line 1933 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ mkv_write_track()

static int mkv_write_track ( AVFormatContext * s,
MatroskaMuxContext * mkv,
AVStream * st,
mkv_track * track,
AVIOContext * pb,
int is_default )
static

Definition at line 1943 of file matroskaenc.c.

Referenced by mkv_write_tracks().

◆ mkv_write_tracks()

static int mkv_write_tracks ( AVFormatContext * s)
static

Definition at line 2194 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_simpletag()

static int mkv_write_simpletag ( AVIOContext * pb,
const AVDictionaryEntry * t )
static

Definition at line 2248 of file matroskaenc.c.

Referenced by mkv_write_tag().

◆ mkv_write_tag_targets()

static void mkv_write_tag_targets ( MatroskaMuxContext * mkv,
AVIOContext * pb,
uint32_t elementid,
uint64_t uid )
static

Definition at line 2283 of file matroskaenc.c.

Referenced by mkv_write_tag().

◆ mkv_check_tag_name()

static int mkv_check_tag_name ( const char * name,
uint32_t elementid )
static

Definition at line 2293 of file matroskaenc.c.

Referenced by mkv_write_tag().

◆ mkv_write_tag()

static int mkv_write_tag ( MatroskaMuxContext * mkv,
const AVDictionary * m,
AVIOContext ** pb,
unsigned reserved_size,
uint32_t elementid,
uint64_t uid )
static

Definition at line 2307 of file matroskaenc.c.

Referenced by mkv_write_chapters(), and mkv_write_tags().

◆ mkv_write_tags()

static int mkv_write_tags ( AVFormatContext * s)
static

Definition at line 2348 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_new_chapter_ids_needed()

static int mkv_new_chapter_ids_needed ( const AVFormatContext * s)
static

Definition at line 2399 of file matroskaenc.c.

Referenced by mkv_write_chapters().

◆ mkv_write_chapters()

static int mkv_write_chapters ( AVFormatContext * s)
static

Definition at line 2411 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

◆ get_mimetype()

static const char * get_mimetype ( const AVStream * st)
static

Definition at line 2496 of file matroskaenc.c.

Referenced by mkv_init(), and mkv_write_attachments().

◆ mkv_write_attachments()

static int mkv_write_attachments ( AVFormatContext * s)
static

Definition at line 2513 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ get_metadata_duration()

static int64_t get_metadata_duration ( AVFormatContext * s)
static

Definition at line 2563 of file matroskaenc.c.

Referenced by mkv_write_info().

◆ ebml_write_header()

static void ebml_write_header ( AVIOContext * pb,
const char * doctype,
int version )
static

Definition at line 2587 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_info()

static int mkv_write_info ( AVFormatContext * s)
static

Definition at line 2603 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_header()

static int mkv_write_header ( AVFormatContext * s)
static

Definition at line 2662 of file matroskaenc.c.

◆ mkv_reformat_av1()

static int mkv_reformat_av1 ( MatroskaMuxContext * mkv,
AVIOContext * pb,
const AVPacket * pkt,
int * size )
static

Definition at line 2818 of file matroskaenc.c.

Referenced by mkv_init().

◆ webm_reformat_vtt()

static int webm_reformat_vtt ( MatroskaMuxContext * mkv,
AVIOContext * pb,
const AVPacket * pkt,
int * size )
static

Definition at line 2828 of file matroskaenc.c.

Referenced by mkv_init().

◆ mkv_write_blockadditional()

static void mkv_write_blockadditional ( EbmlWriter * writer,
const uint8_t * buf,
size_t size,
uint64_t additional_id )
static

Definition at line 2855 of file matroskaenc.c.

Referenced by mkv_write_block().

◆ mkv_write_block()

static int mkv_write_block ( void * logctx,
MatroskaMuxContext * mkv,
AVIOContext * pb,
const AVStream * st,
mkv_track * track,
const AVPacket * pkt,
int keyframe,
int64_t ts,
uint64_t duration,
int force_blockgroup,
int64_t relative_packet_pos )
static

Definition at line 2864 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

◆ mkv_end_cluster()

static int mkv_end_cluster ( AVFormatContext * s)
static

◆ mkv_check_new_extra_data()

static int mkv_check_new_extra_data ( AVFormatContext * s,
const AVPacket * pkt )
static

Definition at line 3052 of file matroskaenc.c.

Referenced by mkv_write_packet().

◆ mkv_write_packet_internal()

static int mkv_write_packet_internal ( AVFormatContext * s,
const AVPacket * pkt )
static

Definition at line 3124 of file matroskaenc.c.

Referenced by mkv_write_packet(), and mkv_write_trailer().

◆ mkv_write_packet()

static int mkv_write_packet ( AVFormatContext * s,
const AVPacket * pkt )
static

Definition at line 3200 of file matroskaenc.c.

Referenced by mkv_write_flush_packet().

◆ mkv_write_flush_packet()

static int mkv_write_flush_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 3274 of file matroskaenc.c.

◆ mkv_write_trailer()

static int mkv_write_trailer ( AVFormatContext * s)
static

Definition at line 3292 of file matroskaenc.c.

◆ mkv_get_uid()

static uint64_t mkv_get_uid ( const mkv_track * tracks,
int i,
AVLFG * c )
static

Definition at line 3495 of file matroskaenc.c.

Referenced by mkv_init().

◆ mkv_init()

static int mkv_init ( struct AVFormatContext * s)
static

Definition at line 3513 of file matroskaenc.c.

◆ mkv_check_bitstream()

static int mkv_check_bitstream ( AVFormatContext * s,
AVStream * st,
const AVPacket * pkt )
static

Definition at line 3630 of file matroskaenc.c.

Variable Documentation

◆ additional_audio_tags

const AVCodecTag additional_audio_tags[]
static
Initial value:
= {
{ AV_CODEC_ID_ALAC, 0XFFFFFFFF },
{ AV_CODEC_ID_ATRAC1, 0xFFFFFFFF },
{ AV_CODEC_ID_MLP, 0xFFFFFFFF },
{ AV_CODEC_ID_OPUS, 0xFFFFFFFF },
{ AV_CODEC_ID_PCM_S16BE, 0xFFFFFFFF },
{ AV_CODEC_ID_PCM_S24BE, 0xFFFFFFFF },
{ AV_CODEC_ID_PCM_S32BE, 0xFFFFFFFF },
{ AV_CODEC_ID_QDMC, 0xFFFFFFFF },
{ AV_CODEC_ID_QDM2, 0xFFFFFFFF },
{ AV_CODEC_ID_RA_144, 0xFFFFFFFF },
{ AV_CODEC_ID_TRUEHD, 0xFFFFFFFF },
{ AV_CODEC_ID_NONE, 0xFFFFFFFF }
}
@ AV_CODEC_ID_PCM_S24BE
Definition codec_id.h:343
@ AV_CODEC_ID_ATRAC1
Definition codec_id.h:499
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
@ AV_CODEC_ID_PCM_S16BE
Definition codec_id.h:331
@ AV_CODEC_ID_ALAC
Definition codec_id.h:469
@ AV_CODEC_ID_TRUEHD
Definition codec_id.h:497
@ AV_CODEC_ID_QDM2
Definition codec_id.h:472
@ AV_CODEC_ID_PCM_S32BE
Definition codec_id.h:339
@ AV_CODEC_ID_MLP
Definition codec_id.h:482
@ AV_CODEC_ID_RA_144
Definition codec_id.h:438
@ AV_CODEC_ID_QDMC
Definition codec_id.h:503
@ AV_CODEC_ID_OPUS
Definition codec_id.h:513

Definition at line 3648 of file matroskaenc.c.

◆ additional_subtitle_tags

const AVCodecTag additional_subtitle_tags[]
static
Initial value:
= {
{ AV_CODEC_ID_DVB_SUBTITLE, 0xFFFFFFFF },
{ AV_CODEC_ID_DVD_SUBTITLE, 0xFFFFFFFF },
{ AV_CODEC_ID_ARIB_CAPTION, 0xFFFFFFFF },
{ AV_CODEC_ID_NONE, 0xFFFFFFFF }
}
@ AV_CODEC_ID_HDMV_PGS_SUBTITLE
Definition codec_id.h:572
@ AV_CODEC_ID_DVB_SUBTITLE
Definition codec_id.h:567
@ AV_CODEC_ID_DVD_SUBTITLE
Definition codec_id.h:566
@ AV_CODEC_ID_ARIB_CAPTION
Definition codec_id.h:591

Definition at line 3663 of file matroskaenc.c.

◆ options

const AVOption options[]
static
Initial value:
= {
{ "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 },
{ "cues_to_front", "move Cues (the index) to the front by shifting data if necessary", OFFSET(move_cues_to_front), AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1, FLAGS },
{ "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 },
{ "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 },
{ "dash", "create a WebM file conforming to WebM DASH specification", OFFSET(is_dash), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "dash_track_number", "track number for the DASH stream", OFFSET(dash_track_number), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "live", "write files assuming it is a live stream", OFFSET(is_live), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "allow_raw_vfw", "allow raw VFW mode", OFFSET(allow_raw_vfw), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "flipped_raw_rgb", "store raw RGB bitmaps in VFW mode in bottom-up mode", OFFSET(flipped_raw_rgb), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "write_crc32", "write a CRC32 element inside every Level 1 element", OFFSET(write_crc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
{ "default_mode", "control how a track's FlagDefault is inferred", OFFSET(default_mode), AV_OPT_TYPE_INT, { .i64 = DEFAULT_MODE_PASSTHROUGH }, DEFAULT_MODE_INFER, DEFAULT_MODE_PASSTHROUGH, FLAGS, .unit = "default_mode" },
{ "infer", "for each track type, mark each track of disposition default as default; if none exists, mark the first track as default", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_INFER }, 0, 0, FLAGS, .unit = "default_mode" },
{ "infer_no_subs", "for each track type, mark each track of disposition default as default; for audio and video: if none exists, mark the first track as default", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_INFER_NO_SUBS }, 0, 0, FLAGS, .unit = "default_mode" },
{ "passthrough", "use the disposition flag as-is", 0, AV_OPT_TYPE_CONST, { .i64 = DEFAULT_MODE_PASSTHROUGH }, 0, 0, FLAGS, .unit = "default_mode" },
{ NULL },
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT64
Underlying C type is int64_t.
Definition opt.h:262
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
@ DEFAULT_MODE_INFER
Definition matroskaenc.c:94
@ DEFAULT_MODE_INFER_NO_SUBS
Definition matroskaenc.c:95
@ DEFAULT_MODE_PASSTHROUGH
Definition matroskaenc.c:96

Definition at line 3673 of file matroskaenc.c.

◆ matroska_webm_class

const AVClass matroska_webm_class
static
Initial value:
= {
.class_name = "matroska/webm muxer",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 3691 of file matroskaenc.c.