0

I have a mkv video file which contains the following content:

> 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

But a 'standard' conversion using avconv does not work, neither a suggestion I found elsewhere (see below, and below that...). The original file can neither be played by mplayer nor when played from a hard drive connected to a TV.

How to solve these problem in order to convert the file into a more 'normal/standard' format, so it can be played by mplayer and on TV?

> 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

I also tried the following command:

avconv  -i original.mkv  -vcodec x264 -acodec aac -strict -2 -b:a 384k  output.mp4

which gives the following error:

Unknown encoder 'x264'

I also tried the following command:

avconv  -i original.mkv  -vcodec libx264 -acodec aac -strict -2 -b:a 384k  output.mp4

which resulted in this error:

[buffer @ 0x24adb00] Invalid pixel format string '-1'
Error opening filters!
3

Your file is HEVC-encoded, so it is H.265, which was still new or even changing when your avconv version was published, you would need more recent codecs to deal with it. Your avconv version is quite outdated, I suggest you give it a go with the latest ffmpeg, which is now included in universe since 15.04.

On any Ubuntu newer than that, a simple apt update followed by apt install ffmpeg will install a newer version. If you are on 14.04, add this ppa by add-apt-repository ppa:mc3man/trusty-media to get the latest ffmpeg.

  • Is there a command to install/update the latest avconv or ffmpeg? – Alex May 27 '16 at 9:27
  • What distribution are you on? You can get the latest ffmpeg on 14.04 by adding this ppa: launchpad.net/~mc3man/+archive/ubuntu/trusty-media – emk2203 May 27 '16 at 9:43
  • 1
    @Alex Another option is to download a ffmpeg binary. – llogan May 27 '16 at 16:44
  • H.265 standard is not changing anymore. People already built hardware decoders etc. Or did you have some extensions in mind? – incBrain Jun 2 '16 at 17:05
  • I edited the answer accordingly, you are correct. What I wrote was not what I wanted to say. – emk2203 Jun 2 '16 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.