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!!