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
  • #738
Closed
Open
Issue created Feb 03, 2021 by Administrator@rootContributor

How do I use os.pipe() to feed data to an av container?

Created by: zhengwei-coding

Overview

Dear all, i am trying to use pyav to decode a local file with a customized format. I uses pipe's write-end to feed the data in while pipe's read-end file object to pass to av.open(file) for decoding. However, it seems av.open(read_pipe) always throw TypeError.

My code and actual behaver is as follow:

import os, av
r, w = os.pipe() fr = os.fdopen(r, 'rb') fw = os.fdopen(w, 'wb') ct = av.open(fr) Traceback (most recent call last): File "", line 1, in File "av\container\core.pyx", line 354, in av.container.core.open File "av\container\core.pyx", line 117, in av.container.core.Container.cinit TypeError: File's name attribute must be string-like.

I am wondering if it just doesn't support a file object with the name being a number (fdopen seems to return a file object which's name is the fd (type int instead of string) or i did anything wrong here...

Thanks for the help!!

Assignee
Assign to
Time tracking