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
  • #507
Closed
Open
Issue created Apr 17, 2019 by Administrator@rootContributor

Encoding frames error: Errno 22 Invalid Argument

Created by: flewellyn

I am attempting to create a "preview" of a video, using key frames. Here is the logic:

instream = invid.streams.video[0]

outvid = av.open('001_prev.mov')
outstream = outvid.add_stream(template=instream)

outstream.time_base = instream.time_base

instream.codec_context.skip_frame = 'NONKEY'

for frame in invid.decode(instream):
    packet = outstream.encode(frame)
    outvid.mux(packet)

outvid.close()

According to the docs, this should work, but the outtream.encode() call fails with Errno 22. I have no idea why. The frame itself is correct: when I use frame.to_image() and save a JPEG, it works just fine.

Assignee
Assign to
Time tracking