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
  • #1010
Closed
Open
Issue created Jul 19, 2022 by Administrator@rootContributor

PyAV should be able to use ffmpeg support for output to RTMP/SRT protocols

Created by: zubindittia

Overview

PyAV should support output to URLs for RTMP and SRT (these are supported by ffmpeg).

Desired Behavior

Currently, the av.open() function appears to only support writing to file or file-like objects. If we pass a RTMP or SRT url as the 'file' argument to av.open(), it does not seem to work. Specifically, if we use a RTMP URL with video codec set to flv, or a SRT URL with video codec set to mpegts, then we seem to be outputting to the URL even if the URL corresponds to a server that does not exist. For example, if we output flv video to rtmp://127.0.0.1:1234/foo and there is no server running at that URL, the output goes to a black hole and there is no indication that we could not connect to that server (ffmpeg reports a connect error in the same situation).

Example API

Ideally, just replacing the file in av.open() with an output URL should work seamlessly, and we should be able to find out if there was an error connecting to the server:

output_container = av.open('rtmp://127.0.0.1:1234/foo', 'w', format = 'flv') output_container = av.open('srt://127.0.0.1:1234/foo', 'w', format = 'mpegts')

When we start outputting frames to the container is when presumably libav is trying to connect to the server, and if there is an error at that point, the output should fail or an exception should be thrown.

Additional context

Assignee
Assign to
Time tracking