使用libfdk_aac编解码器从MKV到MP4的FFMPEG转换错误

时间:2014-08-16 19:29:56

标签: ffmpeg video-conversion mkv video-codecs acc

这样做的目的是因为我的" Smart"三星电视没有播放MKV文件。

This thread提到不需要进行视频转换,只需更改容器即可。在阅读了有关如何将MKV容器更改为MP4的多个线程后,我从here下载并编译了具有libfdk_aac支持的FFMPEG。我尝试使用此命令转换样本MKV文件:

ffmpeg -i "C:\VideoTest\Sample1.mkv" -c:v copy -c:a libfdk_aac -b:a 384k "C:\VideoTest\Sample2.mp4"

但是收到以下错误(从命令提示符复制):

[hevc @ 0000000000308ae0] Could not find ref with POC 113
[hevc @ 0000000000308ae0] Could not find ref with POC 111
[hevc @ 0000000000308ae0] Could not find ref with POC 109
[hevc @ 0000000000308ae0] Could not find ref with POC 107
Input #0, matroska,webm, from 'C:\VideoTest\Sample-1.mk
v':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-07-16 08:54:02
  Duration: 00:00:58.68, start: 0.042000, bitrate: 3520 kb/s
    Chapter #0.0: start 0.000000, end 58.717000
    Metadata:
      title           : Chapter 4
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x816, SAR 1:1 DAR 40:17, 2
4 fps, 24 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
 Jun  9 2014 15:16:27
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun  9 2014 15:16:27
      _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      BPS             : 2733260
      BPS-eng         : 2733260
      DURATION        : 00:00:58.667000000
      DURATION-eng    : 00:00:58.667000000
      NUMBER_OF_FRAMES: 1408
      NUMBER_OF_FRAMES-eng: 1408
      NUMBER_OF_BYTES : 20044023
      NUMBER_OF_BYTES-eng: 20044023
    Stream #0:1: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb/s (default)

    Metadata:
      _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
 Jun  9 2014 15:16:27
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun  9 2014 15:16:27
      _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      BPS             : 767986
      BPS-eng         : 767986
      DURATION        : 00:00:58.625000000
      DURATION-eng    : 00:00:58.625000000
      NUMBER_OF_FRAMES: 5496
      NUMBER_OF_FRAMES-eng: 5496
      NUMBER_OF_BYTES : 5627904
      NUMBER_OF_BYTES-eng: 5627904
    Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080 (default)
    Metadata:
      _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
 Jun  9 2014 15:16:27
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun  9 2014 15:16:27
      _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      BPS             : 17485
      BPS-eng         : 17485
      DURATION        : 00:00:56.750000000
      DURATION-eng    : 00:00:56.750000000
      NUMBER_OF_FRAMES: 40
      NUMBER_OF_FRAMES-eng: 40
      NUMBER_OF_BYTES : 124036
      NUMBER_OF_BYTES-eng: 124036
Output #0, mp4, to 'C:\VideoTest\Sample.mp4':
  Metadata:
    encoder         : Lavf56.1.100
    Chapter #0.0: start 0.000000, end 58.675000
    Metadata:
      title           : Chapter 4
    Stream #0:0: Video: hevc ([35][0][0][0] / 0x0023), yuv420p, 1920x816 [SAR 1:
1 DAR 40:17], q=2-31, 24 fps, 16k tbn, 1k tbc (default)
    Metadata:
      _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
 Jun  9 2014 15:16:27
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun  9 2014 15:16:27
      _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      BPS             : 2733260
      BPS-eng         : 2733260
      DURATION        : 00:00:58.667000000
      DURATION-eng    : 00:00:58.667000000
      NUMBER_OF_FRAMES: 1408
      NUMBER_OF_FRAMES-eng: 1408
      NUMBER_OF_BYTES : 20044023
      NUMBER_OF_BYTES-eng: 20044023
    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, 5.1
, s16, 128 kb/s (default)
    Metadata:
      _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
 Jun  9 2014 15:16:27
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun  9 2014 15:16:27
      _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      BPS             : 767986
      BPS-eng         : 767986
      DURATION        : 00:00:58.625000000
      DURATION-eng    : 00:00:58.625000000
      NUMBER_OF_FRAMES: 5496
      NUMBER_OF_FRAMES-eng: 5496
      NUMBER_OF_BYTES : 5627904
      NUMBER_OF_BYTES-eng: 5627904
      encoder         : Lavc56.0.101 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[mp4 @ 0000000003be0500] Invalid DTS: 656 PTS: -672 in output stream 0:0
av_interleaved_write_frame(): Invalid argument
[libfdk_aac @ 00000000042fa640] Trying to remove 1024 samples, but the queue is
empty
[mp4 @ 0000000003be0500] Encoder did not produce proper pts, making some up.
[libfdk_aac @ 00000000042fa640] Trying to remove 1024 samples, but the queue is
empty
frame=    2 fps=0.0 q=-1.0 Lsize=      96kB time=00:00:00.04 bitrate=18415.0kbit
s/s
video:95kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: 0.570364%
Conversion failed!

也尝试使用此命令:

ffmpeg -i input.wav -c:a libfdk_aac -b:a 128k output.mp4

但是这会破坏视频质量,并且在播放过程中我开始看到一些不良的像素化补丁。

任何帮助都将不胜感激。

仅仅是一个FYI:通过阅读博客和帖子,我做到了这一点。我对视频转换知之甚少。

1 个答案:

答案 0 :(得分:0)

如果您在第一次命令后无法播放视频,那么(显然)您的电视无法处理原始编码的视频流。所以 - 用另一个编解码器重新编码。这将产生高质量的重新编码版本(重新编码需要一段时间):

ffmpeg -i input.mkv -qscale 1 -c:a libfdk_aac -b:a 384k output.mp4