matroska
TRANSCRIPT
-
8/8/2019 MATROSKA
1/59
W E L C O M EW E L C O M E
-
8/8/2019 MATROSKA
2/59
presentationpresentationbyby
abraham philipabraham philip
guided byguided by
Dr.P.MohananDr.P.Mohanan
-
8/8/2019 MATROSKA
3/59
-
8/8/2019 MATROSKA
4/59
CONTENTS
y INTRODUCTION.
yWHAT IS MATROSKA ?
y DIAGRAMATIC REPRESENTATION.
y SPECIFICATIONS.
y COMPARISON OF DIFFERENT CONTAINERS.
-
8/8/2019 MATROSKA
5/59
INTRODUCTION
y Open Standards Multimedia Container Project.
y
Licensed under GNU L GPL.
y Free Parsing & Playback Libraries for commercialsoftware & hardware adoption.
-
8/8/2019 MATROSKA
6/59
-
8/8/2019 MATROSKA
7/59
COMMONCONTAINERS
y 3GP
y AVI (Container for WMA & WMV)
y MPEG
y Quick Time File Format (From Apple Inc)
y RM (Real Media)
-
8/8/2019 MATROSKA
8/59
WHAT IS MATROSKA ?
y It is not a video or audio compression format (videocodec).
y It is an envelope for which there can be many audio,video & subtitles streams, allowing the user to store acomplete movie or CD in a single file.
-
8/8/2019 MATROSKA
9/59
FEATURES
y Fast seeking in the file.
y Chapter entries
y Full metadata(tags) support.y Selectable subtitle/audio/video streams.
y Modularly Expendable.
y Error resilience.
y Streamable over the internet & local networks.
y Menus (like DVDs have).
-
8/8/2019 MATROSKA
10/59
Header
Meta Seek Information
Se ment Information
Track
Chapters
Clusters
Cuein Data
Attachment
Ta in
STRUCTURALDIAGRAM
HEADER What EBML Versionthis files was created with.
METASEEK Index of othergroups in the file.
SEGMENT INFORMATION -Basic informationabout the whole file.
TRACK Information about each ofthe tracks.
CHAPTERS Sets predefined pointsto jump to in video or audio.
-
8/8/2019 MATROSKA
11/59
Header
Meta Seek Information
Se ment Information
Track
Chapters
Clusters
Cuein Data
Attachment
Ta in
STRUCTURALDIAGRAM
CLUSTERS All of the videoframes & audio foreach track.
CUEING DATA- Index of each of
the tracks.
ATTACHMENT- For attaching anytype of file.
TAGGING- Information about thesinger or writer of a song.
-
8/8/2019 MATROSKA
12/59
DETAILEDDIAGRAM
EBML Version Tells the Parser weather it can read the file or not.
Doc Type Detects weather it is a Matroskacontainer file or not.
-
8/8/2019 MATROSKA
13/59
DE
TAI
LE
D
DI
AGRAM
SEEK ID : Contains the Class-ID of a Level 1 element.
SEEK POSITION : Byte position of that particular element.
TITLE : Contains the title of the file.
SEGMENT UID : ID used to identify the file.
-
8/8/2019 MATROSKA
14/59
DE
TAI
LE
D
DI
AG
RAM
Name : Contains the Name of the track.
Track Number : Contains the number of the track.
Track Type : Tells what the track contains, such as audio/video/subtitles e.t.c.
-
8/8/2019 MATROSKA
15/59
DETAI
LED
DI
AGR
AM
EDITION ENTRY: Gives information about which chapter to be played.
CHAPTERS : Contains the split chapters of a movie or any other data.
-
8/8/2019 MATROSKA
16/59
DE
TAI
LED
DI
AGRAM
HELPS IN SEEKING & WITH ERROR PROTECTION.
Time Code : Time code that the first block should playback.
Block Group: Block of data, & any information relating to Block.
-
8/8/2019 MATROSKA
17/59
DETAI
LED
DI
AGR
AM
Cue Point : Time code stored in Cue Time.Cue Position : Listing of the exact position of the in the file for each of the track for
that timecode.
File Name : Name of the attachedF
ile.File Data : The file attached.
-
8/8/2019 MATROSKA
18/59
DETAI
LED
DI
AGRAM
Tag Element : Contains all of the information of specific tracks or chapters.
Tags : Contains all the extra information about the file, script writer, singer,actors, directors, titles, edition, price, dates, comments etc.
-
8/8/2019 MATROSKA
19/59
SPECIFICATIONS
y EBML Principle.
y EBML Extensible Binary Meta Language.
y It is a binary derivative of XML.
y Specifies a binary & octet format.
y Format is made of 2 parts: Semantic & Syntax.
-
8/8/2019 MATROSKA
20/59
SEMANTICOFEBML
y Specifies a number ofIDs & their basic type.
y Specific tags used are arbitrary.
y Semantic of EBML outlines general data types & IDs.
-
8/8/2019 MATROSKA
21/59
BASICDATA TYPES
y Signed Integer - Big-endian, any size from 1 to 8 octetsy Unsigned Integer - Big-endian, any size from 1 to 8 octetsy Float - Big-endian, defined for 4 and 8 octets (32, 64 bits)
y String - Printable ASCII (0x20 to 0x7E), zero-padded whenneededy UTF-8 Unicode string, zero padded when needed (RFC 2279)y Date - signed 8 octets integer in nanoseconds with 0 indicating
the precise beginning of the millennium (at 2001-01-01T00:00:00,000000000 UTC)
y master-element - contains other EBML sub-elements of the nextlower level
y Binary - not interpreted by the parser
-
8/8/2019 MATROSKA
22/59
CODING FORMATS
y Element ID using a UTF-8 like system.
y Data size In octets, is also coded with a UTF-8 likesystem.
y Only one reserved word for Element Size encoding.
y Data - Integers are stored in their standard big-endianform.
-
8/8/2019 MATROSKA
23/59
Element ID coded with a UTF-8like system :
-
8/8/2019 MATROSKA
24/59
-
8/8/2019 MATROSKA
25/59
SPECIFICATIONNOTES
y Beginning of file: EBML file always starts with 0x1A,
thus helps to include ASCII text before
EBML data.
EBML parser is safe from false-alarm with
these ASCII only codes.
The EBML header is next stored
-
8/8/2019 MATROSKA
26/59
y Block Timecodes:
y Represented by a 16 bit signed integer.
y Represents the raw timecode relative to the Clusters
timecode, multiplied by the Timecode Scale.
y Default Values:
y Default value of an element is assumed when not present
in the data stream.
y It is assumed only in the scope of its upper-element.
-
8/8/2019 MATROSKA
27/59
y EBML Class:y
A larger class-I
D can be used as a synch word in case the file isdamaged.
y Elements used frequently, but do not need to act as a synchword have a small class-ID
y
Encryption:
y Allows people to implement whatever form of encryption isbest for them.
y Possible to manipulate encrypted streams without decrypting
them.y Two completely different types of encryption can be used,
requiring two separate keys to decrypt them.
-
8/8/2019 MATROSKA
28/59
y Image cropping :
y
PixelCropXXX elements help to crop the image beforebeing resized.
y Octet: Refers to a byte made of 8 bits.
y Overlay Track :
y Overlay tracks should be rendered in the same 'channel'as the track it's linked to.
y When content is found in such a track it is played on therendering channel instead of the original track.
-
8/8/2019 MATROSKA
29/59
y Position References:
y
Refers to the position, in octets, from the beginning ofan element.
y The reference is the beginning of the first Segmentelement. 0 = first level 1 element in the segment.
y Raw Timecode:
y The exact time of an object represented in nanoseconds.
y To find out a Block's Raw Timecode, you need the
Block's timecode, the Cluster's Timecode, and theTimecodeScale. For calculation, please see the see theTimecodeScale notes.
-
8/8/2019 MATROSKA
30/59
SEGMENTLINKING
y Hard linking:
y This linking can also be called splitting.
y I
t's the operation of cutting one segment in several parts.The resulting parts should play as if it was just one part(the original segment).
y The timecode of each part follows the ones from theprevious parts. The track numbers are the same.
y The chapters only match the current segment (unless theedition is ordered, where all parts should be in eachsegment).
y The NextUID and PrevUID points the respective segmentUIDs.
-
8/8/2019 MATROSKA
31/59
y Soft linking:
y Used by codec chapters.y They can reference another segment and jump on that
Segment.
y
Medium linking:y This kind of linking is a mix between hard and soft linking.
y Done through chapters using the ChapterSegmentUIDelement and only makes sense for ordered editions.
y Timecodes of the following content should be shifted by
the duration of the linked segment.y For hard-linking, the resulting segment edition should be
played and considered as one.
-
8/8/2019 MATROSKA
32/59
y Segment UID:
y The 128 bits UIDs must be as unique as possible.
y TrackTimecodeScale:
y Used to align tracks that would otherwise be played atdifferent speeds.
y To avoid problems that may occur in differentBroadcasting standards like NTSC/PAL
-
8/8/2019 MATROSKA
33/59
y 3D and multi-planar videos:
y There are 2 different ways to compress 3D videos:
y Have each 'eye' track in a separate track and
y Have one track code both 'eyes' into one track (which is more
efficient, compression-wise).
y Matroska supports both ways (and even more):
y For the single track variant, there is the StereoMode elementwhich can define what kind of element (mono or left-right).
y For separate tracks, Matroska needs to define exactly whichtrack does what.
-
8/8/2019 MATROSKA
34/59
TRACKOPERATION
y TrackOperation allows combining multiple tracks to make
a virtual one.
y It uses 2 separate system to combine tracks.
y One to create a 3D "composition" (left/right/background
planes)
y The other to simply join 2 tracks together to make a single
track.
-
8/8/2019 MATROSKA
35/59
EBMLELEMENTSORDERy Level 1 elements:
y Matroska only needs a few level 1 elements to beplayable: Segment Info, Track Info, Clusters.
y These elements have to be present in a Matroska file.And the Segment Info and Track Info must always be
found before the Clusters.
y Meta Seek:
y When 1 Meta Seek Head is present, it should be the first
element in a Cluster.
y In some cases there are 2 Meta Seek Head sections :
y In that case the first one is placed first with only the position of
the level 1 elements except the Clusters. The second Meta Seek is
placed at the end and contains a lengthy list of all Clusters.
-
8/8/2019 MATROSKA
36/59
y Cues (index):
y The Cues should always be written after the Clusters.
y It is much easier to put the Cues at the "end" of thesegment, once all the Clusters have been written;otherwise it's hard to predict beforehand the place to
reserve at the beginning of the segment.
y Chapters:
y Chapters could be used during playback even if the userdoesn't need to seek. It immediately gives the user theinformation of what section he's reading and/or the otheravailable sections.
y So Chapters shouldbe placed before the Clusters.
-
8/8/2019 MATROSKA
37/59
yAttachments:
y They may contain the cover art bitmaps that users may edit.
y Attachment shouldbe placed at the end of the segment.
y Tags:
y It's better for network streams if the tags are found early inthe stream.
-
8/8/2019 MATROSKA
38/59
OPTIMUM LAYOUTFROM A MUXER
-
8/8/2019 MATROSKA
39/59
SUBTITLES
yAny Matroska file containing only subtitles should usethe extension ".mks".
y
As a general rule of thumb for all codecs, informationthat is global to an entire stream should be stored inthe CodecPrivate element
y Start and stop timecodes in a timecodes native storage
format should be removed when being placed inMatroska as they could interfere, if the file is editedafterwards.
-
8/8/2019 MATROSKA
40/59
IMAGESSUBTITLES
y The requirement for muxing VobSub into matroska is v7subtitles.
y The .IFO file will not be used at all.
y If there is more than one subtitle stream in the VobSub set,each stream will need to be seperated into seperate tracksfor storage in Matroska.
y Each .BMP will be stored in its own Block. The Timestampwith be stored in the Blocks Timecode and the duration willbe stored in the Default Duration.
-
8/8/2019 MATROSKA
41/59
-
8/8/2019 MATROSKA
42/59
SSA/ASSSubtitlesy It's the file format used by the popular subtitle editor,
Sub Station Alpha.
yAll text is converted to UTF-8.
yAll the headers are stored in CodecPrivate
y Start & End field are used to set TimeStamp and theBlockDuration element.
y Events are stored in the Block in this order:ReadOrder, Layer, Style, Name, MarginL, MarginR,
MarginV, Effect, Text (Layer comes from ASS specs ...it's empty for SSA.) "ReadOrder field is needed for thedecoder to be able to reorder the streamed samples asthey were placed originally in the file."
-
8/8/2019 MATROSKA
43/59
-
8/8/2019 MATROSKA
44/59
y Live Streaming:
y Live streaming is the equivalent of TV broadcasting on theinternet.
y Matroska is not meant to be used over RTP. RTP already has
timing and channel mechanisms that would wasted ifdoubled in Matroska.
y Live streaming of Matroska over HTTP (or any other plainprotocol based on TCP) is very possible.
y A live Matroska stream is different than a file, because it mayhave no known end. So the Segment must use the "unknown"size (all 1s in the size).
y The other option would be to concatenate Segments withknown sizes one after the other.
-
8/8/2019 MATROSKA
45/59
ADVANTAGESOF MKV
y The container format MKV is superior to other containersin many ways:
*supports H.264/AVC:
which is needed for efficient HD content playback,Xvid/DivX are not suitable!!
*B-Framesupport.
*Supports variable audio bitrate.
*Supports chapters,muxed subtitles, metadata/tagsand dvd-likemenus.
-
8/8/2019 MATROSKA
46/59
AUDIOFORMATSSUPPORTED
-
8/8/2019 MATROSKA
47/59
VIDEOFORMATSSUPPORTED
-
8/8/2019 MATROSKA
48/59
-
8/8/2019 MATROSKA
49/59
-
8/8/2019 MATROSKA
50/59
-
8/8/2019 MATROSKA
51/59
-
8/8/2019 MATROSKA
52/59
-
8/8/2019 MATROSKA
53/59
-
8/8/2019 MATROSKA
54/59
-
8/8/2019 MATROSKA
55/59
-
8/8/2019 MATROSKA
56/59
-
8/8/2019 MATROSKA
57/59
-
8/8/2019 MATROSKA
58/59
LINKS
y http://www.matroska.org
y http://haali.cs.msu.ru/mkv/
y http://www.alexander-noe.com/
y http://de.wikipedia.org/wiki/Matroska
y http://www.matroska.info/
y http://ld-anime.faireal.net/guide/jargon.matroska-en
-
8/8/2019 MATROSKA
59/59