Closed riaqn closed 2 years ago
Hey there!
There is no straightforward way to use a file-like object (yet). However, with MPV.register_stream_protocol
it should be fairly easy to build your own. Check out the docstring behind the link above for details. This method is what sits behind the whole python://
magic, and has seeking support. Be a bit careful though, since if you return bad values e.g. from size()
, libmpv will be very unhappy and take down your entire python process using abort()
.
Feel free to open a new issue if you have more questions.
Currently we do have support for
python://
, which however would be quite slow if mpv seeks backward: the generator would have to be called from the beginning again. I wonder if we can support a file-like object with random access capability?