我有一个 mkv 视频文件,其中包含以下内容:
> mkvmerge --identify original.mkv
File 'original.mkv': container: Matroska
Track ID 0: video (V_MPEGH/ISO/HEVC)
Track ID 1: audio (AAC)
Tags for track ID 0: 7 entries
Tags for track ID 1: 7 entries
但是使用“标准”转换avconv
不起作用,我在其他地方找到的建议也不起作用(见下文,下面......)。原始文件既不能通过连接到电视的硬盘驱动器播放,mplayer
也不能从连接到电视的硬盘驱动器播放。
如何解决这些问题,以便将文件转换为更“正常/标准”的格式,以便mplayer
在电视上播放?
> avconv -i original.mkv -vcodec copy -acodec aac -strict -2 -b:a 384k output.mp4
avconv version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Mar 16 2015 13:19:10 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[matroska,webm @ 0x11d3200] Unknown/unsupported AVCodecID V_MPEGH/ISO/HEVC.
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 3 with DTS 209, packet 4 with DTS 167
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 4 with DTS 167, packet 5 with DTS 125
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 6 with DTS 292, packet 7 with DTS 250
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 8 with DTS 500, packet 9 with DTS 417
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 9 with DTS 417, packet 10 with DTS 334
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 13 with DTS 709, packet 14 with DTS 626
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 14 with DTS 626, packet 15 with DTS 542
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 18 with DTS 918, packet 19 with DTS 834
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 19 with DTS 834, packet 20 with DTS 751
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 23 with DTS 1126, packet 24 with DTS 1043
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 24 with DTS 1043, packet 25 with DTS 959
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 28 with DTS 1293, packet 29 with DTS 1210
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 29 with DTS 1210, packet 30 with DTS 1168
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 32 with DTS 1460, packet 33 with DTS 1376
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 33 with DTS 1376, packet 34 with DTS 1335
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 36 with DTS 1627, packet 37 with DTS 1543
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 37 with DTS 1543, packet 38 with DTS 1501
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 40 with DTS 1835, packet 41 with DTS 1752
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 41 with DTS 1752, packet 42 with DTS 1668
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 45 with DTS 2002, packet 46 with DTS 1919
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 46 with DTS 1919, packet 47 with DTS 1877
[matroska,webm @ 0x11d3200] Non-increasing DTS in stream 0: packet 49 with DTS 2211, packet 50 with DTS 2127
Input #0, matroska,webm, from 'original.mkv':
Duration: 00:58:38.02, start: 0.000000, bitrate: N/A
Stream #0.0: Video: [0][0][0][0] / 0x0000, 1920x1080, PAR 255:254 DAR 680:381, 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
BPS : 1242590
BPS-eng : 1242590
DURATION : 00:58:38.015000000
DURATION-eng : 00:58:38.015000000
NUMBER_OF_FRAMES: 84348
NUMBER_OF_FRAMES-eng: 84348
NUMBER_OF_BYTES : 546431695
NUMBER_OF_BYTES-eng: 546431695
_STATISTICS_WRITING_APP: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_APP-eng: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_DATE_UTC: 2016-05-16 06:10:27
_STATISTICS_WRITING_DATE_UTC-eng: 2016-05-16 06:10:27
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0.1: Audio: aac, 48000 Hz, 5.1, fltp (default)
Metadata:
BPS : 187584
BPS-eng : 187584
DURATION : 00:58:37.995000000
DURATION-eng : 00:58:37.995000000
NUMBER_OF_FRAMES: 82453
NUMBER_OF_FRAMES-eng: 82453
NUMBER_OF_BYTES : 82490002
NUMBER_OF_BYTES-eng: 82490002
_STATISTICS_WRITING_APP: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_APP-eng: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_DATE_UTC: 2016-05-16 06:10:27
_STATISTICS_WRITING_DATE_UTC-eng: 2016-05-16 06:10:27
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[mp4 @ 0x11daf60] track 0: could not find tag, codec not currently supported in container
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf54.20.4
Stream #0.0: Video: [0][0][0][0] / 0x0000, 1920x1080 [PAR 255:254 DAR 680:381], q=2-31, 90k tbn, 1k tbc (default)
Metadata:
BPS : 1242590
BPS-eng : 1242590
DURATION : 00:58:38.015000000
DURATION-eng : 00:58:38.015000000
NUMBER_OF_FRAMES: 84348
NUMBER_OF_FRAMES-eng: 84348
NUMBER_OF_BYTES : 546431695
NUMBER_OF_BYTES-eng: 546431695
_STATISTICS_WRITING_APP: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_APP-eng: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_DATE_UTC: 2016-05-16 06:10:27
_STATISTICS_WRITING_DATE_UTC-eng: 2016-05-16 06:10:27
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0.1: Audio: aac, 48000 Hz, 5.1, fltp, 384 kb/s (default)
Metadata:
BPS : 187584
BPS-eng : 187584
DURATION : 00:58:37.995000000
DURATION-eng : 00:58:37.995000000
NUMBER_OF_FRAMES: 82453
NUMBER_OF_FRAMES-eng: 82453
NUMBER_OF_BYTES : 82490002
NUMBER_OF_BYTES-eng: 82490002
_STATISTICS_WRITING_APP: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_APP-eng: mkvmerge v7.8.0 ('River Man') 32bit built on Mar 27 2015 16:18:02
_STATISTICS_WRITING_DATE_UTC: 2016-05-16 06:10:27
_STATISTICS_WRITING_DATE_UTC-eng: 2016-05-16 06:10:27
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac -> aac)
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
我还尝试了以下命令:
avconv -i original.mkv -vcodec x264 -acodec aac -strict -2 -b:a 384k output.mp4
这给出了以下错误:
Unknown encoder 'x264'
我还尝试了以下命令:
avconv -i original.mkv -vcodec libx264 -acodec aac -strict -2 -b:a 384k output.mp4
这导致了这个错误:
[buffer @ 0x24adb00] Invalid pixel format string '-1'
Error opening filters!
您的文件是 HEVC 编码的,所以它是 H.265,当您的版本发布时它仍然是新的甚至更改
avconv
,您需要更新的编解码器来处理它。你的avconv
版本已经过时了,我建议你试试 latestffmpeg
,它现在包含在 15.04 的宇宙中。在任何比它更新的 Ubuntu 上,一个简单的
apt update
后跟apt install ffmpeg
将安装一个更新的版本。如果您使用的是 14.04,请添加此ppa 以add-apt-repository ppa:mc3man/trusty-media
获取最新的ffmpeg
.