pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New: PreCache Files so TiVo Loads Faster
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo
 View previous topic :: View next topic  
Author Message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Tue Feb 12, 2008 1:37 am    Post subject: New: PreCache Files so TiVo Loads Faster Reply with quote

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
View user's profile Send private message Visit poster's website
wmcbrine



Joined: 04 Jan 2008
Posts: 2008
Location: Maryland

PostPosted: Tue Feb 12, 2008 2:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
billdog79



Joined: 05 Jan 2008
Posts: 57
Location: Gulf Breeze, FL

PostPosted: Tue Feb 12, 2008 2:20 am    Post subject: Reply with quote

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
View user's profile Send private message
windracer



Joined: 04 Jan 2008
Posts: 219
Location: St. Pete, FL

PostPosted: Tue Feb 12, 2008 2:53 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
PaulS



Joined: 05 Jan 2008
Posts: 184

PostPosted: Tue Feb 12, 2008 4:03 am    Post subject: Reply with quote

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
View user's profile Send private message
wgw



Joined: 06 Jan 2008
Posts: 284

PostPosted: Tue Feb 12, 2008 4:25 am    Post subject: Reply with quote

I think it's safe to say we're all foaming at the mouth in anticipation of your new enhancement. Razz Come on 8:30.
_________________
Download pyTivo
my pyTivo branch
Back to top
View user's profile Send private message
wmcbrine



Joined: 04 Jan 2008
Posts: 2008
Location: Maryland

PostPosted: Tue Feb 12, 2008 4:49 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Tue Feb 12, 2008 5:17 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wgw



Joined: 06 Jan 2008
Posts: 284

PostPosted: Tue Feb 12, 2008 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message
TreborPugly



Joined: 05 Jan 2008
Posts: 55

PostPosted: Tue Feb 12, 2008 9:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Tue Feb 12, 2008 11:00 pm    Post subject: Reply with quote

TreborPugly wrote:
Does this also combine smack's mini-fix for subfolders with hack83?
Yes that is included as well.
Back to top
View user's profile Send private message Visit poster's website
wgw



Joined: 06 Jan 2008
Posts: 284

PostPosted: Wed Feb 13, 2008 3:04 am    Post subject: Reply with quote

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
View user's profile Send private message
krkeegan
Site Admin


Joined: 04 Jan 2008
Posts: 458
Location: Los Angeles, CA

PostPosted: Wed Feb 13, 2008 3:49 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PaulS



Joined: 05 Jan 2008
Posts: 184

PostPosted: Wed Feb 13, 2008 4:42 am    Post subject: Reply with quote

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
View user's profile Send private message
TreborPugly



Joined: 05 Jan 2008
Posts: 55

PostPosted: Wed Feb 13, 2008 3:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> pyTivo All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group
phpBB SEO

Get pytivo at SourceForge.net. Fast, secure and Free Open Source software downloads
[ Time: 0.2346s ][ Queries: 12 (0.0086s) ][ GZIP on - Debug on ]