使用ffmpeg解码基本HEVC流

时间:2013-11-22 06:41:57

标签: video ffmpeg multimedia hevc

我已成功编译并安装了源代码中的FFMPEG_2.1。我知道从版本2.1开始的ffmpeg支持HEVC解码器。我使用.binHM 10.0 HEVC参考代码生成了HM 11.0文件。

但是,当我将此bin文件作为ffmpeg的输入时,我得到输入/输出错误。

我使用的命令如下:

ffmpeg -i Johnny_1280x720_60qp22.bin out.yuv

上述命令的输出如下所示:

ffmpeg version 2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 21 2013 15:52:14 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: 
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
Input #0, bin, from 'Johnny_1280x720_60qp22.bin':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: bintext, pal8, 1280x118288, 25 tbr, 25 tbn, 25 tbc
Output #0, rawvideo, to 'out.yuv':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: rawvideo, pal8, 1280x118288, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (bintext -> rawvideo)
Press [q] to stop, [?] for help
Johnny_1280x720_60qp22.bin: Input/output error
frame=    1 fps=0.3 q=0.0 size=  147861kB time=00:00:00.04 bitrate=30281932.8kbiframe=    1 fps=0.3 q=0.0 Lsize=  147861kB time=00:00:00.04 bitrate=30281932.8kbits/s    
video:147861kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.000000

任何人都可以告诉我为什么我要面对这个问题以及如何纠正它。

1 个答案:

答案 0 :(得分:2)

这是我使用HM 12.1编码的hevc序列得到的输出。

$ ./ffmpeg -i kimono_hevc.bin out.yuv
ffmpeg version N-58122-g7cd555d Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 16 2013 20:40:03 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
  configuration: --enable-libx264 --enable-gpl --enable-libmp3lame
  libavutil      52. 53.100 / 52. 53.100
  libavcodec     55. 43.100 / 55. 43.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 91.100 /  3. 91.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, hevc, from 'kimono_hevc.bin':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: hevc, yuv420p(tv), 1920x1080, 25 tbr, 1200k tbn, 25 tbc
Output #0, rawvideo, to 'out.yuv':
  Metadata:
    encoder         : Lavf55.21.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (hevc -> rawvideo)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=    3038kB time=00:00:00.04 bitrate=622080.0kbits/s    
video:3038kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.000000%

请注意,在我的示例中,我得到了

Stream #0:0: Video: hevc, yuv420p(tv)

当你得到:

Stream #0:0: Video: bintext, pal8,

HM10很老,NAL结构也发生了变化。有没有使用最新版本的原因?

要下载最新的hevc参考代码以及如何编译它,请参阅我的帖子@ https://stackoverflow.com/a/19305907/297323