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
  • #784
Closed
Open
Issue created May 07, 2021 by Administrator@rootContributor

Can't set video stream time_base

Created by: hubeichenxing

Hi, i have try to set video stream time_base with code bellow:

output = av.open("out.mp4", 'w')
stream = output.add_stream('h264', 24)
stream.pix_fmt = 'yuv420p'
stream.height = im_height
stream.width = im_width
stream.time_base = Fraction(1, 24)
print(stream.time_base)
print(stream.codec_context.time_base)

The command line output:

None
1/24

It means that the stream.time_base is not be assigned but stream.codec_context.time_base get it. I use the container output to save a video, the time_base of packets is 1/12288 or other number, not 1/24. I want to save a video that the time_base of AVStream set with me, how can i do ?

Assignee
Assign to
Time tracking