Request: End Constant Buffering - appropriate cache program
#1
Rainbow 
Hey folks,

I've been thinking about buffering/caching on XBMC. I'm wondering if we could write the coding for a python module that could be used by all streaming scripts (indeed it might be a good idea to look at eventually integrating something like this into XBMC itself).

Here's what I've been thinking:

Getting an appropriate amount of cache is a delicate balance. Some places, like stage6 for example, work well with very little cache.

Others - such as Todou or goba are pathetic.

I think a good idea would be to write a definition in the relevant module that could be used in these programs to figure out an optimum amount of cache to download rather than just rely on XBMC's settings.

Here's how it would have to work:

1. Find out the file size of the file to be streamed (I assume this is easily possible with the urllib but i'm not sure!)

2. Get the running time of the file.

3. Download a test amount and time it (best not to time the first couple of seconds download as it sometimes appears spuriously fast...).

4. Do the maths to figure out how fast the target download speed is (roughly filesize/(running time in seconds). Figure out how long it took to do the specified amount. If the download speed is higher than the filesize then don't do anything to the cache amount.

5. If it is slower then figure out how much can be downloaded at the measured speed (measured-download-speed x Length of file being streamed = amount which can be downloaded) in the running time of the episode and set the cache amount to total-file-size - amount which can be downloaded.

6. Figure out an estimate for how long downloading the required cache amount will take and display it on the screen so the user will know.

Then, if this option was selected, people can opt to have a long wait rather than an unwatchable stream which pauses every 4 seconds.

Adapting scripts to include this would be as easy as editing them to include the new definition....I think!

My Python scripting for xbox isn't quite ready for this yet (still learning gui stuff but I'll get there soon - learning on PSP, XBox and windows/linux/macos via ktinker all at once means slow progress on the gui front!)
Reply

Logout Mark Read Team Forum Stats Members Help
Request: End Constant Buffering - appropriate cache program0