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
  • Issues
  • #577
Closed
Open
Issue created Dec 09, 2019 by Administrator@rootContributor

Allow different interpolation to VideoFrame.reformat

Created by: legraphista

Overview

There is no way to scale a video frame with other interpolation methods. SWS_BILINEAR is the best fit as a default, but for speed you would want SWS_FAST_BILINEAR, and SWS_POINT(neighbor) for up-scaling small frames (64x64) to better visualize them and keeping the information clean.

Using OpenCV would be an option but there are too many hoops to jump through. It's way faster to do in the native libav API.

Desired Behavior

Ability to use different interpolation for resizing a video frame. Right now it's hardcoded to use SWS_BILINEAR

Example API

frame.reformat(width=width,
               height=height,
               interpolation='neighbor')
# or maybe even better
frame.reformat(width=width,
               height=height,
               interpolation=av.video.interpolation.NEIGHBOR)

Additional context

Location of hardcoded flags: https://github.com/mikeboers/PyAV/blob/ae64e1ba52bea3cb72cfec473233f5137d0c1bda/av/video/frame.pyx#L200-L212

Assignee
Assign to
Time tracking