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

Could we specify the codec used for decoding? #1530

Open
hmaarrfk opened this issue Sep 18, 2024 · 1 comment
Open

Could we specify the codec used for decoding? #1530

hmaarrfk opened this issue Sep 18, 2024 · 1 comment

Comments

@hmaarrfk
Copy link
Contributor

codec = lib.avcodec_find_decoder(stream.codecpar.codec_id)

It would be great if we could have a way to override this default.

For example, on my machine, I have:

$ /usr/bin/ffmpeg -hide_banner -decoders | grep h264
 VFS..D h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 decoder wrapper (codec h264)
 V....D h264_qsv             H264 video (Intel Quick Sync Video acceleration) (codec h264)
 V..... h264_cuvid           Nvidia CUVID H264 decoder (codec h264)
 V..... libdav1d             dav1d AV1 decoder by VideoLAN (codec av1)
 V....D libaom-av1           libaom AV1 (codec av1)
 V....D av1                  Alliance for Open Media AV1
 V..... av1_cuvid            Nvidia CUVID AV1 decoder (codec av1)
 V....D av1_qsv              AV1 video (Intel Quick Sync Video acceleration) (codec av1)

and it would be awesome to be able to change the one that is used at runtime for performance optimization based on the user's hardware.

For example there seems to be the find_decoder_by_name function
https://ffmpeg.org/doxygen/7.0/group__lavc__core.html#gad4e08a758f3560006145db074d16cb47

I'm not sure if you have a good idea for how to do this, but it would be great if it could be done! Thanks!

@hmaarrfk
Copy link
Contributor Author

PS. I know that you yourself are not using /usr/bin/ffmpeg in the package on pypi but I am integrating this with conda-forge's ffmpeg, where we do have some control over the number of shipped codecs. Most specifically, I am interested in playing with the intel QSV decoder! Thanks!

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

1 participant