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

Add encode_lazy method to CodecContext #1092

Merged
merged 2 commits into from
Nov 25, 2023

Commits on Feb 25, 2023

  1. [codec context] Add decode_lazy() returning 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 adds a `encode_lazy` yielding frames as they are made ready.
    
    The change was benchmarked to also yield a net performance improvement. For
    both `encode()` and `encode_lazy` encoding really small (24x18) frames
    using the `mpeg4` encoder seem to take ~11% less time.
    rawler committed Feb 25, 2023
    Configuration menu
    Copy the full SHA
    9f3b419 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2023

  1. Use method in tests

    WyattBlue committed Nov 25, 2023
    Configuration menu
    Copy the full SHA
    e9f740b View commit details
    Browse the repository at this point in the history