FFmpeg
Data Structures | Macros | Functions | Variables
matroskaenc.c File Reference
#include <stdint.h>
#include "av1.h"
#include "avc.h"
#include "hevc.h"
#include "avformat.h"
#include "avio_internal.h"
#include "avlanguage.h"
#include "flacenc.h"
#include "internal.h"
#include "isom.h"
#include "matroska.h"
#include "riff.h"
#include "subtitles.h"
#include "vorbiscomment.h"
#include "wv.h"
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/dict.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/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
#include "libavutil/sha.h"
#include "libavutil/stereo3d.h"
#include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/internal.h"

Go to the source code of this file.

Data Structures

struct  ebml_master
 
struct  mkv_seekhead_entry
 
struct  mkv_seekhead
 
struct  mkv_cuepoint
 
struct  mkv_cues
 
struct  mkv_track
 
struct  mkv_attachment
 
struct  mkv_attachments
 
struct  MatroskaMuxContext
 

Macros

#define MODE_MATROSKAv2   0x01
 
#define MODE_WEBM   0x02
 
#define MAX_TRACKS   126
 Maximum number of tracks allowed in a Matroska file (with track numbers in range 1 to 126 (inclusive) More...
 
#define MAX_EBML_HEADER_SIZE   35
 2 bytes * 7 for EBML IDs, 7 1-byte EBML lengths, 6 1-byte uint, 8 byte for "matroska" doctype string More...
 
#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 More...
 
#define MAX_CUETRACKPOS_SIZE   35
 per-cuepoint-track - 5 1-byte EBML IDs, 5 1-byte EBML sizes, 3 8-byte uint max and one 1-byte uint for the track number (this assumes MAX_TRACKS to be <= 255) More...
 
#define MAX_CUEPOINT_CONTENT_SIZE(num_tracks)   10 + MAX_CUETRACKPOS_SIZE * num_tracks
 per-cuepoint - 1 1-byte EBML ID, 1 1-byte EBML size, 8-byte uint max More...
 
#define OPUS_SEEK_PREROLL   80000000
 Seek preroll value for opus. More...
 
#define OFFSET(x)   offsetof(MatroskaMuxContext, x)
 
#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

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". More...
 
static int ebml_num_size (uint64_t num)
 Calculate how many bytes are needed to represent a given number in EBML. More...
 
static void put_ebml_num (AVIOContext *pb, uint64_t num, int bytes)
 Write a number in EBML variable length format. More...
 
static void put_ebml_uint (AVIOContext *pb, uint32_t elementid, uint64_t val)
 
static void put_ebml_sint (AVIOContext *pb, uint32_t elementid, int64_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, uint64_t size)
 Write a void element of a given size. More...
 
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 int start_ebml_master_crc32 (AVIOContext **dyn_cp, MatroskaMuxContext *mkv)
 
static void end_ebml_master_crc32 (AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv, uint32_t id)
 
static void end_ebml_master_crc32_preliminary (AVIOContext *pb, AVIOContext **dyn_cp, MatroskaMuxContext *mkv, uint32_t id, int64_t *pos)
 Complete ebml master without destroying the buffer, allowing for later updates. More...
 
static void put_xiph_size (AVIOContext *pb, int size)
 
static void mkv_free (MatroskaMuxContext *mkv)
 Free the members allocated in the mux context. More...
 
static mkv_seekheadmkv_start_seekhead (AVIOContext *pb, int64_t segment_offset, int numelements)
 Initialize a mkv_seekhead element to be ready to index level 1 Matroska elements. More...
 
static int mkv_add_seekhead_entry (mkv_seekhead *seekhead, uint32_t elementid, uint64_t filepos)
 
static int64_t mkv_write_seekhead (AVIOContext *pb, MatroskaMuxContext *mkv)
 Write the seek head to the file and free it. More...
 
static mkv_cuesmkv_start_cues (int64_t segment_offset)
 
static int mkv_add_cuepoint (mkv_cues *cues, int stream, int tracknum, int64_t ts, int64_t cluster_pos, int64_t relative_pos, int64_t duration)
 
static int64_t mkv_write_cues (AVFormatContext *s, mkv_cues *cues, mkv_track *tracks, int num_tracks)
 
static int put_xiph_codecpriv (AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
 
static int put_wv_codecpriv (AVIOContext *pb, AVCodecParameters *par)
 
static int put_flac_codecpriv (AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par)
 
static int get_aac_sample_rates (AVFormatContext *s, uint8_t *extradata, int extradata_size, int *sample_rate, int *output_sample_rate)
 
static int mkv_write_native_codecprivate (AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, AVIOContext *dyn_cp)
 
static int mkv_write_codecprivate (AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int native_id, int qt_id)
 
static int mkv_write_video_color (AVIOContext *pb, AVCodecParameters *par, AVStream *st)
 
static int mkv_write_video_projection (AVFormatContext *s, AVIOContext *pb, AVStream *st)
 
static void mkv_write_field_order (AVIOContext *pb, int mode, enum AVFieldOrder field_order)
 
static int mkv_write_stereo_mode (AVFormatContext *s, AVIOContext *pb, AVStream *st, int mode, int *h_width, int *h_height)
 
static int mkv_write_track (AVFormatContext *s, MatroskaMuxContext *mkv, int i, AVIOContext *pb, int default_stream_exists)
 
static int mkv_write_tracks (AVFormatContext *s)
 
static int mkv_write_chapters (AVFormatContext *s)
 
static int mkv_write_simpletag (AVIOContext *pb, AVDictionaryEntry *t)
 
static int mkv_write_tag_targets (AVFormatContext *s, uint32_t elementid, unsigned int uid, ebml_master *tag)
 
static int mkv_check_tag_name (const char *name, uint32_t elementid)
 
static int mkv_write_tag (AVFormatContext *s, AVDictionary *m, uint32_t elementid, unsigned int uid)
 
static int mkv_check_tag (AVDictionary *m, uint32_t elementid)
 
static int mkv_write_tags (AVFormatContext *s)
 
static int mkv_write_attachments (AVFormatContext *s)
 
static int64_t get_metadata_duration (AVFormatContext *s)
 
static int mkv_write_header (AVFormatContext *s)
 
static int mkv_blockgroup_size (int pkt_size)
 
static int mkv_strip_wavpack (const uint8_t *src, uint8_t **pdst, int *size)
 
static int mkv_write_block (AVFormatContext *s, AVIOContext *pb, uint32_t blockid, AVPacket *pkt, int keyframe)
 
static int mkv_write_vtt_blocks (AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
 
static void mkv_start_new_cluster (AVFormatContext *s, AVPacket *pkt)
 
static int mkv_check_new_extra_data (AVFormatContext *s, AVPacket *pkt)
 
static int mkv_write_packet_internal (AVFormatContext *s, AVPacket *pkt, int add_cue)
 
static int mkv_write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int mkv_write_flush_packet (AVFormatContext *s, AVPacket *pkt)
 
static int mkv_write_trailer (AVFormatContext *s)
 
static int mkv_query_codec (enum AVCodecID codec_id, int std_compliance)
 
static int webm_query_codec (enum AVCodecID codec_id, int std_compliance)
 
static int mkv_init (struct AVFormatContext *s)
 
static int mkv_check_bitstream (struct AVFormatContext *s, const AVPacket *pkt)
 

Variables

static const AVCodecTag additional_audio_tags []
 
static const AVCodecTag additional_video_tags []
 
static const AVCodecTag additional_subtitle_tags []
 
static const AVOption options []
 

Macro Definition Documentation

◆ MODE_MATROSKAv2

#define MODE_MATROSKAv2   0x01

Definition at line 113 of file matroskaenc.c.

◆ MODE_WEBM

#define MODE_WEBM   0x02

Definition at line 114 of file matroskaenc.c.

◆ MAX_TRACKS

#define MAX_TRACKS   126

Maximum number of tracks allowed in a Matroska file (with track numbers in range 1 to 126 (inclusive)

Definition at line 118 of file matroskaenc.c.

◆ MAX_EBML_HEADER_SIZE

#define MAX_EBML_HEADER_SIZE   35

2 bytes * 7 for EBML IDs, 7 1-byte EBML lengths, 6 1-byte uint, 8 byte for "matroska" doctype string

Definition at line 168 of file matroskaenc.c.

◆ 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 172 of file matroskaenc.c.

◆ MAX_CUETRACKPOS_SIZE

#define MAX_CUETRACKPOS_SIZE   35

per-cuepoint-track - 5 1-byte EBML IDs, 5 1-byte EBML sizes, 3 8-byte uint max and one 1-byte uint for the track number (this assumes MAX_TRACKS to be <= 255)

Definition at line 176 of file matroskaenc.c.

◆ MAX_CUEPOINT_CONTENT_SIZE

#define MAX_CUEPOINT_CONTENT_SIZE (   num_tracks)    10 + MAX_CUETRACKPOS_SIZE * num_tracks

per-cuepoint - 1 1-byte EBML ID, 1 1-byte EBML size, 8-byte uint max

Definition at line 179 of file matroskaenc.c.

◆ OPUS_SEEK_PREROLL

#define OPUS_SEEK_PREROLL   80000000

Seek preroll value for opus.

Definition at line 182 of file matroskaenc.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(MatroskaMuxContext, x)

Definition at line 2807 of file matroskaenc.c.

◆ FLAGS

#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 2808 of file matroskaenc.c.

Function Documentation

◆ ebml_id_size()

static int ebml_id_size ( uint32_t  id)
static

Definition at line 184 of file matroskaenc.c.

Referenced by mkv_write_seekhead(), and put_ebml_id().

◆ put_ebml_id()

static void put_ebml_id ( AVIOContext pb,
uint32_t  id 
)
static

◆ 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 201 of file matroskaenc.c.

Referenced by start_ebml_master().

◆ ebml_num_size()

static int ebml_num_size ( uint64_t  num)
static

Calculate how many bytes are needed to represent a given number in EBML.

Definition at line 211 of file matroskaenc.c.

Referenced by mkv_blockgroup_size(), put_ebml_num(), and start_ebml_master().

◆ put_ebml_num()

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

Write a number in EBML variable length format.

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

Definition at line 227 of file matroskaenc.c.

Referenced by end_ebml_master(), end_ebml_master_crc32(), end_ebml_master_crc32_preliminary(), mkv_write_block(), mkv_write_seekhead(), mkv_write_vtt_blocks(), put_ebml_binary(), put_ebml_float(), put_ebml_sint(), put_ebml_uint(), and put_ebml_void().

◆ put_ebml_uint()

static void put_ebml_uint ( AVIOContext pb,
uint32_t  elementid,
uint64_t  val 
)
static

◆ put_ebml_sint()

static void put_ebml_sint ( AVIOContext pb,
uint32_t  elementid,
int64_t  val 
)
static

Definition at line 259 of file matroskaenc.c.

Referenced by mkv_write_block().

◆ 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,
uint64_t  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 299 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data(), mkv_start_seekhead(), mkv_write_header(), mkv_write_native_codecprivate(), mkv_write_seekhead(), mkv_write_tags(), 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()

static void end_ebml_master ( AVIOContext pb,
ebml_master  master 
)
static

◆ start_ebml_master_crc32()

static int start_ebml_master_crc32 ( AVIOContext **  dyn_cp,
MatroskaMuxContext mkv 
)
static

◆ end_ebml_master_crc32()

static void end_ebml_master_crc32 ( AVIOContext pb,
AVIOContext **  dyn_cp,
MatroskaMuxContext mkv,
uint32_t  id 
)
static

◆ end_ebml_master_crc32_preliminary()

static void end_ebml_master_crc32_preliminary ( AVIOContext pb,
AVIOContext **  dyn_cp,
MatroskaMuxContext mkv,
uint32_t  id,
int64_t *  pos 
)
static

Complete ebml master without destroying the buffer, allowing for later updates.

Definition at line 372 of file matroskaenc.c.

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

◆ put_xiph_size()

static void put_xiph_size ( AVIOContext pb,
int  size 
)
static

Definition at line 385 of file matroskaenc.c.

Referenced by put_xiph_codecpriv().

◆ mkv_free()

static void mkv_free ( MatroskaMuxContext mkv)
static

Free the members allocated in the mux context.

Definition at line 394 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

◆ mkv_start_seekhead()

static mkv_seekhead* mkv_start_seekhead ( AVIOContext pb,
int64_t  segment_offset,
int  numelements 
)
static

Initialize a mkv_seekhead element to be ready to index level 1 Matroska elements.

If a maximum number of elements is specified, enough space will be reserved at the current file location to write a seek head of that size.

Parameters
segment_offsetThe absolute offset to the position in the file where the segment begins.
numelementsThe maximum number of elements that will be indexed by this seek head, 0 if unlimited.

Definition at line 440 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_add_seekhead_entry()

static int mkv_add_seekhead_entry ( mkv_seekhead seekhead,
uint32_t  elementid,
uint64_t  filepos 
)
static

◆ mkv_write_seekhead()

static int64_t mkv_write_seekhead ( AVIOContext pb,
MatroskaMuxContext mkv 
)
static

Write the seek head to the file and free it.

If a maximum number of elements was specified to mkv_start_seekhead(), the seek head will be written at the location reserved for it. Otherwise, it is written at the current location in the file.

Returns
The file offset where the seekhead was written, -1 if an error occurred.

Definition at line 489 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

◆ mkv_start_cues()

static mkv_cues* mkv_start_cues ( int64_t  segment_offset)
static

Definition at line 539 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_add_cuepoint()

static int mkv_add_cuepoint ( mkv_cues cues,
int  stream,
int  tracknum,
int64_t  ts,
int64_t  cluster_pos,
int64_t  relative_pos,
int64_t  duration 
)
static

Definition at line 549 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

◆ mkv_write_cues()

static int64_t mkv_write_cues ( AVFormatContext s,
mkv_cues cues,
mkv_track tracks,
int  num_tracks 
)
static

Definition at line 572 of file matroskaenc.c.

Referenced by mkv_write_trailer().

◆ put_xiph_codecpriv()

static int put_xiph_codecpriv ( AVFormatContext s,
AVIOContext pb,
AVCodecParameters par 
)
static

Definition at line 631 of file matroskaenc.c.

Referenced by mkv_write_native_codecprivate().

◆ put_wv_codecpriv()

static int put_wv_codecpriv ( AVIOContext pb,
AVCodecParameters par 
)
static

Definition at line 659 of file matroskaenc.c.

Referenced by mkv_write_native_codecprivate().

◆ put_flac_codecpriv()

static int put_flac_codecpriv ( AVFormatContext s,
AVIOContext pb,
AVCodecParameters par 
)
static

Definition at line 668 of file matroskaenc.c.

Referenced by mkv_write_native_codecprivate().

◆ get_aac_sample_rates()

static int get_aac_sample_rates ( AVFormatContext s,
uint8_t extradata,
int  extradata_size,
int sample_rate,
int output_sample_rate 
)
static

Definition at line 717 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data(), and mkv_write_track().

◆ mkv_write_native_codecprivate()

static int mkv_write_native_codecprivate ( AVFormatContext s,
AVIOContext pb,
AVCodecParameters par,
AVIOContext dyn_cp 
)
static

Definition at line 750 of file matroskaenc.c.

Referenced by mkv_write_codecprivate().

◆ mkv_write_codecprivate()

static int mkv_write_codecprivate ( AVFormatContext s,
AVIOContext pb,
AVCodecParameters par,
int  native_id,
int  qt_id 
)
static

Definition at line 803 of file matroskaenc.c.

Referenced by mkv_check_new_extra_data(), and mkv_write_track().

◆ mkv_write_video_color()

static int mkv_write_video_color ( AVIOContext pb,
AVCodecParameters par,
AVStream st 
)
static

Definition at line 870 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ mkv_write_video_projection()

static int mkv_write_video_projection ( AVFormatContext s,
AVIOContext pb,
AVStream st 
)
static

Definition at line 960 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ mkv_write_field_order()

static void mkv_write_field_order ( AVIOContext pb,
int  mode,
enum AVFieldOrder  field_order 
)
static

Definition at line 1037 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ mkv_write_stereo_mode()

static int mkv_write_stereo_mode ( AVFormatContext s,
AVIOContext pb,
AVStream st,
int  mode,
int h_width,
int h_height 
)
static

Definition at line 1076 of file matroskaenc.c.

Referenced by mkv_write_track().

◆ mkv_write_track()

static int mkv_write_track ( AVFormatContext s,
MatroskaMuxContext mkv,
int  i,
AVIOContext pb,
int  default_stream_exists 
)
static

Definition at line 1174 of file matroskaenc.c.

Referenced by mkv_write_tracks().

◆ mkv_write_tracks()

static int mkv_write_tracks ( AVFormatContext s)
static

Definition at line 1446 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_chapters()

static int mkv_write_chapters ( AVFormatContext s)
static

Definition at line 1479 of file matroskaenc.c.

Referenced by mkv_write_header(), and mkv_write_trailer().

◆ mkv_write_simpletag()

static int mkv_write_simpletag ( AVIOContext pb,
AVDictionaryEntry t 
)
static

Definition at line 1538 of file matroskaenc.c.

Referenced by mkv_write_tag().

◆ mkv_write_tag_targets()

static int mkv_write_tag_targets ( AVFormatContext s,
uint32_t  elementid,
unsigned int  uid,
ebml_master tag 
)
static

Definition at line 1572 of file matroskaenc.c.

Referenced by mkv_write_tag(), and mkv_write_tags().

◆ mkv_check_tag_name()

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

Definition at line 1598 of file matroskaenc.c.

Referenced by mkv_check_tag(), and mkv_write_tag().

◆ mkv_write_tag()

static int mkv_write_tag ( AVFormatContext s,
AVDictionary m,
uint32_t  elementid,
unsigned int  uid 
)
static

Definition at line 1612 of file matroskaenc.c.

Referenced by mkv_write_tags().

◆ mkv_check_tag()

static int mkv_check_tag ( AVDictionary m,
uint32_t  elementid 
)
static

Definition at line 1636 of file matroskaenc.c.

Referenced by mkv_write_tags().

◆ mkv_write_tags()

static int mkv_write_tags ( AVFormatContext s)
static

Definition at line 1647 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_attachments()

static int mkv_write_attachments ( AVFormatContext s)
static

Definition at line 1737 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ get_metadata_duration()

static int64_t get_metadata_duration ( AVFormatContext s)
static

Definition at line 1834 of file matroskaenc.c.

Referenced by mkv_write_header().

◆ mkv_write_header()

static int mkv_write_header ( AVFormatContext s)
static

Definition at line 1858 of file matroskaenc.c.

◆ mkv_blockgroup_size()

static int mkv_blockgroup_size ( int  pkt_size)
static

Definition at line 2057 of file matroskaenc.c.

Referenced by mkv_write_packet_internal(), and mkv_write_vtt_blocks().

◆ mkv_strip_wavpack()

static int mkv_strip_wavpack ( const uint8_t src,
uint8_t **  pdst,
int size 
)
static

Definition at line 2066 of file matroskaenc.c.

Referenced by mkv_write_block().

◆ mkv_write_block()

static int mkv_write_block ( AVFormatContext s,
AVIOContext pb,
uint32_t  blockid,
AVPacket pkt,
int  keyframe 
)
static

Definition at line 2119 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

◆ mkv_write_vtt_blocks()

static int mkv_write_vtt_blocks ( AVFormatContext s,
AVIOContext pb,
AVPacket pkt 
)
static

Definition at line 2234 of file matroskaenc.c.

Referenced by mkv_write_packet_internal().

◆ mkv_start_new_cluster()

static void mkv_start_new_cluster ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 2279 of file matroskaenc.c.

Referenced by mkv_write_packet(), and mkv_write_packet_internal().

◆ mkv_check_new_extra_data()

static int mkv_check_new_extra_data ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 2292 of file matroskaenc.c.

Referenced by mkv_write_packet().

◆ mkv_write_packet_internal()

static int mkv_write_packet_internal ( AVFormatContext s,
AVPacket pkt,
int  add_cue 
)
static

Definition at line 2399 of file matroskaenc.c.

Referenced by mkv_write_packet(), and mkv_write_trailer().

◆ mkv_write_packet()

static int mkv_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 2483 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 2559 of file matroskaenc.c.

◆ mkv_write_trailer()

static int mkv_write_trailer ( AVFormatContext s)
static

Definition at line 2578 of file matroskaenc.c.

◆ mkv_query_codec()

static int mkv_query_codec ( enum AVCodecID  codec_id,
int  std_compliance 
)
static

Definition at line 2697 of file matroskaenc.c.

◆ webm_query_codec()

static int webm_query_codec ( enum AVCodecID  codec_id,
int  std_compliance 
)
static

Definition at line 2714 of file matroskaenc.c.

◆ mkv_init()

static int mkv_init ( struct AVFormatContext s)
static

Definition at line 2724 of file matroskaenc.c.

◆ mkv_check_bitstream()

static int mkv_check_bitstream ( struct AVFormatContext s,
const AVPacket pkt 
)
static

Definition at line 2762 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_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_RA_288, 0xFFFFFFFF },
{ AV_CODEC_ID_COOK, 0xFFFFFFFF },
{ AV_CODEC_ID_TRUEHD, 0xFFFFFFFF },
{ AV_CODEC_ID_NONE, 0xFFFFFFFF }
}

Definition at line 2777 of file matroskaenc.c.

◆ additional_video_tags

const AVCodecTag additional_video_tags[]
static
Initial value:
= {
{ AV_CODEC_ID_RV10, 0xFFFFFFFF },
{ AV_CODEC_ID_RV20, 0xFFFFFFFF },
{ AV_CODEC_ID_RV30, 0xFFFFFFFF },
{ AV_CODEC_ID_NONE, 0xFFFFFFFF }
}

Definition at line 2793 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_NONE, 0xFFFFFFFF }
}

