-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[codec context] Let decode return a generator
Some codecs (VP9) can both buffer _many_ frames, and take a long time encoding each frame. Accumulated, the last `encode(None)`-flush can end taking a long time >30s, without detectable progress. FFmpeg and many encoders themselves output one frame at a time, but PyAV currently buffer them all up into lists returned. This change redefines encode, to yield frames as they are made available. The change was benchmarked to also yield a net performance improvement - about 16% less time elapsed when encoding really small (24x18) frames using the `mpeg4` encoder.
- Loading branch information
Showing
2 changed files
with
7 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters