|
| Author |
Message |
krkeegan Site Admin

Joined: 04 Jan 2008 Posts: 458 Location: Los Angeles, CA
|
Posted: Tue Feb 12, 2008 1:37 am Post subject: New: PreCache Files so TiVo Loads Faster |
|
|
This is a Deprecated feature of pyTivo - This feature was a benefit under previous designs of pyTivo. However it is no longer necessary under the current design of pyTivo. It is recommended that all users no longer use the precache feature
All uploaded, sorry about the delay.
This will cause pyTivo parse all files recursively in a share to load them into the cache. Currently this only works in the video plugin, but incorporation into other plugins that use a cache is very easy.
In the video plugin this causes pyTivo to run ffmpeg on EVERY video file in that share and stores that information in the cache.
Benefits: This greatly decreases the load time while browsing on the TiVo. For me a folder with 50 videos would take 18 seconds to load the first time I viewed it. Now it takes less than 2 seconds.
Drawbacks: This will create a delay in the startup of pyTivo while processing the files. For me I experienced a delay of nearly 2 minutes to parse 757 video files.
Usage:
Set the precache=true under any share. If the plugin does not support the precache setting it is ignored.
Example:
In the following conf file the share "Old TV" would be precached while "Movies" and "Photos" would not be.
[Old TV]
type = video
path = /store/TV
precache=true
[Movies]
type = video
path = /store/Movies
[Photos]
type = photo
path = /store/Photos
[Server]
debug = true
ffmpeg = /usr/bin/ffmpeg
hack83 = true
port = 9032
Last edited by krkeegan on Sun Apr 27, 2008 5:58 pm; edited 2 times in total |
|
| Back to top |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2008 Location: Maryland
|
Posted: Tue Feb 12, 2008 2:19 am Post subject: |
|
|
And how does this deal (or does it deal) with the case of a new video being added? Does it it require a restart? _________________ My pyTivo fork . My page |
|
| Back to top |
|
 |
billdog79
Joined: 05 Jan 2008 Posts: 57 Location: Gulf Breeze, FL
|
Posted: Tue Feb 12, 2008 2:20 am Post subject: |
|
|
The initial load time isn't really a big deal to me because I leave pyTivo running all of the time on a separate computer. I only have to deal with it when I upgrade.
But there are probably many users who use this on their main computer and shut it down often. I was wondering if there was a way to have the cache saved between pyTivo sessions.
Would this be difficult or impossible to do?
That being said, even if the above isn't able to be done, I like Krkeegan's approach better to have all of the files scanned at startup, rather than a folder by folder basis. Get it out of the way all at once. |
|
| Back to top |
|
 |
windracer

Joined: 04 Jan 2008 Posts: 219 Location: St. Pete, FL
|
Posted: Tue Feb 12, 2008 2:53 am Post subject: |
|
|
| billdog79 wrote: | TI like Krkeegan's approach better to have all of the files scanned at startup, rather than a folder by folder basis. Get it out of the way all at once. |
This is what TiVo.Net used to do ... the side-effect being what wmcbrine is alluding to: what happens when a new file is added to the folder? TiVo.Net had to be re-started (or you clicked the Refresh button in the GUI) which was a little annoying. _________________ pyTiVo on Ubuntu 11.10 (Oneiric) |
|
| Back to top |
|
 |
PaulS
Joined: 05 Jan 2008 Posts: 184
|
Posted: Tue Feb 12, 2008 4:03 am Post subject: |
|
|
The cache would need to maintain a list of the files in a given directory, as well as the "last modified time" for each of those files.
Ideally, when you navigate into that directory, you compare the current list of files/times with what you've got in cache. At that point, you only need to run the un-cached files or previously cached files that have been modified through ffmpeg, as well as updating the cache to include those changes. Should still present a very significant performance boost.
Alternately, there could be a background task which would periodically recurse through the shares and do the cache updating.
Either of these scenarios wouldn't require a restart to incorporate newly added files into the shares. |
|
| Back to top |
|
 |
wgw
Joined: 06 Jan 2008 Posts: 284
|
Posted: Tue Feb 12, 2008 4:25 am Post subject: |
|
|
I think it's safe to say we're all foaming at the mouth in anticipation of your new enhancement. Come on 8:30. _________________ Download pyTivo
my pyTivo branch |
|
| Back to top |
|
 |
wmcbrine

Joined: 04 Jan 2008 Posts: 2008 Location: Maryland
|
Posted: Tue Feb 12, 2008 4:49 am Post subject: |
|
|
| wgw wrote: | I think it's safe to say we're all foaming at the mouth in anticipation of your new enhancement. |
No offense, but I'm reserving judgement, actually. I'd already cut the entering-a-directory time down to almost nothing with filtering by extension. (That 18 seconds for 50 files wasn't still the case with that, was it? I can get a recursive listing of 399 files in less than 2 seconds. I don't even like to think about how long it used to take...) And I'm not crazy about adding a startup delay. But it would cut down the page-down time.
Big start-up delays remind me unpleasantly of Tivo Desktop... _________________ My pyTivo fork . My page |
|
| Back to top |
|
 |
