Repository navigation
FEAT: New Plugin for pyAV - #745
Conversation
|
@hmaarrfk I saw your name pop up while reading through the pyAV issues. Do you have any interest in a plugin like this? |
31b1ef8 to
9210c93
Compare
|
(between .3x - 10x times faster in my naive timings). Did you forget a 1 somewhere? |
True. it's 1.3x - 10x as fast. 1.3x (30% faster) for bulk reading of an entire video (where decoding dominates runtime), about 5x faster for first frame access (where setup cost dominates), and 10x faster for a random frame (where seeking dominates). Although the seeking depends heavily on the contents of the file and how keyframes are distributed, so that number should be taken with some salt. |
|
For what its worth, I've been trying to get the hardware decoders in reasonable versions of ffmpeg to work. I think I got the intel ones in conda-forge. I tried to get nvidia ones in, but I think there are some intriciacies with dependencies and driver versions. So i am generally interested in speedups :D but not sure how to help at this point. I might be able to give a review if that is what you want? |
|
Is there a way to hide codecov from the PR? it is really annoyign to read it. |
Sure that would help :) Though, I wouldn't want to take up too much of your time at this stage. Maybe I can ping you once the PR is RTR (so that, among other things, the codecov messages are gone ;) ). I primarily pinged you for awareness, because I thought you could be interested in a feature like this. I haven't yet figured out a good way to disseminate news around ImageIO nor a good way to estimate interest in new/upcoming features, so this is also partly me figuring out a good way to go about this. Ideas are welcome :D
Interesting. I've always thought of hardware acceleration (especially via GPU) as something that encoding benefits from, but decoding not so much. Primarily, because sending data back and forth isn't exactly cheap. Do you know of a benchmark for this? (I did some searching yesterday, but didn't find any comparisons beyond people guesstimating) On that note, you are probably aware of this note in pyAV that hardware acceleration won't be supported. Not sure how much we can do from here without adding new features to pyAV (e.g., to expose the required config). |
|
Thanks for looking into this! |
@hmaarrfk Ah, so you are mainly interested in encoding/writing of video? |
|
Decoding too! It is very useful when dealing with large stacks of images! |
1e3b34d to
aaa30ed
Compare
|
I am done with the bulk of the work for this. I still need to write some narrative docs and fix pypy (though I think it breaks because of the new astropy and not because of pyav), but the code is there and it is covered by tests. @hmaarrfk Would you have the time in the coming days to review the code section of this PR (the file pyav.py)? |
hmaarrfk
left a comment
There was a problem hiding this comment.
Just a few comments for now.
|
Nice! I just sorted out the pending suggestions from your reviews @almarklein , @hmaarrfk (thanks for taking the time!). I also sorted out the astropy failures on pypy [by no longer installing astropy, because I can't work out where/why it fails and I also can't reproduce the failure locally]. What's left? |
|
Anything I can do to help test this or otherwise help get it out the door? |
|
@daveisfera I can"t think of anything specific from the top of my head. The main thing that is missing is approval from @almarklein and - perhaps - some documentation, which I will look into after I finished #769). If you want, you could help proofreading the docs and see if they are intelligible and user friendly, or - depending on your level of expertise, time, and interest - you can also review the PR itself and see if there is anything that you think should be added or changed. |
|
LGTM, but CI does not approve yet? |
|
One of the things it will trip over is the changes in pillow 9.1 which break our CI. We've merged the PR that fixes this already, but I still have to rebase this PR on them. Will do soon(TM). |
Co-authored-by: Almar Klein <[email protected]>
Co-authored-by: Almar Klein <[email protected]>
Co-authored-by: Almar Klein <[email protected]>
4e22e78 to
4db0e95
Compare
|
The time has finally come. Once CI is happy, I will merge the pyav plugin, Thanks @almarklein @hmaarrfk @daveisfera for your feedback and discussion. |
Closes: #610, #220, #686
This PR adds a pyAV plugin to ImageIO using the v3 API. This is in parallel to our imageio-ffmpeg plugin, because (a) it doesn't have feature parity and (b) I still need to work out how well maintained pyAV is. One of the reasons why we still want to have a pyAV plugin is because pyAV is more performant and - depending on the task - I get a 3x -10x speedup by switching to this plugin.
Other features:
index=None)Planned features for upcoming PRs:
core.Requeststo accept relevant schemes)