Closed redstoneleo closed 5 years ago
The obvious way would be mpv's memory://
protocol, but I'd advise against that for anything beyond a few megabytes. You could try stuffing it into some mmap'ed shm buffer and shove the fd into mpv using the fd://
protocol but it'd be hard to get one of those in python. I think I'd do this by simply dumping the bytes into a named temporary file and simply playing that.
Thanks ! Is it easy to implement that dumping the bytes into an io.BytesIO object and then playing it ? And what should I do ?
BytesIO works with python's read
and write
, but doesn't give you an fd that you could pass into libmpv.
Any way to play bytes object in python-mpv? For example , how to play the contents in Axel in the following ?