Opened 4 months ago

Last modified 7 weeks ago

#7006 new defect

Intel QSV: "QSV requires a fixed frame pool size" message is given

Reported by: JasonZhang Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: qsv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When I use ffmpeg with h264_qsv encoder,it will result in a message that says"QSV requires a fixed frame pool size"

[Parsed_overlay_qsv_2 @ 0x53e2080] Input[0] is of qsv.
[auto_scaler_0 @ 0x53e5ac0] w:500 h:200 fmt:rgba sar:1/1 -> w:500 h:200 fmt:nv12 sar:1/1 flags:0x4
[hwupload @ 0x3f76440] Surface format is nv12.
[AVHWFramesContext @ 0x4b31940] QSV requires a fixed frame pool size
[AVHWFramesContext @ 0x4b31940] Error creating an internal frame pool
[Parsed_hwupload_1 @ 0x53e1d00] Failed to configure output pad on Parsed_hwupload_1
[AVIOContext @ 0x3f7e8c0] Statistics: 42915 bytes read, 0 seeks
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x3edd280] Statistics: 0 seeks, 0 writeouts
[libfdk_aac @ 0x3f78c80] 2 frames left in the queue on closing
[AVIOContext @ 0x3edab40] Statistics: 65536 bytes read, 0 seeks
Conversion failed!

How to reproduce:
./ffmpeg -hwaccel qsv -vcodec h264_qsv -i "high_1280_720_120s.flv" -vf "movie=test.png,hwupload [watermark]; [vf0][watermark] overlay_qsv=x=30:y=30[vf1]" -acodec libfdk_aac -ar 44100 out.mp4
ffmpeg version N-89879-gf0320af(n3.5-dev)
built on linux

Change History (3)

comment:1 Changed 3 months ago by lizhong1008

A patch on libav (https://patches.libav.org/patch/64133/) should can make it workable though it is not perfect.

comment:2 Changed 7 weeks ago by Brainiarc7

Here's the workaround:

Add this filter argument to hwupload:

hwupload=extra_hw_frames=1234 (replace with suitable value, probably something like 10 works for you here).

Rationale:

The filter option extra_hw_frames passed to the hwupload video filter is used to set an initial pool size.

For the settings, if it's feeding into a scaler, then probably 2 or 3 frames are sufficient, but if it's feeding into an encoder with look-ahead enabled, then you might need over 100. As such, it's currently under user control.

comment:3 Changed 7 weeks ago by Brainiarc7

So, for the snippet above, you'd add the option explained above like this:

./ffmpeg -hwaccel qsv -vcodec h264_qsv -i "high_1280_720_120s.flv" -vf "movie=test.png,hwupload=extra_hw_frames=10 [watermark]; [vf0][watermark] overlay_qsv=x=30:y=30[vf1]" -acodec libfdk_aac -ar 44100 out.mp4

Confirm that it works for you.

Note: See TracTickets for help on using tickets.