Copy video before playing using add-on or external player definition?
#1
I was trying to set things up so that when I played a video, it would copy it from it's library location (mech disk array) to a secondary location (ssd or flash) then start playing from that copy. It probably sounds dumb but I'm trying to run absolute minimum power draw living off grid in an RV with a few solar panels and golf cart batteries, and a mech disk in my dock for a 2 hour movie eats 2-3% of my daily power. This would be on ubuntu and/or a raspberry pi.

I have it working using the external player config I call "Pre-Cache video" - just a bash script that copies the media to my location. But then I have to browse videos->files to that file and play it, rather than just hitting Open... again from the currently selected video. It's ok, but not very tidy.
I'd be happy with doing the same thing if I could have a second step "Open..." with another external script that could swap the library path with my temporary copied path - somthing like 'Play from Pre-Cache". I can do this if I define a true external player, but I want to use kobi's native player and don't see a way to do that path manipulation and launch internally.

Alternately, I was wondering if there might be a way to do this with a add-on? It didn't seem like a behavior suited for an add-on from what I could tell reading around the wiki, but maybe I'm not seeing some ideas. I definitely don't want to lose the whole library navigation functionality of Kobi.

Any ideas?
Reply
#2
It sounds like you want to cache the movie to disk while playing so you do not use the disk array during the full 2 hours. If so, why not just use option 0 for cachemembuffersize with a high readbufferfactor.

http://kodi.wiki/view/HOW-TO:Modify_the_...e_settings
Reply
#3
That's interesting - I wasn't aware of that option, although I don't think it will quite do what I'm hoping. Sounds like it would take take a huge amount of memory to buffer the movie etc. I really want to turn the drive array completely off - they still burn some good juice even if the drive's parked.

It doesn't seem like add-on's are meant to act on library files - sounds like they are separate concerns. And I can't figure out how to use the internal player via an external player definition.
It may just not be possible without modifying the main kobi code - which I probably I'm not up to. Figured it was worth asking.
Reply
#4
Setting the cachemembuffersize to 0 will cache to the local disk such as your SSD. I have also mounted a flash drive in the location of the cache, which does work, but I had issues of cacheing all of the video and would sometimes stop playing early.. The problem I had may have been related to my system.
Reply
#5
I am thinking:

python script to turn the remote disk on, then copy the file to local disk then turn the storage disk off then play the cached file.

Add the python script as an external player via advanced settings.

Play via 'play using' in the context menu.

Edit: copy any subtitle files too!
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply

Logout Mark Read Team Forum Stats Members Help
Copy video before playing using add-on or external player definition?0