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

[Q] Hardware accel for decoding #833

Open
barolo opened this issue May 3, 2024 · 6 comments
Open

[Q] Hardware accel for decoding #833

barolo opened this issue May 3, 2024 · 6 comments

Comments

@barolo
Copy link

barolo commented May 3, 2024

Is it possible to insert something like this into av1an chain?
ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i ./input.mkv -vf 'scale_vaapi=w=1280:h=720,hwdownload,format=p010le'
this gives me three times the fps that I get from av1an [with same svt-av1 config]

@gitoss
Copy link

gitoss commented Jun 10, 2024

The solution would be for av1an to add another param like abav1's "--enc-input" which is placed before ffmpeg's -i. For example, with ab1av1 I'm using '--enc-input hwaccel=d3d11va' which transforms into a '-hwaccel d3d11va' ffmpeg param before -i

This probably would be easy enough to implement, and would offload work to the gpu - so a big +1 for this feature request :-)

Edit: I don't know how/if hw decoding scales with a lot of parallel workers...

@barolo
Copy link
Author

barolo commented Jun 10, 2024

The thing is, i just want the decoder part, hw encoder would be nice but my current gpus don't have it so...

@gitoss
Copy link

gitoss commented Jun 10, 2024

The thing is, i just want the decoder part, hw encoder would be nice but my current gpus don't have it so...

It would have to be enabled for each possible --chunk-method ...

@barolo
Copy link
Author

barolo commented Jun 10, 2024

@gitoss Where should I put it in the case of lsmash? Vaporsynth stuff is totally alien to me.

@gitoss
Copy link

gitoss commented Jun 10, 2024

@gitoss Where should I put it in the case of lsmash? Vaporsynth stuff is totally alien to me.

My guess: To be able to work without split files (i.e. direct lsmash, bestsource or ffms2 mode) the change has to be somewhere the av1an source - I have no idea where, never bothered to learn Python or look at the py files.

Or you could load the video through a bare bones Vapoursynth script, enabling hw decoding in the respective line in the vpy file (sample w/o hw decoding param).

from vapoursynth import core
clip = core.bs.VideoSource(source='video.mkv')
clip.set_output()

@barolo
Copy link
Author

barolo commented Jun 11, 2024

@gitoss Where should I put it in the case of lsmash? Vaporsynth stuff is totally alien to me.

My guess: To be able to work without split files (i.e. direct lsmash, bestsource or ffms2 mode) the change has to be somewhere the av1an source - I have no idea where, never bothered to learn Python or look at the py files.

Or you could load the video through a bare bones Vapoursynth script, enabling hw decoding in the respective line in the vpy file (sample w/o hw decoding param).

from vapoursynth import core
clip = core.bs.VideoSource(source='video.mkv')
clip.set_output()

Av1an uses Rust doesn't it? I might be able to do it. We'll see.

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

2 participants