Javacv: How do I specify a GPU card to decode if i have two GPU card ?

Created on 2 Aug 2019  ·  9Comments  ·  Source: bytedeco/javacv

I konwn ,ffmpeg -hwaccel cuvid -hwaccel_device 0 -c:v h264_cuvid -i demo.flv ...
I want to use FFmpegFrameGrabber .
I've tried, setOption("hwaccel_device", "1"); or setVideoOption("hwaccel_device", "1"); and so on
but it had no effect at all.

question

Most helpful comment

You can try this
setVideoCodecName("h264_cuvid");
setVideoOption("gpu", "1");

All 9 comments

That sounds like a question about FFmpeg?
You'll probably find the answer in their documentation:
https://ffmpeg.org/documentation.html

That sounds like a question about FFmpeg?
You'll probably find the answer in their documentation:
https://ffmpeg.org/documentation.html
I want to use javaCV,how to set ? Thank u

That sounds like a question about FFmpeg?
You'll probably find the answer in their documentation:
https://ffmpeg.org/documentation.html

We have already read the #1142, #1134, and read the document on ffmpeg.org, but setOption(“hwaccel_device”,“1”) doesn't work.

Maybe we need to set it some other way. Someone will need to figure this out. I don't have this information at the moment.

Please keep an eye on this issue, it's very useful to us.
And I have another doubt. How does javacv implement instruction mapping and why can some instructions like setVideoOption("hwaccel", "cuvid") can be set successfully?

The ffmpeg program doesn't map directly all the options that way. Maybe something like setVideoOption("device","1") works, I don't know. The only way to know for sure is to read the source code of the ffmpeg program.

You can try this
setVideoCodecName("h264_cuvid");
setVideoOption("gpu", "1");

You can try this
setVideoCodecName("h264_cuvid");
setVideoOption("gpu", "1");

It is work for me . Thank you very much!

You can try this
setVideoCodecName("h264_cuvid");
setVideoOption("gpu", "1");

This parameter can be used, you really helped us a lot. Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Maleandr picture Maleandr  ·  3Comments

UpAndDownAgain picture UpAndDownAgain  ·  3Comments

chrisliu12345 picture chrisliu12345  ·  4Comments

RaGreen picture RaGreen  ·  4Comments

y4nnick picture y4nnick  ·  3Comments