May
1
转换MKV的音频编码格式
发现好多支持流媒体的液晶电视都不支持DTS音频解码,直接影响就是播放这类电影时没声音,创维42L03RF就是不支持DTS解码的。为了能在电视上播放流媒体文件只好选择常见的480P或部分720P电影,这些文件的音频常用AC3编码。
可是有很多电影都非常值得去看1080P高清版本,那种画面效果非常震撼,而且看贯了高清格式再回去看普通DVD是很难接受的。这就是由俭入奢易,由奢入俭难吧。这些1080P电影不仅体积巨大,而且音频都采用DTS编码,导致音频部分是不能被电视回放的。
为了能在电视上播放高清格式的电影,我开始寻找对DTS音频部分重新编码的方法。目前找到的方法是通过mkvtoolnix和eac3to两个软件,先提取MKV封装电影里的音视频,再对音频重新编码为液晶电视支持的格式后再重新封装。而且根据软件开发协议,这两款软件都是可以免费使用的。
两个软件我分别保存在 D:\Software\mkvtoolnix 和 D:\Software\eac3to
待重新编码的文件我保存在 D:\Public\[家园].Home.2009.1080p.DTSHD.x264-CHD.mkv
首先我查一下这个文件的信息
D:\Software\mkvtoolnix>mkvinfo D:\Public\[家园].Home.2009.1080p.DTSHD.x264-CHD.mkv
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 1
|+ Doc type read version: 1
+ Segment, size 9354057610
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4025)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v0.7.7 + libmatroska v0.8.1
| + Writing application: mkvmerge v2.6.0 ('Kelly watch the Stars') built on Mar
24 2009 15:23:17
| + Duration: 7105.343s (01:58:25.343)
| + Date: Fri Jun 12 00:06:52 2009 UTC
| + Segment UID: 0xbf 0x96 0x34 0x3e 0xae 0x01 0x52 0xe7 0xa8 0xf4 0xf6 0xde 0x8
6 0x5b 0x77 0x63
|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 400554655
| + Track type: video
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 0
| + MinCache: 1
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: V_MPEG4/ISO/AVC
| + Codec decode all: 1
| + CodecPrivate, length 170
| + Default duration: 41.708ms (23.976 fps for a video track)
| + Language: eng
| + Name: Home.2009.1080p.DTSHD.x264-CHD
| + Video track
| + Pixel width: 1920
| + Pixel height: 1080
| + Interlaced: 0
| + Display width: 1920
| + Display height: 1080
| + A track
| + Track number: 2
| + Track UID: 3186896530
| + Track type: audio
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 1
| + MinCache: 0
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: A_DTS
| + Codec decode all: 1
| + Language: eng
| + Name: DTS Master Audio Core 5.1 1536k
| + Audio track
| + Sampling frequency: 48000
| + Channels: 6
|+ EbmlVoid (size: 1024)
|+ Cluster
看到这个文件包括两条轨道,轨道1是V_MPEG4/ISO/AVC编码的视频,轨道2是A_DTS编码的音频。现在我要做的是提取出这两条轨道,对轨道2的DTS音频重新编码为AC3然后再次封装成MKV文件
我把提取出的两条轨道放到 F:\Video目录下。
D:\Software\mkvtoolnix>mkvextract tracks D:\Public\[家园].Home.2009.1080p.DTSHD.
x264-CHD.mkv 1:F:\Video\home.avc 2:F:\Video\home.dts
Extracting track 1 with the CodecID 'V_MPEG4/ISO/AVC' to the file 'F:\Video\home
.avc'. Container format: AVC/h.264 elementary stream
Extracting track 2 with the CodecID 'A_DTS' to the file 'F:\Video\home.dts'. Con
tainer format: Digital Theater System (DTS)
Progress: 100%
生成的文件保存在了 F:\Video 的目录
2010-02-13 08:50 <DIR> .
2010-02-13 08:50 <DIR> ..
2010-02-13 09:13 8,010,187,404 home.avc
2010-02-13 09:13 1,340,237,464 home.dts
2 个文件 9,350,424,868 字节
2 个目录 144,100,077,568 可用字节
下一步是对DTS音频文件重新编码
D:\Software\eac3to>eac3to f:\video\home.dts f:\video\home.ac3
DTS, 5.1 channels, 1:58:25, 24 bits, 1509kbps, 48khz
The ArcSoft and Sonic decoders don't seem to work, will use libav instead.
Decoding with libav/ffmpeg...
Remapping channels...
Encoding AC3 <640kbps> with libAften...
Creating file "f:\video\home.ac3"...
eac3to processing took 25 minutes, 6 seconds.
Done.
最后一步是重新封装提取的轨道1视频文件home.avc和重新编码的AC3音频home.ac3,重新封装的文件名我用 [家园].Home.2009.1080p.AC3HD.x264-CHD.mkv
D:\Software\mkvtoolnix>mkvmerge -o F:\Video\[家园].Home.2009.1080p.AC3HD.x264-CH
D.mkv f:\video\home.avc f:\video\home.ac3
mkvmerge v3.1.0 ('Happy up here') built on Jan 19 2010 12:09:24
'f:\video\home.avc': Using the AVC/h.264 ES demultiplexer.
'f:\video\home.ac3': Using the AC3 demultiplexer.
'f:\video\home.avc' track 0: Using the MPEG-4 part 10 ES video output module.
'f:\video\home.ac3' track 0: Using the AC3 output module.
The file 'F:\Video\[家园].Home.2009.1080p.AC3HD.x264-CHD.mkv' has been opened fo
r writing.
Progress: 100%
The cue entries (the index) are being written...
Muxing took 901 seconds.
至此这个文件的音频部分就被转换成电视所支持的AC3音频格式了。再查看一次新文件的信息
D:\Software\mkvtoolnix>mkvinfo f:\video\[家园].Home.2009.1080p.AC3HD.x264-CHD.mkv
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 2
|+ Doc type read version: 2
+ Segment, size 8580383954
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4025)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v0.7.9 + libmatroska v0.8.1
| + Writing application: mkvmerge v3.1.0 ('Happy up here') built on Jan 19 2010
12:09:24
| + Duration: 7105.312s (01:58:25.312)
| + Date: Sat Feb 13 02:16:49 2010 UTC
| + Segment UID: 0x8c 0x6f 0xdd 0x1a 0x38 0xe1 0xc6 0x5f 0x91 0x2b 0x76 0x8a 0x9
1 0xe6 0x7d 0xf0
|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 4082409097
| + Track type: video
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 0
| + MinCache: 1
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: V_MPEG4/ISO/AVC
| + Codec decode all: 1
| + CodecPrivate, length 170
| + Default duration: 40.000ms (25.000 fps for a video track)
| + Language: und
| + Video track
| + Pixel width: 1920
| + Pixel height: 1080
| + Interlaced: 0
| + Display width: 1920
| + Display height: 1080
| + A track
| + Track number: 2
| + Track UID: 3810005945
| + Track type: audio
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 1
| + MinCache: 0
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: A_AC3
| + Codec decode all: 1
| + Default duration: 32.000ms (31.250 fps for a video track)
| + Language: und
| + Audio track
| + Sampling frequency: 48000
| + Channels: 6
|+ EbmlVoid (size: 1024)
|+ Cluster
可是有很多电影都非常值得去看1080P高清版本,那种画面效果非常震撼,而且看贯了高清格式再回去看普通DVD是很难接受的。这就是由俭入奢易,由奢入俭难吧。这些1080P电影不仅体积巨大,而且音频都采用DTS编码,导致音频部分是不能被电视回放的。
为了能在电视上播放高清格式的电影,我开始寻找对DTS音频部分重新编码的方法。目前找到的方法是通过mkvtoolnix和eac3to两个软件,先提取MKV封装电影里的音视频,再对音频重新编码为液晶电视支持的格式后再重新封装。而且根据软件开发协议,这两款软件都是可以免费使用的。
两个软件我分别保存在 D:\Software\mkvtoolnix 和 D:\Software\eac3to
待重新编码的文件我保存在 D:\Public\[家园].Home.2009.1080p.DTSHD.x264-CHD.mkv
首先我查一下这个文件的信息
D:\Software\mkvtoolnix>mkvinfo D:\Public\[家园].Home.2009.1080p.DTSHD.x264-CHD.mkv
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 1
|+ Doc type read version: 1
+ Segment, size 9354057610
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4025)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v0.7.7 + libmatroska v0.8.1
| + Writing application: mkvmerge v2.6.0 ('Kelly watch the Stars') built on Mar
24 2009 15:23:17
| + Duration: 7105.343s (01:58:25.343)
| + Date: Fri Jun 12 00:06:52 2009 UTC
| + Segment UID: 0xbf 0x96 0x34 0x3e 0xae 0x01 0x52 0xe7 0xa8 0xf4 0xf6 0xde 0x8
6 0x5b 0x77 0x63
|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 400554655
| + Track type: video
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 0
| + MinCache: 1
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: V_MPEG4/ISO/AVC
| + Codec decode all: 1
| + CodecPrivate, length 170
| + Default duration: 41.708ms (23.976 fps for a video track)
| + Language: eng
| + Name: Home.2009.1080p.DTSHD.x264-CHD
| + Video track
| + Pixel width: 1920
| + Pixel height: 1080
| + Interlaced: 0
| + Display width: 1920
| + Display height: 1080
| + A track
| + Track number: 2
| + Track UID: 3186896530
| + Track type: audio
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 1
| + MinCache: 0
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: A_DTS
| + Codec decode all: 1
| + Language: eng
| + Name: DTS Master Audio Core 5.1 1536k
| + Audio track
| + Sampling frequency: 48000
| + Channels: 6
|+ EbmlVoid (size: 1024)
|+ Cluster
看到这个文件包括两条轨道,轨道1是V_MPEG4/ISO/AVC编码的视频,轨道2是A_DTS编码的音频。现在我要做的是提取出这两条轨道,对轨道2的DTS音频重新编码为AC3然后再次封装成MKV文件
我把提取出的两条轨道放到 F:\Video目录下。
D:\Software\mkvtoolnix>mkvextract tracks D:\Public\[家园].Home.2009.1080p.DTSHD.
x264-CHD.mkv 1:F:\Video\home.avc 2:F:\Video\home.dts
Extracting track 1 with the CodecID 'V_MPEG4/ISO/AVC' to the file 'F:\Video\home
.avc'. Container format: AVC/h.264 elementary stream
Extracting track 2 with the CodecID 'A_DTS' to the file 'F:\Video\home.dts'. Con
tainer format: Digital Theater System (DTS)
Progress: 100%
生成的文件保存在了 F:\Video 的目录
2010-02-13 08:50 <DIR> .
2010-02-13 08:50 <DIR> ..
2010-02-13 09:13 8,010,187,404 home.avc
2010-02-13 09:13 1,340,237,464 home.dts
2 个文件 9,350,424,868 字节
2 个目录 144,100,077,568 可用字节
下一步是对DTS音频文件重新编码
D:\Software\eac3to>eac3to f:\video\home.dts f:\video\home.ac3
DTS, 5.1 channels, 1:58:25, 24 bits, 1509kbps, 48khz
The ArcSoft and Sonic decoders don't seem to work, will use libav instead.
Decoding with libav/ffmpeg...
Remapping channels...
Encoding AC3 <640kbps> with libAften...
Creating file "f:\video\home.ac3"...
eac3to processing took 25 minutes, 6 seconds.
Done.
最后一步是重新封装提取的轨道1视频文件home.avc和重新编码的AC3音频home.ac3,重新封装的文件名我用 [家园].Home.2009.1080p.AC3HD.x264-CHD.mkv
D:\Software\mkvtoolnix>mkvmerge -o F:\Video\[家园].Home.2009.1080p.AC3HD.x264-CH
D.mkv f:\video\home.avc f:\video\home.ac3
mkvmerge v3.1.0 ('Happy up here') built on Jan 19 2010 12:09:24
'f:\video\home.avc': Using the AVC/h.264 ES demultiplexer.
'f:\video\home.ac3': Using the AC3 demultiplexer.
'f:\video\home.avc' track 0: Using the MPEG-4 part 10 ES video output module.
'f:\video\home.ac3' track 0: Using the AC3 output module.
The file 'F:\Video\[家园].Home.2009.1080p.AC3HD.x264-CHD.mkv' has been opened fo
r writing.
Progress: 100%
The cue entries (the index) are being written...
Muxing took 901 seconds.
至此这个文件的音频部分就被转换成电视所支持的AC3音频格式了。再查看一次新文件的信息
D:\Software\mkvtoolnix>mkvinfo f:\video\[家园].Home.2009.1080p.AC3HD.x264-CHD.mkv
+ EBML head
|+ Doc type: matroska
|+ Doc type version: 2
|+ Doc type read version: 2
+ Segment, size 8580383954
|+ Seek head (subentries will be skipped)
|+ EbmlVoid (size: 4025)
|+ Segment information
| + Timecode scale: 1000000
| + Muxing application: libebml v0.7.9 + libmatroska v0.8.1
| + Writing application: mkvmerge v3.1.0 ('Happy up here') built on Jan 19 2010
12:09:24
| + Duration: 7105.312s (01:58:25.312)
| + Date: Sat Feb 13 02:16:49 2010 UTC
| + Segment UID: 0x8c 0x6f 0xdd 0x1a 0x38 0xe1 0xc6 0x5f 0x91 0x2b 0x76 0x8a 0x9
1 0xe6 0x7d 0xf0
|+ Segment tracks
| + A track
| + Track number: 1
| + Track UID: 4082409097
| + Track type: video
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 0
| + MinCache: 1
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: V_MPEG4/ISO/AVC
| + Codec decode all: 1
| + CodecPrivate, length 170
| + Default duration: 40.000ms (25.000 fps for a video track)
| + Language: und
| + Video track
| + Pixel width: 1920
| + Pixel height: 1080
| + Interlaced: 0
| + Display width: 1920
| + Display height: 1080
| + A track
| + Track number: 2
| + Track UID: 3810005945
| + Track type: audio
| + Enabled: 1
| + Default flag: 1
| + Forced flag: 0
| + Lacing flag: 1
| + MinCache: 0
| + Timecode scale: 1
| + Max BlockAddition ID: 0
| + Codec ID: A_AC3
| + Codec decode all: 1
| + Default duration: 32.000ms (31.250 fps for a video track)
| + Language: und
| + Audio track
| + Sampling frequency: 48000
| + Channels: 6
|+ EbmlVoid (size: 1024)
|+ Cluster
为什么用KMPlayer播放某些RMVB格式的文件没有声音
在LG 42LH40FD液晶电视上播放USB设备MKV视频成功加载字幕的心得