krkeegan Site Admin

Joined: 04 Jan 2008 Posts: 458 Location: Los Angeles, CA
|
Posted: Tue Feb 12, 2008 5:17 am Post subject: |
|
|
Ok all posted here
| Quote: | No offense, but I'm reserving judgement, actually. I'd already cut the entering-a-directory time down to almost nothing with filtering by extension. (That 18 seconds for 50 files wasn't still the case with that, was it? I can get a recursive listing of 399 files in less than 2 seconds. I don't even like to think about how long it used to take...) And I'm not crazy about adding a startup delay. But it would cut down the page-down time. |
Wow absolutely no faith in me.
While I agree your fileextensions helped shorten the time period it still has to make an ffmpeg call for EVERY file in a directory when first displaying it in order to show the duration. So I have my doubts that you can do 50 files in 2 seconds. Your recursive list doesnt show duration that is why it loads so fast. But the XML pages have duration on them so they take longer to load.
Ok no more complaining. Go have fun. |
|
| Back to top |
|
 |
wgw
Joined: 06 Jan 2008 Posts: 284
|
Posted: Tue Feb 12, 2008 5:32 am Post subject: |
|
|
The delay on my computer was 25 seconds for 200 files. Page down is very fast. Well worth the startup delay for me. Thanks. And no problems finding new files. Or removing deleted files. _________________ Download pyTivo
my pyTivo branch |
|
| Back to top |
|
 |
TreborPugly
Joined: 05 Jan 2008 Posts: 55
|
Posted: Tue Feb 12, 2008 9:58 pm Post subject: |
|
|
Does this also combine smack's mini-fix for subfolders with hack83?
The big benefit I'm looking for is on my networked share, which is always slow, and the most likely to get crashy on me, and is fairly deeply subfoldered. (it also has my less-used stuff, so if I really want to show my kids something from there, I have the leisure to just add a specific sub-folder where the files in question are, or I can move them to a top-level directory, etc...)
But I have a new laptop waiting for me at home, running XP, and I'm planning to get pyTivo off this inexplicably slow Vista machine I've been using. (Everything is slow, not just pyTivo - either Vista really wants to screw me over, or I've got a processor going bad or something equally unpleasant) |
|
| Back to top |
|
 |
krkeegan Site Admin

Joined: 04 Jan 2008 Posts: 458 Location: Los Angeles, CA
|
Posted: Tue Feb 12, 2008 11:00 pm Post subject: |
|
|
| TreborPugly wrote: | Does this also combine smack's mini-fix for subfolders with hack83? | Yes that is included as well. |
|
| Back to top |
|
 |
wgw
Joined: 06 Jan 2008 Posts: 284
|
Posted: Wed Feb 13, 2008 3:04 am Post subject: |
|
|
| wmcbrine wrote: | No offense |
Likewise, and none taken. I was making fun of all of us, including myself, for wanting to try out the new mod and see if worked how we hoped it would. I think it's a success. Good work! But I plan to use it in conjunction with your video.ext mod to display the files I want in my now playing list. Both mods are a great success in my opinion. Thank you! _________________ Download pyTivo
my pyTivo branch |
|
| Back to top |
|
 |
krkeegan Site Admin

Joined: 04 Jan 2008 Posts: 458 Location: Los Angeles, CA
|
Posted: Wed Feb 13, 2008 3:49 am Post subject: |
|
|
| wgw wrote: | I plan to use it in conjunction with your video.ext mod to display the files I want in my now playing list. Both mods are a great success in my opinion. Thank you! |
I also agree they work best in conjunction. The video.ext mod is also nice because it keeps unnecessary files out of the cache. |
|
| Back to top |
|
 |
PaulS
Joined: 05 Jan 2008 Posts: 184
|
Posted: Wed Feb 13, 2008 4:42 am Post subject: |
|
|
| Wow! The combination of pre-cache and video.ext really makes for a significant performance improvement. Browsing around various pyTivo served folders in NPL is instantaneous. Excellent work, guys! |
|
| Back to top |
|
 |
TreborPugly
Joined: 05 Jan 2008 Posts: 55
|
Posted: Wed Feb 13, 2008 3:07 pm Post subject: |
|
|
working well on my new laptop running Windows XP.
My old one is seriously messed up I think. When sending a file to the Tivo, ffmpeg was using 40% of the CPU time. On this new laptop, which has only slightly faster processors. (both dual core), it uses about 5% CPU time.
I just quickly went two subfolders down on my network share! No crashes, no funky listings, no waiting. I bow before your awesomeness! |
|
| Back to top |
|
 |
|