如何将mkv视频文件转换成电视机支持的格式?

如何将mkv视频文件转换成电视机支持的格式?

我有一个 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!

答案1

avconv您的文件是 HEVC 编码的,因此它是 H.265,在您的版本发布时它仍然是新的甚至在变化,您需要更新的编解码器来处理它。您的avconv版本相当过时,我建议您尝试使用最新版本ffmpeg,它现在自 15.04 起已包含在 universe 中。

在任何比此版本更新的 Ubuntu 上,apt update只需输入以下命令apt install ffmpeg即可安装更新版本。如果你使用的是 14.04,请添加此命令苯甲酸 获取add-apt-repository ppa:mc3man/trusty-media最新信息ffmpeg

相关内容