ffmpeg使用h264_qsv、hevc_qsv报段错误

勿忘初心_123 发布于 2016/11/14 17:29
阅读 2K+
收藏 0
[jxj123@localhost content]$ ffmpeg -i test_stream.264 -vcodec h264_qsv test.mp4
ffmpeg version 3.1.4 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
[h264 @ 0x2a82d60] Increasing reorder buffer to 1
Input #0, h264, from 'test_stream.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 176x96 [SAR 1:1 DAR 11:6], 30 fps, 30 tbr, 1200k tbn, 60 tbc
Segmentation fault (core dumped)



求大神指导。

加载中
0
Feng_Yu
Feng_Yu
换成libx264编码呢?现在mp4基本都用x264了吧,h264_qsv这个编码器我没用过,我对x264更熟悉一些
0
李察德-泰森
李察德-泰森
同上,换libx264编码
0
按图索骥
按图索骥
qsv 是intel的硬件编码,你显卡驱动装好了吗
0
勿忘初心_123

引用来自“刘圣茂”的评论

qsv 是intel的硬件编码,你显卡驱动装好了吗
[jxj123@localhost ~]$ lsmod | grep 'i915'
i915                  938476  5 
i2c_algo_bit           13413  1 i915
drm_kms_helper         98274  1 i915
drm                   311336  4 i915,drm_kms_helper
i2c_core               40325  5 drm,i915,i2c_i801,drm_kms_helper,i2c_algo_bit
video                  19263  1 i915


已经安装好了,软解的时候用的libx265这个库,现在想使用显卡硬解码,编译的时候参考的http://blog.csdn.net/ww506772362/article/details/49865437   这篇文章。
./configure  --enable-libx265 --enable-gpl --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv --enable-encoder=hevc_qsv --enable-decoder=hevc_qsv
make
make install
0
勿忘初心_123

引用来自“Feng_Yu”的评论

换成libx264编码呢?现在mp4基本都用x264了吧,h264_qsv这个编码器我没用过,我对x264更熟悉一些
x264和x265我都试过了,没有问题。现在我想硬解码,所以想使用hevc_qsv和h264_qsv这两个库。但是现在这两个库都不行。
Feng_Yu
Feng_Yu
印象中libx264支持GPU编码,你可以翻翻x264的文档看看
0
勿忘初心_123
[jxj123@localhost content]$ ffmpeg -i test_stream.264 -vcodec hevc_qsv test.mp4 -v debug
ffmpeg version 3.1.4 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'test_stream.264'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'hevc_qsv'.
Reading option 'test.mp4' ... matched as output file.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file test_stream.264.
Successfully parsed a group of options.
Opening an input file: test_stream.264.
[file @ 0x3327fe0] Setting default whitelist 'file,crypto'
[h264 @ 0x33276c0] Format h264 probed with size=2048 and score=51
[h264 @ 0x33276c0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x3328d80] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 5, nal_ref_idc: 1
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
[h264 @ 0x3328d80] Increasing reorder buffer to 1
[h264 @ 0x3328d80] no picture 
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 0
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 1 times
[h264 @ 0x3328d80] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3328d80] nal_unit_type: 1, nal_ref_idc: 1
[h264 @ 0x3328d80] ct_type:0 pic_struct:0
    Last message repeated 93 times
[h264 @ 0x33276c0] After avformat_find_stream_info() pos: 267554 bytes read:267554 seeks:0 frames:101
Input #0, h264, from 'test_stream.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 101, 1/1200000: Video: h264 (High), 1 reference frame, yuv420p(left), 176x96 [SAR 1:1 DAR 11:6], 0/1, 30 fps, 30 tbr, 1200k tbn, 60 tbc
Successfully opened the file.
Parsing a group of options: output file test.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument hevc_qsv.
Successfully parsed a group of options.
Opening an output file: test.mp4.
File 'test.mp4' already exists. Overwrite ? [y/N] y
[file @ 0x33663e0] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0x3384e00] Setting 'video_size' to value '176x96'
[graph 0 input from stream 0:0 @ 0x3384e00] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x3384e00] Setting 'time_base' to value '1/1200000'
[graph 0 input from stream 0:0 @ 0x3384e00] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x3384e00] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x3384e00] Setting 'frame_rate' to value '60/2'
[graph 0 input from stream 0:0 @ 0x3384e00] w:176 h:96 pixfmt:yuv420p tb:1/1200000 fr:60/2 sar:1/1 sws_param:flags=2
[format @ 0x33660e0] compat: called with args=[nv12|qsv]
[format @ 0x33660e0] Setting 'pix_fmts' to value 'nv12|qsv'
[auto-inserted scaler 0 @ 0x3385c80] Setting 'flags' to value 'bicubic'
[auto-inserted scaler 0 @ 0x3385c80] w:iw h:ih flags:'bicubic' interl:0
[format @ 0x33660e0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x3330240] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0x3385c80] w:176 h:96 fmt:yuv420p sar:1/1 -> w:176 h:96 fmt:nv12 sar:1/1 flags:0x4
[h264 @ 0x33648c0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x33648c0] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x33648c0] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x33648c0] Ignoring NAL type 9 in extradata

Segmentation fault (core dumped)

这是debug的信息,请各位帮忙分析一下是什么问题,谢谢。

返回顶部
顶部