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

framereader: support hardware decoding #22906

Merged
merged 7 commits into from
Nov 17, 2021
Merged

Conversation

deanlee
Copy link
Contributor

@deanlee deanlee commented Nov 14, 2021

currently supports CUDA, MediaCodec and VideoToolbox

@deanlee deanlee marked this pull request as ready for review November 14, 2021 17:27
@deanlee deanlee changed the title ffmpeg: add support for CUDA decoding framereader: add support for CUDA decoding Nov 14, 2021
@deanlee deanlee marked this pull request as draft November 14, 2021 19:37
@deanlee deanlee changed the title framereader: add support for CUDA decoding framereader: support hardware accelerated video decoding Nov 15, 2021
@deanlee deanlee force-pushed the frameread_hw_accel branch 2 times, most recently from b578a84 to 465608a Compare November 15, 2021 00:59
@deanlee deanlee marked this pull request as ready for review November 15, 2021 01:34
@deanlee deanlee changed the title framereader: support hardware accelerated video decoding framereader: support hardware decoding Nov 15, 2021
@pd0wm
Copy link
Contributor

pd0wm commented Nov 15, 2021

Can we detect which ones are available and have replay automatically enable them? Maybe change the flag to --hw-decoder=[none,cuda,mediacodec,toolbox]

@pd0wm pd0wm added the tools label Nov 15, 2021
@deanlee deanlee marked this pull request as draft November 15, 2021 12:58
@deanlee deanlee marked this pull request as ready for review November 15, 2021 14:48
@pd0wm
Copy link
Contributor

pd0wm commented Nov 15, 2021

Can you add the flag to override the choice (and force no hw decoding)?

@deanlee deanlee marked this pull request as draft November 15, 2021 15:01
@pd0wm
Copy link
Contributor

pd0wm commented Nov 15, 2021

Is it worth it to support videtoolbox and mediacodec? From my quick testing they don't seem to support hevc. Or is that a problem with my setup? If keep supporting them we need to fall back to software decoding in case the format is not supported.

@pd0wm
Copy link
Contributor

pd0wm commented Nov 15, 2021

Noticed ui.py doesn't work when using cuda as a hw decoder (can't match the buffer size to a camera).

@deanlee
Copy link
Contributor Author

deanlee commented Nov 15, 2021

Then we can only support CUDA for the time being.
auto detection is complicated. I suggest still using flag for hw-decode, what do you think?

@deanlee
Copy link
Contributor Author

deanlee commented Nov 15, 2021

Noticed ui.py doesn't work when using cuda as a hw decoder (can't match the buffer size to a camera).

fixed

@deanlee deanlee marked this pull request as ready for review November 15, 2021 16:41
@pd0wm
Copy link
Contributor

pd0wm commented Nov 15, 2021

Just supporting cuda is fine. Think it can be default on, but disabled using --no-cuda or something like that.

@deanlee deanlee marked this pull request as draft November 15, 2021 17:33
@deanlee deanlee marked this pull request as ready for review November 15, 2021 17:58
@deanlee deanlee marked this pull request as draft November 15, 2021 19:18
@deanlee deanlee force-pushed the frameread_hw_accel branch 2 times, most recently from 1591ae9 to ec5915d Compare November 16, 2021 03:02
@deanlee deanlee marked this pull request as ready for review November 16, 2021 03:21
@pd0wm pd0wm merged commit 20d3cf1 into commaai:master Nov 17, 2021
@deanlee deanlee deleted the frameread_hw_accel branch November 17, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants