尝试在虚拟机的linux系统中用intel cpu中itegrated gpu的hevc_qsv的功能,提示如下:
[root@localhost seq]# ./run.sh NORWAY_8K.webm vr 30 30 30
ffmpeg version n3.2.2-59-g94c76be Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
configuration: --enable-libmfx
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
Input #0, matroska,webm, from 'NORWAY_8K.webm':
Metadata:
encoder : Lavf57.71.100
Duration: 00:03:33.20, start: -0.007000, bitrate: 62999 kb/s
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv, bt709/unknown/unknown), 7680x4320, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
Stream #0:1: Audio: opus, 48000 Hz, stereo, fltp (default)
Codec AVOption idr_interval (Distance (in I-frames) between IDR frames) specified for output file #0 (vr_q30_fps_preview.ts) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
Stream #0:0 -> #0:0 (vp9 (native) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[AVHWDeviceContext @ 0x3484920] Failed to initialise VAAPI connection: -1 (unknown libva error).
[AVHWDeviceContext @ 0x33e9940] No VA display found for device: /dev/dri/renderD129.
[AVHWDeviceContext @ 0x33e3a00] No VA display found for device: /dev/dri/renderD130.
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[AVHWDeviceContext @ 0x33e4480] Failed to initialise VAAPI connection: -1 (unknown libva error).
[AVHWDeviceContext @ 0x3484920] No VA display found for device: /dev/dri/card1.
[AVHWDeviceContext @ 0x33e50a0] No VA display found for device: /dev/dri/card2.
Failed to create a QSV device
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[aac @ 0x31d0220] Qavg: 39596.762
[aac @ 0x31d0220] 2 frames left in the queue on closing
Conversion failed!
原因是: 虚拟机中不支持GPU的虚拟化。
所以应该在直接装liunx的机器上运行hevc_qsv的功能。
成功时显示信息如下:
Stream mapping:
Stream #0:0 -> #0:0 (vp9 (native) -> hevc (hevc_qsv))
Stream #0:1 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0