FFmpeg h264_qsv:初始化内部 MFX 会话时出错:不支持(-3)

FFmpeg h264_qsv:初始化内部 MFX 会话时出错:不支持(-3)

我使用 ffmpeg 为 Windows 构建吉安: 发布ffmpeg-5.0-完整版具有硬件支持。我需要从 USB 视频设备捕获视频,压缩视频并将其写入文件。我使用以下命令行:

ffmpeg -f dshow -i video="USB Video" -c:v h264_qsv m:\out21.mp4

我收到错误: Error initializing an internal MFX session: unsupported (-3)

此错误发生在不同的系统上:

台式机,Windows 7,英特尔酷睿 i7-4770

平板电脑,Windows 10 企业版,英特尔赛扬 N3350E

附上报告台式机,Windows 7,英特尔酷睿 i7-4770

ffmpeg started on 2022-02-07 at 09:43:34
Report written to "m:\ffmpeg-20220207-1.log"
Log level: 56
Command line:
ffmpeg -report -f dshow -i "video=USB Video" -c:v h264_qsv "m:\\out22.mp4"
ffmpeg version 5.0-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'dshow'.
Reading option '-i' ... matched as input url with argument 'video=USB Video'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_qsv'.
Reading option 'm:\out22.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url video=USB Video.
Applying option f (force format) with argument dshow.
Successfully parsed a group of options.
Opening an input file: video=USB Video.
[dshow @ 0000000000363000] Selecting pin Запись on video
[dshow @ 0000000000363000] passing through packet of type video size   157124 timestamp 4937263713246 orig timestamp 4937263713246 graph timestamp 4937263710000 diff -3246 USB Video
[mjpeg @ 000000000037cdc0] marker=d8 avail_size_in_buf=157122
[mjpeg @ 000000000037cdc0] marker parser used 0 bytes (0 bits)
[mjpeg @ 000000000037cdc0] marker=db avail_size_in_buf=157120
[mjpeg @ 000000000037cdc0] index=0
[mjpeg @ 000000000037cdc0] qscale[0]: 3
[mjpeg @ 000000000037cdc0] marker parser used 67 bytes (536 bits)
[mjpeg @ 000000000037cdc0] marker=db avail_size_in_buf=157051
[mjpeg @ 000000000037cdc0] index=1
[mjpeg @ 000000000037cdc0] qscale[1]: 6
[mjpeg @ 000000000037cdc0] marker parser used 67 bytes (536 bits)
[mjpeg @ 000000000037cdc0] marker=c0 avail_size_in_buf=156982
[mjpeg @ 000000000037cdc0] Changing bps from 0 to 8
[mjpeg @ 000000000037cdc0] sof0: picture: 1920x1080
[mjpeg @ 000000000037cdc0] component 0 2:1 id: 0 quant:0
[mjpeg @ 000000000037cdc0] component 1 1:1 id: 1 quant:1
[mjpeg @ 000000000037cdc0] component 2 1:1 id: 2 quant:1
[mjpeg @ 000000000037cdc0] pix fmt id 21111100
[mjpeg @ 000000000037cdc0] Format yuvj422p chosen by get_format().
[mjpeg @ 000000000037cdc0] marker parser used 17 bytes (136 bits)
[mjpeg @ 000000000037cdc0] marker=c4 avail_size_in_buf=156963
[mjpeg @ 000000000037cdc0] marker parser used 0 bytes (0 bits)
[mjpeg @ 000000000037cdc0] marker=c4 avail_size_in_buf=156930
[mjpeg @ 000000000037cdc0] marker parser used 0 bytes (0 bits)
[mjpeg @ 000000000037cdc0] marker=c4 avail_size_in_buf=156747
[mjpeg @ 000000000037cdc0] marker parser used 0 bytes (0 bits)
[mjpeg @ 000000000037cdc0] marker=c4 avail_size_in_buf=156714
[mjpeg @ 000000000037cdc0] marker parser used 0 bytes (0 bits)
[mjpeg @ 000000000037cdc0] escaping removed 1769 bytes
[mjpeg @ 000000000037cdc0] marker=da avail_size_in_buf=156531
[mjpeg @ 000000000037cdc0] marker parser used 154762 bytes (1238096 bits)
[mjpeg @ 000000000037cdc0] marker=d9 avail_size_in_buf=0
[mjpeg @ 000000000037cdc0] decode frame unused 0 bytes
[dshow @ 0000000000363000] All info found
[dshow @ 0000000000363000] stream 0: start_time: 493726 duration: NOPTS
[dshow @ 0000000000363000] format: start_time: 493726 duration: NOPTS (estimate from bit rate) bitrate=0 kb/s
Input #0, dshow, from 'video=USB Video':
  Duration: N/A, start: 493726.371325, bitrate: N/A
  Stream #0:0, 1, 1/10000000: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/bt709/unknown), 1920x1080, 30 fps, 30 tbr, 10000k tbn
