Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpp_qsv hardware context issue #814

Closed
akhilxavi opened this issue May 20, 2024 · 5 comments
Closed

vpp_qsv hardware context issue #814

akhilxavi opened this issue May 20, 2024 · 5 comments
Assignees

Comments

@akhilxavi
Copy link

I am trying to decode scale and format conversion using hevc_qsv, vpp_qsv, vpp_scale respectively.
below command work as expected on my device

ffmpeg -hwaccel qsv -c:v hevc_qsv -i /media/pcie/latency-test/complex-video/nv12-5000.h265 -vf 'vpp_qsv=framerate=60,scale_qsv=w=1920:h=1080:format=vuyx,hwdownload,format=vuyx' -f null -

But when I code after linking the filters
source -> vpp_qsv -> scale_qsv -> hwdownload -> format -> sink, I am seeing below error,

**[vpp_qsv @ 0x5c5eb9dc18c0] No hw context provided.

[vpp_qsv @ 0x5c5eb9dc18c0] Failed to configure output pad on vpp_qsv**

How to specify hw context for vpp? How the vpp sink pad is expected to be configured?

Thank you in advance.

@XinfengZhang
Copy link
Contributor

@xhaihao

@xhaihao
Copy link
Contributor

xhaihao commented May 23, 2024

@akhilxavi What's your FFmpeg version ? There should be a default HW context for vpp_qsv if you use a recent version of FFmpeg.

@xhaihao
Copy link
Contributor

xhaihao commented May 23, 2024

@akhilxavi What's your FFmpeg version ? There should be a default HW context for vpp_qsv if you use a recent version of FFmpeg.

Sorry, I misunderstood your question. You may refer to https://github.com/FFmpeg/FFmpeg/blob/master/fftools/ffmpeg_filter.c#L574-L615 for hw device setting for each filter.

@akhilxavi
Copy link
Author

@xhaihao I was trying the filter chain "vpp_qsv=framerate=60,scale_qsv=w=1920:h=1080:format=vuyx,hwdownload,format=vuyx" but it failed with vpp_qsv issues. Now I modified the filter chain to:

filter chain: decoder(qsv)->scale_qsv->hwdownload->output(vuyx)

"scale_qsv=w=1920:h=1080:format=vuyx,hwdownload,format=vuyx" and the filter source is feed with AV_PIX_FMT_QSV from the decoder itself. It works with the same code which I set hw and frame context for each members in the filter chain.

if(avfilter_graph_parse_ptr(filter_graph, args, &inputs, &outputs, NULL) <0)
         av_log(NULL, AV_LOG_ERROR, "failed to parse filter graph description\n");

for(unsigned int i = 0; i < filter_graph->nb_filters; i++){
        if(!(filter_graph->filters[i]->hw_device_ctx = avctx->hw_device_ctx))
                av_log(NULL, AV_LOG_ERROR, "hw device ctx to filters failed\n");
    }

seems like the issue is only with "vpp_qsv" component. Does "vpp_qsv" need any extra initialization other than the above one?

My kernel version is: 6.8.0-31-generic
Vaapi version: 1.22.0 (libva 2.22.0.pre1)
libmfx: 1.2.10
intel iHD drivers - 24.2.1
firmwares:
DMC firmware i915/adlp_dmc.bin (v2.20)
GuC firmware i915/tgl_guc_70.bin version 70.20.0
HuC firmware i915/tgl_huc.bin version 7.9.3

@akhilxavi
Copy link
Author

more reference here intel/cartwheel-ffmpeg#324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants