Open sumnerevans opened 6 years ago
Work is happening on the ipfs-source
branch.
One difficulty here is that MPV does not natively understand how to open IPFS files. We need to create a mechanism for piping ipfs cat
into MPV.
It sounds like we could unify asset files and assets themselves. For example, the following could be changed from
CoolestVidEver: /home/user/videos/coolvid.mp4
to
CoolestVidEver: file:/home/user/videos/coolvid.mp4
where the constructor for the file source would be called to try and parse what CoolestVidEver points to. A similar system could be used for IPFS. If we had CoolestVidEver: ipfs:/home/user/videos/coolvid.mp4
then the constructor could run the ipfs cat command and returns a dictionary like {CoolestVidEver: /tmp/cache/coolvid.mp4}
Hmm... what if the video is larger than the free disk space? You would want to stream in this case...
Is there a way to stream raw data to MPV? I see we can tell it to read from stdin at launch but I don't see anything in libmpv about it.
IPFS may be a good way to handle local caching. We should allow sources to be specified as IPFS hashes.