Successfully opened the file.
Parsing a group of options: output url m:\out22.mp4.
Applying option c:v (codec name) with argument h264_qsv.
Successfully parsed a group of options.
Opening an output file: m:\out22.mp4.
[file @ 0000000000380e80] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_qsv))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[mjpeg @ 00000000003c2480] marker=d8 avail_size_in_buf=157122
[mjpeg @ 00000000003c2480] marker parser used 0 bytes (0 bits)
[mjpeg @ 00000000003c2480] marker=db avail_size_in_buf=157120
[mjpeg @ 00000000003c2480] index=0
[mjpeg @ 00000000003c2480] qscale[0]: 3
[mjpeg @ 00000000003c2480] marker parser used 67 bytes (536 bits)
[mjpeg @ 00000000003c2480] marker=db avail_size_in_buf=157051
[mjpeg @ 00000000003c2480] index=1
[mjpeg @ 00000000003c2480] qscale[1]: 6
[mjpeg @ 00000000003c2480] marker parser used 67 bytes (536 bits)
[mjpeg @ 00000000003c2480] marker=c0 avail_size_in_buf=156982
[mjpeg @ 00000000003c2480] sof0: picture: 1920x1080
[mjpeg @ 00000000003c2480] component 0 2:1 id: 0 quant:0
[mjpeg @ 00000000003c2480] component 1 1:1 id: 1 quant:1
[mjpeg @ 00000000003c2480] component 2 1:1 id: 2 quant:1
[mjpeg @ 00000000003c2480] pix fmt id 21111100
[mjpeg @ 00000000003c2480] Format yuvj422p chosen by get_format().
[mjpeg @ 00000000003c2480] marker parser used 17 bytes (136 bits)
[mjpeg @ 00000000003c2480] marker=c4 avail_size_in_buf=156963
[mjpeg @ 00000000003c2480] class=0 index=0 nb_codes=12
[mjpeg @ 00000000003c2480] marker parser used 31 bytes (248 bits)
[mjpeg @ 00000000003c2480] marker=c4 avail_size_in_buf=156930
[mjpeg @ 00000000003c2480] class=1 index=0 nb_codes=162
[mjpeg @ 00000000003c2480] marker parser used 181 bytes (1448 bits)
[mjpeg @ 00000000003c2480] marker=c4 avail_size_in_buf=156747
[mjpeg @ 00000000003c2480] class=0 index=1 nb_codes=12
[mjpeg @ 00000000003c2480] marker parser used 31 bytes (248 bits)
[mjpeg @ 00000000003c2480] marker=c4 avail_size_in_buf=156714
[mjpeg @ 00000000003c2480] class=1 index=1 nb_codes=162
[mjpeg @ 00000000003c2480] marker parser used 181 bytes (1448 bits)
[mjpeg @ 00000000003c2480] escaping removed 1769 bytes
[mjpeg @ 00000000003c2480] marker=da avail_size_in_buf=156531
[mjpeg @ 00000000003c2480] component: 0
[mjpeg @ 00000000003c2480] component: 1
[mjpeg @ 00000000003c2480] component: 2
[mjpeg @ 00000000003c2480] marker parser used 154761 bytes (1238088 bits)
[mjpeg @ 00000000003c2480] marker=d9 avail_size_in_buf=0
[mjpeg @ 00000000003c2480] decode frame unused 0 bytes
detected 8 logical cores
[graph 0 input from stream 0:0 @ 000000000b262a00] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 000000000b262a00] Setting 'pix_fmt' to value '13'
[graph 0 input from stream 0:0 @ 000000000b262a00] Setting 'time_base' to value '1/10000000'
[graph 0 input from stream 0:0 @ 000000000b262a00] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 000000000b262a00] Setting 'frame_rate' to value '10000000/333333'
[graph 0 input from stream 0:0 @ 000000000b262a00] w:1920 h:1080 pixfmt:yuvj422p tb:1/10000000 fr:10000000/333333 sar:0/1
[format @ 000000000b265dc0] Setting 'pix_fmts' to value 'nv12|p010le|qsv'
[auto_scale_0 @ 000000000b266200] w:iw h:ih flags:'' interl:0
[format @ 000000000b265dc0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0000000000385700] query_formats: 4 queried, 3 merged, 1 already done, 0 delayed
[auto_scale_0 @ 000000000b266200] picking nv12 out of 2 ref:yuvj422p alpha:0
[swscaler @ 000000000b268a00] [swscaler @ 000000000b276b40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000b2d1200] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000b324340] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000b3b5280] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000e3d00c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000e41d080] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000e465fc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000e4b6d00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000000000b268a00] [swscaler @ 000000000e53eb00] deprecated pixel format used, make sure you did set range correctly
[dshow @ 0000000000363000] passing through packet of type video size   157910 timestamp 4937264046579 orig timestamp 4937264046579 graph timestamp 4937264030000 diff -16579 USB Video
[auto_scale_0 @ 000000000b266200] w:1920 h:1080 fmt:yuvj422p sar:0/1 -> w:1920 h:1080 fmt:nv12 sar:0/1 flags:0x0
[h264_qsv @ 00000000003965c0] Encoder: input is system memory surface
[dshow @ 0000000000363000] passing through packet of type video size   155578 timestamp 4937264379912 orig timestamp 4937264379912 graph timestamp 4937264350000 diff -29912 USB Video
[dshow @ 0000000000363000] passing through packet of type video size   155429 timestamp 4937264713245 orig timestamp 4937264713245 graph timestamp 4937264670000 diff -43245 USB Video
[h264_qsv @ 00000000003965c0] Error initializing an internal MFX session: unsupported (-3)
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
[AVIOContext @ 0000000000380fc0] Statistics: 0 bytes written, 0 seeks, 0 writeouts
[dshow @ 0000000000363000] frame with missing sample timestamp encountered, falling back to graph timestamp
[dshow @ 0000000000363000] passing through packet of type video size        0 timestamp 4937271110000 orig timestamp 4937262670000 graph timestamp 4937271110000 diff 8440000 USB Video
Conversion failed!

答案1

问题原因是未安装集成的 Intel 显卡。设备管理器中缺少设备“Intel HD Graphics”。

在 Windows 7 上我无法安装驱动程序,因为英特尔不提供此类操作系统和处理器配置的驱动程序。此外,还安装了独立显卡。

在 Windows 10 中,集成的 Intel 显卡被 Microsoft 设备所取代。安装驱动程序后,设备“Intel HD Graphics”出现,h264_qsv 开始工作。

相关内容