Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !718
An error occurred while fetching the assigned milestone of the selected merge_request.

Implement custom io_open/io_close support in container

  • Review changes

  • Download
  • Email patches
  • Plain diff
Administrator requested to merge github/fork/philipnbbc/philipn-custom-io-in-format-context into main 4 years ago
  • Overview 14
  • Commits 12
  • Pipelines 0
  • Changes 9

Created by: philipnbbc

This PR adds an io_open option to av.open() which allows a client to provide a custom I/O. The io_open function is called with parameters url, flags, and options when a new file needs to be opened.

The existing file I/O was factored out into the PyIOFile class, with the addition of the fclose method. This class is used for the main file as well as for any files opened by the container.

Custom I/O has been used with the FFmpeg DASH encoder and could be used with containers that uses the io_open and io_close callbacks in the AVFormatContext. The test shows how it can be used with the DASH encoder by using a CUSTOM_IO_PROTOCOL prefix to direct the DASH encoder to use the custom I/O.

Approval is optional

Merge details

  • 1 commit and 1 merge commit will be added to master.
  • Source branch will not be deleted.

Activity


  • Jeremy Lainé added changes requested label 3 years ago

    added changes requested label

  • Jeremy Lainé mentioned in merge request !918 (closed) 3 years ago

    mentioned in merge request !918 (closed)

  • Jeremy Lainé mentioned in merge request !919 (merged) 3 years ago

    mentioned in merge request !919 (merged)

  • Jeremy Lainé
    Jeremy Lainé @jlaine started a thread on commit 4ebd4548 3 years ago
    Last updated by Administrator 3 years ago
    scripts/build-deps
    44 44 --enable-debug=3 \
    45 45 --enable-gpl \
    46 46 --enable-libx264 \
    47 --enable-libxml2 \
    • Jeremy Lainé
      Jeremy Lainé @jlaine · 3 years ago
      Contributor

      Why these changes?

    • Administrator
      Administrator @root · 3 years ago
      Author Contributor

      Created by: philipnbbc

      I've simplified it in https://github.com/PyAV-Org/PyAV/pull/718/commits/cc5b261e80122e46853609bb01f718becf6da26e to just enable libxml2. The DASH demuxer, which is used in the tests, is not enabled if libxml2 is not enabled; libxml2 is used to read the DASH manifest XML file.

    • Jeremy Lainé
      Jeremy Lainé @jlaine · 3 years ago
      Contributor

      Would a test which writes a sequence of PNG files also make sense?

      Do by all means keep your DASH test as it gives us a real-life example.

    • Administrator
      Administrator @root · 3 years ago
      Author Contributor

      Created by: philipnbbc

      I think that would be worth doing (added in https://github.com/PyAV-Org/PyAV/pull/718/commits/d4b23725cb18303bdf809730156889d2c452e92b) and it actually exposed a bug that the DASH muxer hadn't (fixed in https://github.com/PyAV-Org/PyAV/pull/718/commits/d8f096baab46cb470fc78eda5b43ac49a122ceeb).

  • Jeremy Lainé
    Jeremy Lainé @jlaine started a thread on an outdated change in commit 4ebd4548 3 years ago
    Last updated by Jeremy Lainé 3 years ago
  • Jeremy Lainé
    Jeremy Lainé @jlaine started a thread on an outdated change in commit 4ebd4548 3 years ago
    Last updated by Administrator 3 years ago
  • Jeremy Lainé
    Jeremy Lainé @jlaine started a thread on commit d23e1f4d 3 years ago
    Last updated by Administrator 3 years ago
    av/container/core.pyx
    251 333 def open(file, mode=None, format=None, options=None,
    252 334 container_options=None, stream_options=None,
    253 335 metadata_encoding='utf-8', metadata_errors='strict',
    254 buffer_size=32768, timeout=None):
    336 buffer_size=32768, timeout=None, io_open=None):
    • Jeremy Lainé
      Jeremy Lainé @jlaine · 3 years ago
      Contributor

      This io_open argument needs a docstring explaining what the expected signature is, and how to use it.

    • Administrator
      Administrator @root · 3 years ago
      Author Contributor

      Created by: philipnbbc

      Added in https://github.com/PyAV-Org/PyAV/pull/718/commits/d84cc95b17d8dae6ac2b3329851d00fc7cda0d76

  • Jeremy Lainé
    Jeremy Lainé @jlaine started a thread on an outdated change in commit d23e1f4d 3 years ago
    Last updated by Administrator 3 years ago
  • Administrator requested review from @jlaine 3 years ago

    requested review from @jlaine

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Merged by: jlaine at 2022-03-31 21:29:02 UTC

  • Jeremy Lainé closed 3 years ago

    closed

Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: github/fork/philipnbbc/philipn-custom-io-in-format-context

Menu

Explore Projects Groups Snippets