Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P PyAV
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 37
    • Issues 37
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyAV
  • PyAV
  • Merge requests
  • !1092

[codec context] Add decode_lazy() returning a generator

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Ulrik Mikaelsson requested to merge github/fork/rawler/generator-encode-decode into main Feb 25, 2023
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 2

Some codecs (libvpx-vp9) can both buffer many frames, and take a long time encoding each frame. Accumulated, the last encode(None)-flush can end up 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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/rawler/generator-encode-decode