Definition at line 2800 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 },
{ "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 }, 0, 127, 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 },
{ "write_crc32", "write a CRC32 element inside every Level 1 element", OFFSET(write_crc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS },
{ NULL },
}

Definition at line 2809 of file matroskaenc.c.

AV_CODEC_ID_RA_144
@ AV_CODEC_ID_RA_144
Definition: avcodec.h:551
AV_CODEC_ID_ALAC
@ AV_CODEC_ID_ALAC
Definition: avcodec.h:580
AV_CODEC_ID_HDMV_PGS_SUBTITLE
@ AV_CODEC_ID_HDMV_PGS_SUBTITLE
Definition: avcodec.h:664
AV_CODEC_ID_TRUEHD
@ AV_CODEC_ID_TRUEHD
Definition: avcodec.h:608
AV_CODEC_ID_PCM_S16BE
@ AV_CODEC_ID_PCM_S16BE
Definition: avcodec.h:464
AV_CODEC_ID_DVB_SUBTITLE
@ AV_CODEC_ID_DVB_SUBTITLE
Definition: avcodec.h:659
AV_OPT_TYPE_INT64
@ AV_OPT_TYPE_INT64
Definition: opt.h:224
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_ID_DVD_SUBTITLE
@ AV_CODEC_ID_DVD_SUBTITLE
Definition: avcodec.h:658
AV_CODEC_ID_QDM2
@ AV_CODEC_ID_QDM2
Definition: avcodec.h:583
AV_CODEC_ID_QDMC
@ AV_CODEC_ID_QDMC
Definition: avcodec.h:614
AV_CODEC_ID_OPUS
@ AV_CODEC_ID_OPUS
Definition: avcodec.h:624
AV_CODEC_ID_RV30
@ AV_CODEC_ID_RV30
Definition: avcodec.h:286
AV_CODEC_ID_RA_288
@ AV_CODEC_ID_RA_288
Definition: avcodec.h:552
AV_CODEC_ID_RV10
@ AV_CODEC_ID_RV10
Definition: avcodec.h:223
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: avcodec.h:216
AV_CODEC_ID_RV20
@ AV_CODEC_ID_RV20
Definition: avcodec.h:224
AV_CODEC_ID_PCM_S32BE
@ AV_CODEC_ID_PCM_S32BE
Definition: avcodec.h:472
OFFSET
#define OFFSET(x)
Definition: matroskaenc.c:2807
FLAGS
#define FLAGS
Definition: matroskaenc.c:2808
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
AV_CODEC_ID_COOK
@ AV_CODEC_ID_COOK
Definition: avcodec.h:584
AV_CODEC_ID_PCM_S24BE
@ AV_CODEC_ID_PCM_S24BE
Definition: avcodec.h:476
AV_CODEC_ID_MLP
@ AV_CODEC_ID_MLP
Definition: avcodec.h:593