mkv格式标准文档
- 格式:pdf
- 大小:423.98 KB
- 文档页数:48
00000[转载]MKV文件格式(2009-09-16 14:24)0000分类:Unsorted0000原文地址:/CharlesPrince/archive/2009/0300001.EBML (Extensible Binary Meta Language):00000EBML语言使用不定长整数,这种方式相对于固定长度的32位/64位字长的整数值更节约空间.放置的位置也不受字节对齐约束..这种长度编码方式来自于UTF-8编码规范.00000不定长度的无符号整数值(“vint”):0000长度的计算方法:0000长度= 1 +整数前缀0比特的个数.00000使用大字节编码方式.00000可以使用大于>=8字节的整数值,这时它的第一个字节的值将会是0x00,用来表达长度超过56位的整数值.但它是被MA TROSKA Y文件禁止的.0000举个例子:000043 85 03:将它换算成二进制如下:01000011 10000101 00000011,前缀0比特的个数为1,总长度为:1 + 1 = 2,所包括的字节为:01000011 10000101,最前值为1的比特用作中止前缀0比特.它不能被用来计算整数的结果,那么最终的整数值等于:03 85(901).这样看来,1个字节表示长度最多可以有7个前缀0比特,它也是MA TROSKA文件所支持的整数最长长度.使数据所占的空间减小,这是EBML文件最大亮点.0000长度未知整数值:0000如果除了前缀0之外的比特位全部都是1的话,表示此整数的长度未知.MASTROSKA文件中除了文件头最后一个元素之外,都不要这样写.如果有的整数正好是这样的形式,要对它重编码,如:16383 = 7F FF,要把它编码成: 20 3F FF,虽然整数的长度不可避免的增加了.00000EBML元素:00000存储方式如下:0000typedef struct {0000vint ID; //Element ID00000vint size; //Element size0000char Data[size] //Element Data0000} Ebml_Element;0000包含其它元素的元素被称做:EBML Master Elements.子元素的排列顺序是任意的,但最好还是.有一种确定的定义.0000有符号整数的表示方法:0000大字节序,根据其值的正负符号来减去00或FF来得到具体的数值,如-257 = FE FF, FE FF –FFFF=257.00000实数表示方法:大字节序,可以使用32或64比特来表示IEEE标准定义的浮点数,虽然标准包括了80比特的浮点数,但MA TROSKA不使用.0000字符串类型:0000String类型用ASCII编码方式.UTF-8类型用UTF-8编码方式.00002.MA TROSKA文件项级元素:0000只有两种顶级元素:00001. EBML Header:00000用来描述文件中的内容,一个文件只能有一个EBML Header,更多的将被读取它的程序忽略掉.有的MKV生成器在添加多个文件时可能会出现这种情况.00002. Segment0000包括了多媒体数据和回放时所需要的信息头.一个文件可以包括多个信息头,但很多的库不支持多个Segment,Windows平台下可以用Haali Media Splitter来支持多Segment.00003. EBML文件头:00000描述了EBML编解码器的版本号,文件类型,文件名.00000元素列表:0000Uint EBMLV ersion ID:42 86默认值:1 EBML编码器版本号.0000Uint EBMLReadV ersion ID:42 F7默认值:1 EBML解析器版本号0000Uint EBMLMaxIDLength ID:42 F2默认值:4 EBML元素ID号的最长长度(多少字节),在MA TROSKA文件中最长为4字节.0000Uint EBMLMAXSizeLength ID:42 F3默认值:8 EBML元素最长长度(多少字节).00000Uint DocTypes ID: 42 82默认值:matroska EBML文件中的内容类型,MA TROSKA文件为”matroska”.00000Uint DocTypeV ersion ID:42 87默认值:1 EBML文件包含数据的编码器版本号.0000Uint DocTypeReadV ersion ID:42 85默认值:1 EBML文件包含数据的解析器版本号.00000由于所有的元素都包括的默认值,所以可以使用空EBML文件头.0000最好不要使ID和元素最大长度超过8字节,对于几乎所有数据来说,它已经足够了,同时对于当前流行的32/65位字长的计算机来说,它将使一次整数运算生成多条指令.00004. SegmentMaster SegmentInfo ID:15 49 A9 66包括了SEGMENT元素的信息,如UID,标题等.0000Master SeekHead ID:11 4D 9B 74指向SEGMENT子素的索引信息,可以指向其它的SeekHead,如果Cluster元素中的BlockGroup和SimpleBlock子元素在其尾部,那么可以不用SeekHead,不然的话,文件的帧数据地址定位将很复杂。
MKV可以用Media player Classic、BSplayer、ZoomPlayer播放器等,甚至包括Windows Media player 最近从网上下载了一部电影,它的扩展名是从没见过的MKV,用Media Player Classic可以播放。
播放时无意中发现它的视频竟然用的是RealVideo 9,音轨居然有二条,一条用的是AAC编码,一条是AC3编码,字幕则包括了中文、英文、日文、德文等十几种文字,甚至还有阿拉伯文:这东西太像DVD了,画质也差不多,不过体积小了很多,它究竟是什么呢?解惑——万能的多媒体容器MKV是Matroska的一种媒体文件,Matroska是一种新的多媒体封装格式,它可将多种不同编码的视频及16条以上不同格式的音频和不同语言的字幕流封装到一个Matroska Media文件当中! 多媒体封装格式也称多媒体容器(Multimedia Container),它不同于DivX、MP3这类编码格式,它只是为多媒体编码提供了一个“外壳”,常见的AVl、VOB、MPEG格式都是属于这种类型。
但这些封装格式要么结构陈旧,要么不够开放,正因为如此,才促成了Matroska这类新的多媒体封装格式的诞生。
Matroska媒体定义了三种类型的文件:MKV是视频文件,它里面可能还包含有音频和字幕;MKA是单一的音频文件,但可能有多条及多种类型的音轨;MKS 是字幕文件。
这三种文件以MKV最为常见。
注目——MKV的特性看看目前比较流行的多媒体容器类型,例如AVI,它可以容纳多种类型的视频编码和音频编码,像VP6、DivX、XviD等视频编码和PCM、MP3、AC3等音频编码;VOB 则是另一种特点更为鲜明的媒体容器,它可容纳MPEG-2视频流、多个AC3、DTS、THX、PCM音频流、多个不同语言的图形字幕流。
Matroska最大的特点就是能容纳多种不同类型编码的视频、音频及字幕流,即使是非常封闭的RealMedia及QuickTime也被它包括进去了,并将它们的音视频进行了重新组织来达到更好的效果。
mkvmerge GUI (mmg) 指南Moritz Bunkus目录1.简介1.什么是 Matroska?2.什么是 mkvmerge?什么是 mkvmerge GUI?3.获取最新版本4.本指南讲解的范围2.配置 mkvmerge GUI3.创建 Matroska 文件1.基本步骤2.轨道选项3.附件4.全局选项1.文件/剪辑标题2.自动切割与文件链接3.手动文件/剪辑链接4.章节5.全局标签5.启动混流进程6.保存与载入混流配置7.排队处理多项任务4.章节编辑器1.Matroska 的章节概念2.示例3.mkvmerge 支持的章节格式1.简单/OGM 格式章节文件2.全功能的 XML 格式章节文件3.Matroska 文件中的章节4.创建章节文件5.编辑现有章节5.头部编辑器1.添加与移除头部字段2.打开现有文件3.编辑头部字段4.检验5.保存文件1. 简介1.1. 什么是 Matroska?(注:从简单复制而来。
)Matroska力求成为多媒体容器格式的唯一标准。
它起源于一个称作 MCF 项目,但已有显著差别,因为它基于 EBML(可扩展二进制元语言), XML 的二进制衍生语言。
EBML 使得 Matroska 开发团队在未来格式可扩展性方面显示出相当的优越性,而不破坏旧解析器对文件的支持。
要了解更多信息,请移步Matroska 主页。
1.2. 什么是 mkvmerge?什么是 mkvmerge GUI?mkvmerge与mkvmerge GUI(即mmg)是由Moritz Bunkus编写的两个程序。
它们是mkvtoolnix工具包的一部分。
mkvmerge可以读取很多种多媒体文件,并将它们包含的内容存放在 Matroska 文件中。
不幸的是,这是个命令行程序,而并非所有人都能适应命令行操作。
这便是mkvmerge GUI的用武之地。
该 GUI 为用户提供既直观又强大的mkvmerge界面。
常见的文件格式与扩展名解析随着信息技术的快速发展,各类文件的使用频率逐渐增加。
对于计算机用户而言,了解并熟悉常见文件格式与扩展名是至关重要的。
本文将对常见的文件格式与扩展名进行解析,以帮助读者更好地理解和应用。
一、文本文件格式与扩展名解析1. TXT(纯文本文件):TXT是一种纯文本文件格式,通常用于存储简单的文本信息,不包含任何格式、样式和嵌入的对象。
其扩展名为.txt,可以通过各种编辑器或文本处理软件打开和编辑。
2. DOC/DOCX(Word文档):DOC是微软Word 97-2003版本的文档文件格式,扩展名为.doc;而DOCX是微软Word 2007及以上版本的文档文件格式,扩展名为.docx。
这两种格式是最常见的用于存储文字、图片、表格和其他内容的办公文档格式。
3. RTF(富文本格式):RTF是一种跨平台的文本文件格式,可以在不同操作系统和各种文本编辑器之间共享文本文件。
RTF支持丰富的文本样式和格式设置,扩展名为.rtf。
二、图像文件格式与扩展名解析1. JPEG/JPG(联合图像专家组):JPEG是一种用于压缩和存储图像的常见格式,既能保持图像质量又能减小文件大小。
其扩展名可以是.jpeg或.jpg,适用于数字相机、手机摄影以及网页上的图像显示等。
2. PNG(便携式网络图形):PNG是一种无损压缩的图像格式,适用于存储图像的优质副本。
与JPEG相比,PNG不会导致图像失真,但文件大小通常较大。
其扩展名为.png,常用于网页设计、图像编辑和图标制作等。
3. GIF(图形交换格式):GIF是一种支持动画和透明度的图像格式。
GIF文件通常较小,适用于制作简单动画、表情包和网页上的小图标等。
其扩展名为.gif。
三、音频文件格式与扩展名解析1. MP3(MPEG音频层3):MP3是一种常见的音频文件格式,通过压缩技术将音频数据压缩为较小的文件。
MP3文件通常用于存储和传输音乐、有声书以及其他形式的音频内容,扩展名为.mp3。
[其他] 【电影课堂】AVI、MKV、MPEG、DivX、HDTV、DVDrip等影片格式介绍HDTV, DivX, MPEG, DVDrip, AVI, HDTV, DivX, MPEG, DVDrip, AVIAVI、MKV、MPEG、DivX、HDTV、DVDrip等影片格式介绍AVI格式:它的英文全称为Audio Video Interleaved,即音频视频交错格式。
它于1992年被Microsoft 公司推出,随Windows3.1一起被人们所认识和熟知。
所谓“音频视频交错”,就是可以将视频和音频交织在一起进行同步播放。
这种视频格式的优点是图像质量好,可以跨多个平台使用,其缺点是体积过于庞大,而且更加糟糕的是压缩标准不统一,最普遍的现象就是高版本Windows媒体播放器播放不了采用早期编码编辑的AVI格式视频,而低版本Windows媒体播放器又播放不了采用最新编码编辑的AVI格式视频,所以我们在进行一些AVI格式的视频播放时常会出现由于视频编码问题而造成的视频不能播放或即使能够播放,但存在不能调节播放进度和播放时只有声音没有图像等一些莫名其妙的问题,如果用户在进行AVI格式的视频播放时遇到了这些问题,可以通过下载相应的解码器来解决。
MKV格式:MKV是Matroska的一种媒体文件, Matroska是一种新的多媒体封装格式,它可将多种不同编码的视频及16条以上不同格式的音频和不同语言的字幕流封装到一个Matroska Media文件当中。
多媒体封装格式,也称多媒体容器 (Multimedia Container),它不同于DivX、 MP3这类编码格式,它只是为多媒体编码提供了一个“外壳”,常见的AVl、VOB、 MPEG格式都是属于这种类型。
但这些封装格式要么结构陈旧,要么不够开放,正因为如此,才促成了Matroska这类新的多媒体封装格式的诞生。
Matroska媒体定义了三种类型的文件:MKV是视频文件,它里面可能还包含有音频和字幕;MKA是单一的音频文件,但可能有多条及多种类型的音轨;MKS是字幕文件。
Mkv格式简介:Matroska多媒体容器(Multimedia Container)是一种开放标准的自由的容器和文件格式,是一种多媒体封装格式,能够在一个文件中容纳无限数量的视频、音频、图片或字幕轨道。
所以其不是一种压缩格式,而是Matroska定义的一种多媒体容器文件。
其目标是作为一种统一格式保存常见的电影、电视节目等多媒体内容。
在概念上Matroska和其他容器,比如AVI、MP4或ASF(Advanced Sreaming Format,即高级流格式)比较类似,但其在技术规程上完全开放,在实现上包含很多开源软件。
可将多种不同编码的视频及16条以上不同格式的音频和不同语言的字幕流封装到一个Matroska 媒体文件当中。
最大的特点就是能容纳多种不同类型编码的视频、音频及字幕流。
现在的高清视频普遍采用MKV,因为MKV有个最大的好处是可以同时封装多条音轨和字幕。
mkv不同于DivX、XviD等视频编码格式,也不同于MP3、Ogg等音频编码格式。
MKV是为这些音、视频提供外壳的“组合”和“封装”格式。
换句话说就是一种容器格式,常见的 DAT(是VCD的一种编码格式)AVl、VOB、MPEG、RM 格式其实也都属于这种类型。
但它们要么结构陈旧,要么不够开放,这才促成了MKV这类新型多媒体封装格式的诞生。
Matroska的文件扩展名,对于携带了音频、字幕的视频文件是.MKV;对于3D立体影像视频是.MK3D;对于单一的纯音频文件是.MKA;对于单一的纯字幕文件是.MKS。
Matroska最大的特点就是能容纳多种不同类型编码的视频、音频及字幕流,甚至囊括了RealMedia及QuickTime这类流媒体,可以说是对传统媒体封装格式的一次大颠覆!它现在几乎变成了一个万能的媒体容器,目前它所能封装的视频、音频、字幕类型包括:AVI文件,包括采用DivX、XviD、3ivX、VP6视频编码,及PCM、MP3、AC3等音频编码的AVI。
所有的文件格式介绍文件格式是一种特定的编码方式,用于存储和传输不同类型的数据。
在计算机系统中,各种不同的文件格式被设计用于存储和呈现文本、图像、音频、视频等多媒体数据。
下面是一些常见的文件格式的介绍:1.文字文件格式:- .txt:纯文本文件,只包含文本字符,没有任何格式化属性。
- .doc/.docx:微软 Word 文档格式,支持排版、字体设置、图表等功能。
- .pdf:便携式文档格式,可跨平台阅读和打印文档,保留文档原始格式。
2.图像文件格式:- .jpg/.jpeg:常见的有损压缩格式,适用于照片和图像。
- .png:无损压缩格式,支持透明度,适用于图像和图标。
- .gif:支持动画和透明度的格式,通常用于简单的动画效果。
3.音频文件格式:- .mp3:最常见的有损压缩音频格式,平衡了音质和文件大小。
- .wav:无损音频格式,保留了音频的原始质量,文件较大。
- .flac:无损音频格式,压缩效率高,音质无损。
4.视频文件格式:- .mp4:最常见的视频格式,支持高压缩比和高质量的音视频。
- .mkv:开放式多媒体容器格式,支持多种编码和多个音频、字幕轨道。
- .avi:最早的视频格式之一,现在仍然广泛使用。
5.压缩文件格式:- .zip:常见的文件压缩格式,可以将多个文件和文件夹打包成一个文件。
- .rar:高压缩比的压缩格式,支持分卷和密码保护功能。
-.7z:非常高的压缩比和较快的解压速度,适用于大文件压缩。
6.数据库文件格式:- .xls/.xlsx:微软 Excel 文件格式,用于存储和分析表格数据。
- .csv:逗号分隔的值文件格式,常用于存储和交换数据。
- .sql:结构化查询语言文件格式,用于数据库的创建、查询和修改。
7.电子书文件格式:- .epub:开放式电子书格式,适用于多种设备和阅读器。
- .mobi:亚马逊 Kindle 电子书格式,适用于 Kindle 设备和阅读器。
了解常见的文件格式及其应用文件格式是指不同类型的文件根据其特点和用途进行分类和区分的方式。
在日常生活和工作中,我们常常会遇到各种各样的文件格式,例如文档、图片、音频、视频等。
熟悉常见的文件格式及其应用,可以帮助我们更好地进行文件管理和使用。
一、文档格式1. Word文档(.doc/.docx):是最常见的文档格式之一,由微软公司开发。
Word文档具有较高的兼容性,适用于各种文字处理任务,例如写作、编辑、排版等。
2. PDF(Portable Document Format):PDF是一种通用的文件格式,由Adobe公司开发。
PDF文件可以跨平台打开和查看,保留了原始文档的样式和格式,适用于电子书籍、宣传资料、报告等。
3. TXT(纯文本文件):TXT文件是最简单的文本文件,不包含任何格式和样式。
常用于存储纯文本内容,例如编程代码、日志记录等。
二、图像格式1. JPEG(.jpg/.jpeg):JPEG是一种广泛使用的图像压缩格式,适用于照片、图像存档等。
它可以在保持较高质量的同时,实现较小的文件大小。
2. PNG(Portable Network Graphics):PNG是一种无损图像格式,适用于需要保留图像细节和透明背景的场景,常用于网页设计、图标等。
3. GIF(Graphics Interchange Format):GIF是一种支持动态图像的格式,常用于表情包、动图和简单的动画制作。
三、音频格式1. MP3(MPEG Audio Layer III):MP3是一种流行的音频压缩格式,常用于存储和传输音乐、音频文件。
它能够实现较小的文件大小,同时保持较高的音质。
2. WAV(Waveform Audio File Format):WAV是一种无损音频格式,常用于音乐制作和音频编辑。
WAV文件保留了音频的原始质量,文件较大。
四、视频格式1. MP4(MPEG-4 Part 14):MP4是一种常用的视频格式,支持高质量的视频和音频压缩。
高清电影mkv格式内容srtpar2nfo解释2009年12月06日星期日 19:53一、什么是MKV?如果对OGM这个格式不是很熟悉的话,自然也就不会怎么知道MKV了。
首先澄清一个误区,MKV不是一种压缩格式,DivX、XviD才是视频压缩格式,MP3、OGG才是音频压缩格式。
MKV是个“组合”和“封装”的格式,换句话说就是一种容器格式。
举个例子的话就比较容易理解了,把只有视频的XviD和只有音频的MP3组合起来,然后以一种多媒体介质的形式出现,最常见的就是***I,其次就是OGM,还有MP4等不太常见的。
二、什么是srt?文本格式字幕:比较流行的文本字幕有srt、smi、ssa,因为是文本格式,所以就比较小了,一般大不过百来k。
其中srt文本字幕最为流行,因为其制作规范简单,一句时间代码+一句字幕,使得制作修改就相当简单。
配合上.style文件还能让srt自带一些字体上的特效等。
几种文本字幕可以互相转换。
文本字幕一般通过对图形字幕进行OCR 或者手工制作生成,OCR英文字幕不难,毕竟英文识别难度小嘛,OCR中文难度就大一些,所用的软件个头也不小(SubOCR,30多MB)。
三、什么是par2?par2文件为Quickpar效验修复用的,如发现传输有误可以直接修复HDTV下载文件中常常会包含一些后缀名为“par2”的文件,这些文件是用来干嘛的呢?简单来说par2文件是用来校验文件完整性和修复不完整文件的。
由于BT下载的机制,在下载的过程中有时会造成文件出错,最直接的体现就是播放时有马赛克,有时BT下载会卡在99%,这些都可以用par2文件解决问题。
par2文件的原理是先计算文件的hash值,然后与par2文件中记录的源文件hash值进行比较,如果一致则不做恢复,如果不一致则利用恢复块进行恢复。
当然,par2文件的恢复能力也是有限的,这跟制作par2文件时设置的冗余度有关(冗余度越大,恢复能力越强,对应的par2文件越大),S**的片子一般设置在1%。
多媒体文件格式多媒体文件格式1. 什么是多媒体文件格式多媒体文件格式是指用于存储和传输多媒体数据的文件格式。
多媒体文件包括音频文件、视频文件和图像文件。
不同的多媒体文件格式可以用于不同的应用场景和设备。
常见的多媒体文件格式有MP3、MPEG、AVI、JPEG等。
2. 音频文件格式2.1 MP3MP3(MPEG Audio Layer-3)是一种流行的音频文件格式。
它通过压缩音频数据来减小文件的大小,而不会严重损失音质。
MP3文件可以在各种音频播放器和设备上播放。
2.2 WAVWAV(Waveform Audio )是一种无损音频文件格式。
它通常用于存储高质量的音频数据。
WAV文件的大小比较大,因为它不进行音频数据的压缩。
2.3 FLACFLAC(Free Lossless Audio c)是一种无损音频压缩格式。
它能够以较小的文件尺寸存储高质量的音频数据。
FLAC文件可以在多种音频播放器上播放。
3. 视频文件格式3.1 MPEGMPEG(Moving Picture Experts Group)是一种常见的视频文件格式。
它可以压缩视频数据,以实现较小的文件尺寸。
MPEG文件可以在电视、计算机和移动设备上播放。
3.2 AVIAVI(Audio Video Interleave)是一种通用的视频文件格式。
它可以包含多种编码方式的视频和音频数据。
AVI文件可以在各种视频播放器上播放。
3.3 MP4MP4(MPEG-4 Part 14)是一种流行的视频文件格式。
它能够压缩视频和音频数据,并在较小的文件尺寸中保持高质量。
MP4文件适用于互联网传输和各种设备的播放。
4. 图像文件格式4.1 JPEGJPEG(Joint Photographic Experts Group)是一种常见的图像文件格式。
它通过压缩图像数据来减小文件尺寸,但会导致一定程度的图像质量损失。
JPEG文件适用于存储和传输照片和其他图像。
列举常见的五种文件类型及说明在计算机世界中,文件是存储数据的基本单位。
不同的文件类型适用于不同种类的数据和用途。
下面将列举五种常见的文件类型及其说明。
1.文本文件(.txt):文本文件是存储纯文本内容的文件类型。
它只包含字符,没有特定格式、图像或音频等附加信息。
文本文件通常用于存储普通的文本信息,如代码、笔记、文档等。
它可以通过任何文本编辑器进行查看和编辑,是最简单和常见的文件类型之一。
文本文件的特点是体积小、可读性强、易于传输和分享。
2.图像文件(.jpg、.png、.bmp等):图像文件是存储图像数据的文件类型。
它们包含了像素值和颜色信息,用于呈现图像。
常见的图像文件格式包括JPEG(.jpg)、PNG (.png)、BMP(.bmp)等。
JPEG是一种有损压缩格式,适用于存储照片等大量颜色变化的图像;PNG是一种无损压缩格式,适用于存储透明背景或图标等图像;BMP是一种无压缩格式,适用于存储位图图像。
图像文件通常由图像编辑软件创建和处理,可以用于网页设计、印刷媒体等。
3.音频文件(.mp3、.wav、.flac等):音频文件是存储声音和音乐数据的文件类型。
它们包含了声波信号的数字表示,用于播放声音。
常见的音频文件格式包括MP3(.mp3)、WAV(.wav)、FLAC(.flac)等。
MP3是一种有损压缩格式,适用于存储音乐和语音等音频;WAV是一种无压缩格式,保留了音频的无损质量,适用于音频编辑和专业录音;FLAC是一种无损压缩格式,保留了高音质的同时减小了文件大小。
音频文件通常由音频编辑软件或录音软件创建和处理,可以用于音乐播放、录音等。
4.视频文件(.mp4、.avi、.mkv等):视频文件是存储影像数据的文件类型。
它们包含了连续帧的图像和音频数据,用于播放运动图像。
常见的视频文件格式包括MP4(.mp4)、AVI(.avi)、MKV(.mkv)等。
MP4是一种基于H.264的压缩格式,适用于存储网络视频和电影;AVI是一种多媒体容器格式,支持不同的视频和音频编码;MKV是一种开放标准的多媒体容器格式,支持高分辨率和多种编码。
多媒体文件格式多媒体文件格式是用于存储、传输和呈现各种类型多媒体内容的文件格式。
多媒体文件可以包括音频、视频、图像和文本等多种形式的数据。
本文将介绍一些常见的多媒体文件格式,以及它们的特点和用途。
一、音频文件格式1·MP3格式MP3是一种常用的音频压缩格式,它能够在保持较高音质的同时,将音频文件的大小大大减小。
MP3格式广泛应用于音乐播放和存储设备中。
2·WAV格式WAV是一种无损的音频文件格式,它能够保持较高的音质,但文件大小较大。
WAV格式通常用于专业音频处理和录制过程中。
3·FLAC格式FLAC是一种无损的音频文件格式,它能够保持原始音质,同时将文件大小大大减小。
FLAC格式适用于对音质要求高的应用场合,如音乐制作和无损音乐存储。
二、视频文件格式1·AVI格式AVI是一种常见的视频文件格式,它可以包含多种编码和压缩方式。
AVI格式适用于在计算机和各种播放设备上播放和编辑视频。
2·MP4格式MP4是一种常用的视频文件格式,它采用较高的压缩比,能够在保持较好画质的同时,减小文件大小。
MP4格式广泛应用于在线视频播放和移动设备上。
3·MKV格式MKV是一种开放、通用的多媒体容器格式,可以包含多种音频、视频和字幕等文件。
MKV格式适用于存储高清视频和特殊功能的需要。
三、图像文件格式1·JPEG格式JPEG是一种常用的图像文件格式,它采用有损压缩方法,能够在减小文件大小的同时,保持较好的图像质量。
JPEG格式广泛应用于数字照片和网络图片。
2·PNG格式PNG是一种无损压缩的图像文件格式,它能够保持图像的细节和透明效果。
PNG格式适用于需要保持图像质量和透明背景的应用场合。
3·GIF格式GIF是一种支持动画和透明效果的图像文件格式,它能够将多张图像合并成一个文件进行播放。
GIF格式适用于制作简单动画和图标等应用。
视频格式mkv、mp4、avi、flv、mov、wmv、webm特点和区别mkv是⼀种多媒体封装格式,这个封装格式可把多种不同编码的影像及 16 条或以上不同格式的⾳频和语⾔不同的字幕封装到⼀个 Matroska Media 档内。
它也是其中⼀种开放原始码的多媒体封装格式。
很多⼈把 Matroska 称作 mkv,其实 mkv 只是 Matroska 媒体系列的其中⼀种档案格式。
Matroska 最⼤的特点是能容纳多种不同类型编码的视频、⾳频及字幕流,俗称万能媒体容器。
Matroska媒体定义了三种类型的档,以 MKV 最为常见。
MKV(Matroska Video File):视讯档,可以包含⾳讯和字幕;MKA(Matroska Audio File):单⼀的⾳讯档,可以有多条及多种类型的⾳轨;MKS (Matroska Subtitles):字幕⽂件。
MKV 加⼊ AVI 所没有的 EDC 错误检测代码,这意味着即使是没有下载完毕的 MKV ⽂件也可以顺利回放,这些对AVI来说完全是不可想象的。
虽然 MKV 加⼊了错误检测代码,但由于采⽤了新的更⾼效的组织结构,⽤ MKV 封装后的电影还是⽐ AVI 源⽂件要⼩了约1%,这就是说即使加上了多个字幕,MKV⽂件的体积也不可能⽐ AVI ⽂件⼤。
MKV ⽀持可变帧率,它可在动态画⾯中使⽤较⼤的帧率,⽽在静态画⾯中使⽤较⼩的帧率,这样可以有效的减少视频⽂件的体积,并改善动态画⾯的质量。
它的作⽤⽐⽬前⼴泛使⽤的 VBR(可变码率)更为明显。
mp4MP4 是⼀套⽤于⾳频、视频信息的压缩编码标准,由国际标准化组织(ISO)和国际电⼯委员会(IEC)下属的“动态图像专家组”(Moving Picture Experts Group,即MPEG)制定,MPEG-4 格式的主要⽤途在于⽹络流、光盘、语⾳视频电话,以及电视⼴播。
MPEG 组织⽐较成功的标准有 MPEG-1、MPEG-2、MPEG-3 等。
MKV详细图文教程用完美解码打开片源,右击媒体信息,点击复制选项,然后粘贴到TXT文本上,方便自己查看片源信息。
MKV片源,有视频轨、音频轨、字幕,要对其分离,这就要分离器,分离之后播放器会调用解码器,有音频解码器、视频解码器。
这样的话我们先对这样分离器解码器进行设置,保证他们是用我们所设的解码器来解。
操作:打开完美解码设置H.264解码器也就是x264 设置为ffdshowMKV分离器设置为Haali分离器字幕插件vobsub2.39设置完后点应用,然后确定。
打开编码器分析(GraphEdit)X:\完美解码\Pure Codec\Codecs,打开后把片源拖进去,删除后另存为片源名字.720p.grf,做这个是渲染用的。
删除的是音频解码器的渲染,不需要,我们只需要视频解码器的渲染。
下面写脚本,建立一个txt文档,改后缀.txt为.avs,加黑边AVS代码:DirectshowSource("E:\SCG\片源名字.720p.grf", fps=23.976, audio=false, convertfps=true) addborders(0,68,0,70)ConvertToYV12()把代码粘贴到avs文件中,关于代码,也就是avs脚本。
DirectshowSource()这句是用DirectshowSource插件打开那个片源,片源路径用引号引起来。
addborders(0,68,0,70)这个是加黑边,关于黑边计算,例:片源分辨率为 1280*582片源信息里面有。
公式:[720-582=138]の[138/2=69]の[69-1=68]の[69+1=70]要求上下高度是720像素切黑边AVS代码:DirectshowSource("E:\计划\片源名字.720p.grf", fps=23.976, audio=false, convertfps=true) crop( 0, 140, 0, -140)LanczosResize(1280,534) # Lanczos (Sharp)ConvertToYV12()ConvertToYV12()一般都加上,具体不是很清楚然后打开megui,文件格式改为mkv 不用mp4下面进行x264参数设置,打开confog进行设置勾上改为Auto2pass改为film选择very slow 最后设置完毕:然后点开Frame-tvpe改为8Rate Control 这个不设置然后点开Analvsis这里改为7勾上这两项Psy-Trellis Strength 这个改为0.15完成设置后:然后点开Misc改为4.1 然后点OK,设置完毕。
了解电脑中常见的像文件格式及其特点电脑中常见的文件格式及其特点在电脑中,我们常常会遇到各种不同的文件格式。
不同的文件格式有着各自的特点和用途,了解这些文件格式对我们使用电脑进行工作和娱乐是非常有帮助的。
本文将介绍一些常见的电脑文件格式及其特点。
一、文本文件格式1. txt格式:txt是文本文件的一种常见格式,它只包含纯文本内容,没有任何格式和样式。
txt文件通常以ASCII码编码保存,可以被几乎任何文本编辑器打开和编辑。
由于其简单的格式,txt文件非常适合用于存储和传输纯文本信息。
2. docx格式:docx是微软Word文档的默认保存格式。
与txt不同,docx文件可以包含丰富的格式、样式和图像。
docx文件具备多种编辑和排版功能,适用于编写各类文档,如报告、论文和简历等。
同时,docx文件也可以在不同电脑和操作系统之间交互使用。
3. pdf格式:pdf是一种增强型的文档格式,它可以跨平台、跨设备保持文档的格式一致性。
pdf文件完全保留了原始文档的布局和格式,不会因为不同的操作系统或软件而发生改变。
另外,pdf文件可以添加安全性设置,防止未经授权的修改和复制。
二、图像文件格式1. jpg/jpeg格式:jpg是一种广泛使用的图像文件格式,它采用有损压缩技术,可以在较小的文件大小下保存高质量的图像。
jpg文件适用于存储照片和其他图像,可以在电脑、手机和网络上方便地进行显示和传输。
2. png格式:png是一种无损压缩的图像文件格式,它可以保存更多的图像细节和透明度信息。
相比于jpg,png文件的文件大小较大,但图像质量更高。
由于透明度的支持,png文件常用于设计、网页制作和图标等领域。
3. gif格式:gif是一种支持动画效果的图像文件格式,它采用简单的压缩算法,可以保存多帧图像并循环播放。
gif文件通常用于表情包、简单动画和网页上的小图标等方面。
三、音频文件格式1. mp3格式:mp3是一种广泛应用于音频播放和传输的格式,它采用有损压缩技术,可以在较小的文件大小下保留高音质。
视频格式说明书模板一、产品概述视频格式说明书是为了帮助用户了解和正确使用视频格式工具而编写的,本说明书将详细介绍视频格式的定义、特点、常用格式以及其使用方法。
二、视频格式定义1. 视频格式是指用来储存和传输视频数据的文件格式。
根据不同的编码方式和压缩算法,视频格式可以有多种类型。
2. 视频格式决定了视频文件的编码方式、分辨率、帧率以及音频等相关参数。
三、视频格式特点1. 不同的视频格式对视频数据进行不同的压缩和编码处理,以减小视频文件的大小并保证画质的同时节省带宽。
2. 视频格式可以通过不同的解码器来解码,以适应不同硬件和软件平台上的播放需求。
3. 视频格式的选择和使用可以根据具体应用场景的需要,平衡视频文件大小、画质和播放设备的兼容性。
四、常见视频格式1. AVI格式- 定义:Audio Video Interleave,是由微软公司开发的音视频容器格式,支持多种视频编码和音频编码格式。
- 特点:广泛兼容,但文件大小较大。
- 使用方法:一般用于本地播放。
2. MP4格式- 定义:MPEG-4 Part 14,是一种常见的视频编码容器格式。
- 特点:较小的文件大小,广泛兼容性,对流媒体的支持较好。
- 使用方法:常用于网络视频的传输和播放。
3. MKV格式- 定义:Matroska,是一种开放标准的多媒体容器格式。
- 特点:支持多种视频和音频编码格式,提供更多的扩展功能。
- 使用方法:适用于高清视频的存储和播放。
4. MOV格式- 定义:QuickTime File Format,是由苹果公司开发的一种文件格式。
- 特点:较好的跨平台兼容性,广泛应用于电影制作和视频编辑领域。
- 使用方法:适用于苹果设备的应用和多媒体制作领域。
五、视频格式选择与使用1. 考虑需求:根据实际需求,选择适合的视频格式,平衡文件大小、画质和兼容性等因素。
2. 兼容性:根据播放设备的支持情况选择合适的视频格式,以确保视频可以正常播放。
常见的多媒体数据文件格式多媒体数据文件格式是指包含图像、音频、视频等多种媒体内容的文件格式。
这些文件格式使用不同的编码方式和容器格式来存储和传输多媒体数据。
在本文档中,我们将介绍一些常见的多媒体数据文件格式,并对其进行详细说明。
一、图像文件格式1-JPEG(Joint Photographic Experts Group):一种常用的图像压缩格式,可在保持较高图像质量的同时减小文件大小。
2-PNG(Portable Network Graphics):一种无损的图像压缩格式,支持透明背景,适用于网络图像传输和图像编辑。
3-GIF(Graphics Interchange Format):一种支持动画的图像格式,使用有限的颜色表达图像,适用于简单动画的显示。
4-BMP(Bitmap):一种无压缩的图像格式,保存的是像素的原始数据,文件较大,一般用于存储位图。
二、音频文件格式1-MP3(MPEG Audio Layer III):一种常用的音频压缩格式,能够在保持较高音质的同时减小文件大小。
2-WAV(Waveform Audio ):一种无压缩的音频格式,保存的是音频的原始数据,文件较大,音质较好。
3-FLAC(Free Lossless Audio Codec):一种无损的音频压缩格式,可以压缩音频文件大小,但保持音质不损失。
4-AAC(Advanced Audio Coding):一种高级音频编码格式,支持较高的音频质量和较小的文件大小。
三、视频文件格式1-MP4(MPEG-4 Part 14):一种常用的视频文件格式,支持视频、音频和字幕等多种媒体内容的存储和传输。
2-AVI(Audio Video Interleaved):一种多媒体容器格式,支持多种编码方式的音视频数据。
3-MKV(Matroska Video):一种开放的多媒体容器格式,支持多种编码方式的音视频数据,并且具有较强的扩展性。
Matroska File Format(under construction!)Alexander Noéalex@Last change:January11,2009Contents1Introduction42EBML-basics62.1Unsigned Integer Values of Variable Length(”vint“) (6)2.2EBML elements (7)2.3Signed Integer Values of Variable Length(svint) (7)2.4Data Types (8)3M ATROSKAfiles-Top-Level elements93.1EBML (9)3.2Segment (9)4EBML-The EBMLfile header105Level1-Elements inside Segments125.1Overview (12)5.2SegmentInfo (13)5.3SeekHead (16)5.4Tracks (18)5.5Cluster (27)5.6Cues (29)5.7Chapters-Editions and ChapterAtoms (31)5.8Attachments (35)5.9Tags (36)16M ATROSKA block Layout and Lacing396.1Basic layout of a Block (39)6.2Lacing (40)7Overhead of M ATROSKAfiles417.1Overhead of B LOCK G ROUPS (41)7.2Overhead of C LUSTER s (46)7.3Overhead caused by Cues (47)8Links48 List of Tables1EBML (10)2Segment (12)3SegmentInfo (14)4SeekHead (16)5Seek (16)6Tracks (18)7TrackEntry (18)8Video (21)9Audio (22)10ContentEncodings (23)11ContentEncoding (23)12ContentCompression (24)16Cluster (27)17BlockGroup (28)18Cues (29)19CuePoint (30)20CueTrackPositions (30)21Chapters (31)22EditionEntry (31)23ChapterAtom (32)224ChapterTracks (34)25ChapterDisplay (34)26Attachments (35)27AttachedFile (35)28Tags (36)29Tag (37)30Targets (37)31SimpleTag (38)31IntroductionThis document is intended to be used by developers who want to implement sup-port for the M ATROSKAfile format in their applications,but who want to build this support from scratch rather than using existing implementations,or people who just want to understand the M ATROSKAfile format in detail.Thus,thefile format itself is described,the usage of existing libraries isn’t.This document does not replace the official documentation1.It is less condensed, but not necessarily complete.Especially,in the case that M ATROSKA supports Dig-ital Restrictions Management one day,I will expressively not document that part. Also,typos in element IDs are never impossible.When speaking about element occurence,elements can be mandatory or not,ele-ments may be present several times inside a parent element or not etc.Occurence restrictions will be indicated using expressions like=1or≥1etc.Those re-strictions will exclude cases which do not technically render afile unusable or ambigous,but which are unreasonable,like afile with no S EGMENT UID,see sec-tion5.2.The same way it would be weird(but not make afile unusable)to have a C HAPTERS element(which is supposed to describes chapters)which is empty.An element that must occur at least once is a reasonablefile is called“mandatory”. When an element is really mandatory,i.e thefile or a part of it is useless when it’s missing,it will be labeled as≥1(!)or=1(!).An example would be the codec ID of a track,without which a track cannot be decoded at all.The official Matroska specification pages use the following interpretation of“manda-tory”and“default”:When an element has a default value that is used if the ele-ment itself is not present,the value cannot be missing,thus the element is inher-ently mandatory.This interpretation of“mandatory”being weird,this document considers an element mandatory when it must be physically present in thefile. Also,default values can only be valid values.Consequently,a mandatory element cannot have a default value because if it had one,it couldn’t be mandatory any-more.In this document,element names are always printed like T HIS,element values are printed like$T HIS,as in“if$T HIS F LAG=1,...”.If you have any questions concerning this document,if you have comments,addi-tions,if you have found an error,or if you want to contact me for whatever reason, 1/technical/specs/index.html4please send me an e-mail(include’matroska’in the topic!).You can contact me in german,english or french,whatever you prefer.Just don’t ask me if you can ask something or if I could document some Digital Restrictions Management.This document is powered by LaTeX,so changing the order of certain tables or the style of those tables etc.is,with certain limits,possible within a few seconds. Screenshots of real lifefile structures are used to illustrate thefile structure.All of them have been made using the EBML Tree Viewer in AVI-Mux GUI.52EBML-basicsEBMLfiles use integers of variable size.This way,thefile format doesn’t waste space with storing32or even64bit integers in placed where they might sometimes occur.The way the size is coded is inspired by the UTF-8encoding format.2.1Unsigned Integer Values of Variable Length(”vint“)The length of an integer is equivalent to length=1+[number_of_leading_zero_bits]. All integers use big endian.You could use more than7leading zeros,then thefirst byte would be0x00,however,this would only be needed if integers longer than56bits are required.This is forbidden in M ATROSKAfiles.Example:3A41FE:Thefirst byte3A(00111010)has2leading zeros,resulting in a total length of3 bytes.Thefirst‘1’in the byte(00111010)is just needed tofinish the sequence of leading zeros and can’t be used to store the value either.Thus,it is reset to obtain the value this byte sequence represents.The result is then0X1A41FE.As you can see,you lose one bit per byte to know how long a number is,and you can use7 bits per byte to store the integer’s value itself.Of course,the value0x1A41FE could also be written as101A41FE or08001A41FE(do the decoding on a piece of paper if it’s not clear),however,when writing EBMLfiles,the shortest possible encoding should be used to avoid wasting space, which is the very point of this coding scheme.Unknown LengthAll bits after the leading zeros being set to one,such as FF or7F FF,indicates an unknown length.Muxers shall avoid writing unknown length values whenever possible.The only exception is the last Level0element of afile.If encoding a number as described above results in such a sequence,it must be encoded again with a greater destination length.Example:When encoding16383as described above,the result is7F FF.In7F FF,all bits after the leading zero are set,which would indicate an unknown length.That means,the length is increased to3,and the number is encoded again to203F FF.NoteIt is possible to use a lookup table to determine the total length from thefirst byte.6The Matroskafile format does not allow integer lengths greater than8,meaning that the number of leading zeros is not higher than7and that the total length can always be retrieved from thefirst byte.2.2EBML elementsOne piece of information is stored the following way:typedef struct{vint ID//EBML-IDvint size//size of elementchar[size]data//data}EBML_ELEMENT;The length of ID shall be called s_ID,the length of size shall be called s_size. Elements that contain other EBML Elements are called EBML Master elements. Generally,the order of EBML elements inside a parent element is notfixed.In some cases,a certain order is recommended,but it is never mandatory.Especially, no element order should be assumed inside small parent elements.2.3Signed Integer Values of Variable Length(svint)Signed integers have the following value:Read the integer as Unsigned Integer and then subtractvsint_subtr[length-1]where__int64vsint_subtr[]={0x3F,0x1FFF,0x0FFFFF,0x07FFFFFF,0x03FFFFFFFF,0x01FFFFFFFFFF,0x00FFFFFFFFFFFF,0x007FFFFFFFFFFFFF};72.4Data TypesWhereas vint s are used in the header section of EBML elements,the data types describes in this section occur in the data section.2.4.1Signed and Unsigned Integers(int and uint)Integers,signed as well as unsigned,are stored in big endian byte order,with leading0x00(in case of positive values)and0xFF(in case of negative values) being cut off(example for int:-257is0xFE0xFF).An int/uint may not be larger than8bytes.2.4.2FloatA Float value is a32or64bit real number,as defined in IEEE.80Bit values have been in the specification,but have been removed and should not be used.The bytes are stored in big endian order.2.4.3Types of StringsString refers to an ASCII string.UTF-8refers to a string that is encoded as UTF-883M ATROSKAfiles-Top-Level elementsM ATROSKAfiles only have two different top level elements:3.1EBMLThis header describes the contents of an EBMLfile.There should be only one EBML header in onefile.Any further EBML headers do not render afile invalid, but shall be ignored by any application reading thefile.Files with more than one EBML header could be created for instance if two or morefiles are appended by using the copy/b command.3.2SegmentA S EGMENT contains multimedia data,as well as any header data necessary for re-play.There can be several S EGMENT s in one M ATROSKAfile,but this is not encour-aged to be done,as not many tools are able to handle multisegment M ATROSKA files correctly.If you want to replay multisegment M ATROSKAfiles on Windows, please use Haali Media splitter22http://haali.cs.msu.ru/mkv/94EBML-The EBMLfile headerThe EBML top level element contains a description of thefile type,such as EBML version,file type name,file type versionetc.Obviously,this header being missing makes it necessary to guess thefile type.Table1:The EBML element(Top-Level)Element Descriptionuint,#≤1 EBMLV ERSION ID:4286 def:1indicates the version of the EBML Writer that has been used to create afileuint,#≤1 EBMLR EAD V ERSION ID:42F7def:1indicates the minimum version an EBML parser needs to be compliant with to be able to read thefileuint,#≤1EBMLM AX IDL ENGTH ID:42F2def:4indicates the length of the longest EBML-ID thefile contains. In case of matroska,this value is4.Any EBML-ID which is longer than the value of this element shall be considered invalid.uint,#≤1EBMLM AX S IZE L ENGTH ID:42F3def:8indicates the maximum s_size value thefile contains.Any EBML element having an s_size value greater than EBML-MaxSizeLength shouldl be considered invalid.EBML continued on next page10Element Descriptionstring,#≤1 D OC T YPE ID:4282 def:matroska describes the contents of thefile.In the case of a M ATROSKA file,its value is'matroska'uint,#≤1D OC T YPE V ERSION ID:4287def:1indicates the version of the$D OC T YPE writer used to create thefileuint,#≤1D OC T YPE R EAD V ERSION ID:4285def:1indicates the minimum version number a$D OC T YPE parser must be compliant with to read thefile.Index→page2end of EBML As you can see,in the case of Matroskafiles all child elements of the EBML el-ement have a default value.Thus,an empty EBML element would technically introduce a Matroskafile(withfile type version1,maximum ID length4,max-imum size length8etc.)correctly.However,I don’t recommend to push the specifications like this.It is not recommended to use either IDs or size values greater than8bytes.While it’s clear that8bytes are enough to represent any size of anything on any hard disc,one might think about using IDs larger than8bytes.However,since the ID is considered an integer,treating IDs larger than8bytes is difficult on current CPUs, which are limited to64bit for simple integer operations.115Level1-Elements inside Segments 5.1OverviewTable2:The S EGMENT element(Top-Level) Element DescriptionMaster,#=1S EGMENT I NFO(→3) ID:1549A966S EGMENT I NFO contains general information about a seg-ment,like an UID,a title etc.This information is not really required for playback,but should be there(→section5.2).Master,#≥0S EEK H EAD(→4) ID:114D9B74A S EEK H EAD is an index of elements that are children of S EGMENT.It can point to other S EEK H EAD s,but not to itself. If all non-C LUSTER precede all C LUSTER s(→section5.5), a S EEK H EAD is not really necessary,otherwise,a missing S EEK H EAD leads to longfile loading times or the inability to access certain data.Master,#≥0C LUSTER(→16) ID:1F43B675A C LUSTER contains video,audio and subtitle data.Note that a M ATROSKAfile could contain chapter data or attach-ments,but no multimedia data,so C LUSTER is not a manda-tory element.S EGMENT continued on next page12Element DescriptionMaster,#≥0T RACKS(→6) ID:1654AE6B A T RACKS element contains the description of some or all tracks(preferably all).This element can be repeated once in a while for backup purposes.Afile containing only chapters and attachments does not have a T RACKS element,thus it’s not mandatory.Master,#≤1C UES(→18) ID:1C53BB6B The C UES element contains a timestamp-wise index to C LUSTER s,thus it’s helpful for easy and quick seeking.Master,#≤1A TTACHMENTS(→26) ID:1941A469The A TTACHMENTS element contains allfiles attached to this S EGMENT.Master,#=1C HAPTERS(→21) ID:1043A770The C HAPTERS elements contains the definition of all chap-ters and editions of this S EGMENTMaster,#≤1T AGS(→28) ID:1254C367The T AGS element contains further information about the S EGMENT or elements inside the S EGMENT that is not really required for playback.Index→page2end of S EGMENT5.2SegmentInfoThe S EGMENT I NFO element contains general information about the S EGMENT, such as its duration,the application used for writing thefile,date of creation,a unique128bit ID,to name a few rmation included in the S EGMENT I NFO element is not required for playback,but should be written by any M ATROSKA muxer.13(read:<element name>(<s_size+s_ID>:<size>bytes at<position infile>:value)Table3:The S EGMENT I NFO element,child of S EGMENT(→2) Element Descriptionchar[16],#=1 S EGMENT UID ID:73A4a unique128bit number identifying a S EGMENT.Obviously, afile can only be referred to by anotherfile if a S EGMEN-T UID is present,however,playback is possible without that UID.utf-8,#≤1S EGMENT F ILENAME ID:7384contains the name of thefile the S EGMENT is stored in.Since renamingfiles is easy,the reliability of this element’s value should not be overrated.char[16],#≤1 P REV UIDID:3C B923contains the unique128bit ID of the S EGMENT that is re-played before the currently active S EGMENT,i.e.the ID of the S EGMENT that should be loaded if the user tries to seek to a timecode earlier than the earliest timecode of the ac-tive S EGMENT.That SEGMENT should,of course,be easy to locate,for instance in afile in the same directory.utf-8,#≤1P REV F ILENAME ID:3C83AB contains the name of thefile in which the S EGMENT having the ID$P REV UID is stored.P REV F ILENAME should not be considered reliable for the same reason as S EGMENT F ILE-NAME,however,it could be thefirstfilename the player is looking for when the SEGMENT described in P REV UID is neededS EGMENT I NFO continued on next page14Element Descriptionchar[16],#≤1 N EXT UIDID:3E B923contains the unique128bit ID of the S EGMENT that is re-played after the currently active S EGMENT,i.e.the ID of the S EGMENT that should be loaded if the user tries to seek to a timecode after the end of the active S EGMENT.Like P RE-V UID,the corresponding S EGMENT should be easy to locate.utf-8,#≤1N EXT F ILENAME ID:3E83BB contains the name of thefile in which the S EGMENT having the ID$N EXT UID is stored.N EXT F ILENAME shall not be considered reliable for the same reason as S EGMENT F ILE-NAME.uint,#≤1T IMECODE S CALE ID:2A D7B1Each scaled timecode in a M ATROSKAfile is multiplied by T IMECODE S CALE to obtain a timecode in nanoseconds.Note that not all timecodes are scaled!float,#≤1 D URATION ID:4489The D URATION indicates the duration of the S EGMENT.The duration measured in nanoseconds is scaled and is thus equal to$D URATION*$T IMECODE S CALE.This element should be written.utf-8,#≤1 T ITLEID:7B A9Contains a general name of the S EGMENT,like Lord of the Rings-The Two Towers .No language can be at-tached to the title,however,Tags(→section5.9)could be used to define several titles for a segment.This is not yet commonly done,though.string,#=1 M UXING A PP ID:4D80contains the name of the library that has been used to create thefile(like”libmatroska0.7.0“).This element should be written by any muxer!Especially if non-compliantfiles are encountered,this help to know who must be blamed for that file.utf-8,#=1 W RITING A PP ID:5741contains the name of the application used to create thefile (like”mkvmerge0.8.1“).This element should be written for the same reason as M UXING A PP.int,#≤1 D ATE UTC ID:4461contains the production date,measured in nanoseconds rel-atively to Jan01,2001,0:00:00GMT+0hIndex→page2end of S EGMENT I NFO155.3SeekHeadThe S EEK H EAD element contains a list of positions of Level1elements in the S EGMENT.Each pair(element id,position)is stored in one S EEK element: Table4:The S EEK H EAD element,child of S EGMENT(→2) Element DescriptionMaster,#≥1 S EEK(→5) ID:4D BB One S EEK element contains an EBML-ID and the position within the S EGMENT at which an element with this ID can be found.Index→page2end of S EEK H EAD Table5:The S EEK element,child of S EEK H EAD(→4) Element Descriptionuint,#=1 S EEK ID ID:53AB The S EEK ID element contains the EBML-ID of the element found at the given positionuint,#=1S EEK P OSITION ID:53AC The S EEK P OSITION element contains the position relatively to the S EGMENT’s data at which an element with the ID $S EEK ID can be found.Index→page2end of S EEK Not all Level1elements need to be included.Typical S EEK H EAD s either include a list of all Level1elements,or a list of all Level1elements except for C LUSTER s (→section5.5).S EEK H EAD s can also include references to other S EEK H EAD s if there is,for example,a small S EEK H EAD at the beginning of thefile and a larger one at its end.The following picture illustrates the S EEK H EAD element in a realfile.Note that the EBML Tree Viewer replaced Level1IDs in S EEK ID with their human-readable name:16175.4TracksThe T RACKS element contains information about the tracks that are stored in the S EGMENT,like track type(audio,video,subtitles),the used codec,resolution and sample rate.All tracks shall be described in one(or more,but preferably only one) T RACKS element.Each track is described in one T RACK E NTRY.Theoretically,using the T RACK UID, information about one track could be spread over different T RACK E NTRY s,the UID would allow to know which track the information applies to,however,it is highly discouraged to stretch the specification like this.Also,an empty T RACKS element would be rather useless,but should not lead to a parser error since thefile can be played if all tracks are defined somewhere.Es-pecially pure chapterfiles might have an empty T RACKS element if the muxer doesn’t catch the case that no tracks are present and consequently creates an empty T RACKS element.An example of a T RACK E NTRY element can be found on(→page25)Table6:The T RACKS element,child of S EGMENT(→2)Element DescriptionMaster,#≥1T RACK E NTRY(→7) ID:AE One T RACK E NTRY element describes one track of the S EG-MENTIndex→page2end of T RACKS Table7:The T RACK E NTRY element,child of T RACKS(→6)Element Descriptionuint,#=1(!) T RACK N UMBER ID:D7defines an identification number of the track.This number cannot be equal to0.This number is used by the B LOCK and S IMPLE B LOCK structures.uint,#=1 T RACK UID ID:73C5is a unique identificator of the track within thefile.It cannot be equal to0T RACK E NTRY continued on next page18uint,#=1(!)T RACK T YPE(→13)ID:83defines the type of a track,i.e.video,audio,subtitle etc.bool,#≤1F LAG E NABLEDID:B9def:1When F LAG E NABLED is1,track is usedbool,#≤1 F LAG D EFAULT ID:88def:1When F LAG D EFAULT is1,the track should be selected by the player by default.Obviously,if no video track and/or no audio track has a defaultflag,one video track and one audio track should be chosen by the player,whereas no subtitle should be enabled if no subtitle has a defaultflag.bool,#≤1 F LAG F ORCED ID:55AA def:0When F LAG F ORCED is1,the track must be played.When several subtitle tracks are forced,the one matching the au-dio language should be chose.An example would be a sub-title track that cannot be disabled,like the one youfind on the german DVD“Eiskalte Engel”when you select english audio.Since thisflag can only be used to apply a restriction on digital content,it must be qualified as Digital Restrictions Management.bool,#≤1 F LAG L ACING ID:9C def:0When F LAG L ACING is1,the track may contain laced blocks.A parser that supports all types of lacing(→section6.2)can safely ignore thisflag.uint,#≤1 M IN C ACHE ID:6D E7 def:0indicates the number of frames a player must be able to cache during playback.This is for instance interesting if a native MPEG4file with frames in coding order is played.uint,#≤1 M AX C ACHE ID:6D F8indicates the maximum cache size a player needs to cache frames.A value of NULL means that no cache is required.T RACK E NTRY continued on next page19uint,#≤1D EFAULT D URATION ID:23E383This value indicates the number of nanoseconds a frame lasts.This value is applied if no$D URATION value is in-dicated for a frame or if lacing(→section6.1)is used.A value of0means that the duration of frames of the track is not necessarily constant(e.g.variable framerate video, or Vorbis audio).D EFAULT D URATION should be written for each track with a constant frame rate since it makes seeking easier.float,#≤1T RACK T IMECODE S CALE ID:23314F Every timecode of a block(cluster timecode+block timecode)is multiplied by this value to obtain the real time-code of a block.utf-8,#≤1 N AMEID:536E A N AME element contains a human-readable name for the track.Note that you can’t define which language this track name is in.You have to use Tags(→section5.9))if you want to use several titles in different languages for the same track.string,#≤1 L ANGUAGE ID:22B59C def:eng specifies the language of a track,using ISO639-23.This is NOT necessarily the language of$N AME,for example a german AC3track could be called“German-AC35.1”or “Deutsch-AC35.1”or“Allemand AC35.1”etc.string,#=1(!)C ODEC IDID:86The C ODEC ID specifies the Codec4which is used to decode the track.binary,#≤1 C ODEC P RIVATE ID:63A2C ODEC P RIVATE contains information the codec needs before decoding can be started.An example is the Vorbis initializa-tion packets for Vorbis audio.utf-8,#≤1C ODEC N AMEID:258688C ODEC N AME is a human-readable name of the Codecuint,#≥0A TTACHMENT L INK ID:7446An A TTACHMENT L INK contains the UID of an attachment that is used by this track.T RACK E NTRY continued on next page3/standards/iso639-2/englangn.html 4/technical/specs/codecid/index.html20Master,#≤1V IDEO(→8)ID:E0V IDEO contains information that is specific for video tracksMaster,#≤1A UDIO(→9)ID:E1A UDIO contains information that is specific for audio tracksMaster,#≤1C ONTENT E NCODINGS (→10)ID:6D80C ONTENT E NCODINGS contains information about(lossless) compression or encryption of the trackIndex→page2end of T RACK E NTRY Obviously,the V IDEO element must be present for video tracks,whereas the A UDIO element must be present for audio tracks.Although it doesn’t make sense to have both elements in one T RACK E NTRY element,it wouldn’t make afile unplayable.Table8:The V IDEO element,child of T RACK E NTRY(→7) Element Descriptionuint,#=1P IXEL W IDTHID:B0Width of the encoded video track in pixelsuint,#≤1P IXEL H EIGHTID:BAHeight of the encoded video in pixelsuint,#≤1P IXEL C ROP B OTTOMID:54AAdef:0Number of Pixels to be cropped from the bottomuint,#≤1P IXEL C ROP T OPID:54BBdef:0Number of Pixels to be cropped from the topV IDEO continued on next page21uint,#≤1P IXEL C ROP L EFTID:54CCdef:0Number of Pixels to be cropped from the leftuint,#≤1P IXEL C ROP R IGHTID:54DDdef:0Number of Pixels to be cropped from the rightuint,#≤1D ISPLAY W IDTHID:54B0def:$P IXEL W IDTHWidth of the video during playbackuint,#≤1D ISPLAY H EIGHTID:54BAdef:$P IXEL H EIGHTHeight of the video during playbackuint,#≤1 D ISPLAY U NIT ID:54B2 def:0Unit$D ISPLAY W IDTH and$D ISPLAY H EIGHT is measured in.This can be0→pixels,1→centimeters,2→inchesIndex→page2end of V IDEO $P IXEL C ROPXXXX is applied on$P IXELXXX,so the output is cropped after decod-ing,but before stretching it to the dimensions indicated with$D ISPLAYXXXX.Table9:The A UDIO element,child of T RACK E NTRY(→7) Element Descriptionuint,#≤1S AMPLING F REQUENCYID:B5def:8kHzIndicates the sample rate the track is encoded at in HzA UDIO continued on next page22uint,#≤1O UTPUT-S AMPLING F REQUENCY ID:78B5Indicates the sample rate the track must be played at in Hz.The default value of this element is equal to$S AM-PLING F REQUENCY.uint,#≤1C HANNELSID:9Fdef:1Number of channels of the audio trackuint,#≤1B IT D EPTHID:6264Bits per sample,this is usually used with PCM-Audio. Index→page2end of A UDIOTable10:The C ONTENT E NCODINGS element,child of T RACK E NTRY(→7) Element DescriptionMaster,#≥1C ONTENT E NCODING (→11)ID:6240A C ONTENT E NCODING-element describes one compression or encryption that has been used on this track.Index→page2end of C ONTENT E NCODINGS Table11:The C ONTENT E NCODING element,child ofC ONTENT E NCODINGS(→10)Element Descriptionuint,#≤1C ONTENT E NCODING-O RDERID:5031def:0Tells when to decode according to this pattern.The de-coder starts with the C ONTENT E NCODING that has the high-est C ONTENT E NCODING O RDER.C ONTENT E NCODING continued on next page23uint,#≤1C ONTENT E NCODING-S COPE(→14)ID:5032def:1Defines which parts of the track are compressed or en-crypted this wayuint,#≤1C ONTENT E NCODING-T YPEID:5033def:0Describes which type of encoding is described.0→com-pression,1→encryptionMaster,#≤1C ONTENT C OMPRESSION (→12)ID:5034If C ONTENT E NCODING T YPE=0,this element describes how it is compressedMaster,#≤1C ONTENT E NCRYPTION (→??)ID:5035If C ONTENT E NCRYPTION=1,this element describes how it is encryptedIndex→page2end of C ONTENT E NCODING The C ONTENT E NCODING element allows to apply not only encryption,but also lossless compression to a track.This can be used to compress text subtitles,but also to remove sync headers from audio packets.For example,each AC3frame starts with0B77,and there is no real point in saving those two bytes for each frame in a M ATROSKAfile.For a simple AC3file,this does make sense because there it can be used tofind a new frame start if data is damaged.Table12:The C ONTENT C OMPRESSION element,child ofC ONTENT E NCODING(→11)Element Descriptionuint,#≤1C ONTENT C OMP A LGO (→15)ID:4254def:0The C ONTENT C OMP A LGO element says which algorithm was used for this compression.C ONTENT C OMPRESSION continued on next page24binary,#≤1C ONTENT C OMP S ETTINGS ID:4255Contains settings that are required for decompression. These settings are specific for each compression algorithm. For example,it contains the striped header bytes when $C ONTENT C OMP A LGO=3(→page25).Index→page2end of C ONTENT C OMPRESSION Table13:Values of T RACK T YPE,child of T RACK E NTRY(→7)Value Description0x01track is a video track0x02track is an audio track0x03track is a complex track,i.e.a combined video and audio track0x10track is a logo track0x11track is a subtitle track0x12track is a button track0x20track is a control trackend of T RACK T YPE Table14:Bits in C ONTENT E NCODING S COPE,child ofC ONTENT E NCODING(→11)Value Description1all frames2the track’s C ODEC P RIVATE4the C ONTENT C OMPRESSION in the next C ONTENT E N-CODING(next as in next in decoding order)end of C ONTENT E NCODING S COPEHere is one example of a possible T RACK E NTRY element:A DTS-audio track that is using header striping.The C ONTENT C OMP S ETTINGS element contains the four bytes each DTS frame starts with.25。