TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Underground Playground > Developers Corner
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 06-15-2011, 03:25 PM   #211
rrr22777
Registered User
 
Join Date: Jul 2002
Posts: 529
Quote:
Originally Posted by jbernardis View Post
rrr22777 - I'm just looking a bit closer at the code, and I think I know what happened. I just want to make sure my assumptions are accurate:

Since it appears you are new to pytivo also, I guessed that 1) you have no videos in your shares, and 2) you only have a single share.
...
Long time pytivo user. Also use streambaby but pytivo never crashes while steambaby does on some videos. Both are running on the same computer with the same ffmpeg binary.

As for pytivo only 1 video share but about 50 folders in that share with videos in various formats. Gives me an error saying it cannot transfer on all videos but only crashes on some foldesr. I am mostly looking into this app for the delete functionality. Can the ability to just initiate a regular download to tivo be added if the video does to conform to the right standard?

I can upload more debug info when I get home if you would like. 100% with the poster that said Tivo needs to learn a few things about how to display its NPL based on this app.
rrr22777 is offline   Reply With Quote
Old 06-15-2011, 03:35 PM   #212
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
It's interesting that it only crashes on some folders. This app does not process the files at all - it makes push requests to pytivo through its HTTP interface. All my app does, basically, is process directories and read some metadata information.

Whatever info you can get to me would be beneficial - particularly the contents of the directories that crash. I think for some reason my app thinks you have an empty directory but yet it is continuing to process it. I can't figure out why.

Also, do you know what version you are running? I just added a print statement at startup that displays the version number, but this wasn't in early versions. The version number is up near the top of the __init__.py file.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 05:40 PM   #213
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Version 0.5d definitely this time

This time I made certain of my posting - version 0.5d is definitely on git. It's probably best that this was delayed a day because I was able to address the concerns I mentioned yesterday. I now use LRU logic to maintain the last X images in memory. X is initially set to 100. It's currently not configurable because the cache is initialize at module import time and "normal" access to the config file is unavailable. I can parse the file myself if we find we need to be able to tune this parameter.

I limited it to 100 because I was concerned about memory use - especially on my system (which is my readynas server). Since the cache is maintained at the module level, I needed to add mutex protection; however, this also means that the cache will be maintained from one usage to the next. In addition to this, if you exit the app cleanly - by hitting left all the way out, the cache will be written to disk - so it will survive a stop/restart of the server (although the lru ordering will not survive a restart)

Overall, I'm not 100% on board with the cache. I think we gained sufficient performance gain my loading the images just in time rather that in advance. I think the marginal gain realized by the cache might not be worth the processing required. But again, we'll see how it goes.

rr22777:

I definitely found a hole in the logic that would have caused the exact problem you saw. Frankly I'm surprised it hasn't surfaced before now. Try this version and see if it solves your problem.

Version 0.5d 6/15/11
- added logic to load thumbnails just in time rather that ahead of time. This speeds up initial painting
of a page, but slows down navigation within the page. Beacuse of this,
- I added an image cache. If you exit the app cleanly - by hitting left all the way out - the cache is saved to disk
for future runs. The cache got too big to save to disk with every change, so this was a compromise. The cache uses lru
logic to keep the last X used images in memory. I had to choose some kind of limit here - I chose 100 for now - we'll
see how that works out. Also, the cache exists at the module level, but yet is accessed, and possible changed, at the
HME thread level. Because of this, I had to mutex exclusion around parts of the cache logic.
- added logic to scale the thumbnail to fit in the 320 pixel wide view frame. Thanks to wmcbrine for the picture
sample hme app that told me how to do this. Side effect of this - you need to have the python image lib (PIL) installed
- widened the right hand margin on the info page a bit
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 06:59 PM   #214
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
This time I made certain of my posting - version 0.5d is definitely on git. It's probably best that this was delayed a day because I was able to address the concerns I mentioned yesterday. I now use LRU logic to maintain the last X images in memory. X is initially set to 100. It's currently not configurable because the cache is initialize at module import time and "normal" access to the config file is unavailable. I can parse the file myself if we find we need to be able to tune this parameter.
Ooh. That's definitely much, much faster ( ~3 seconds vs. 39 seconds on an 800+ video share ), and the cache code seems to be working just fine, but the PIL code has introduced a bug. A large number of the .jpg files in my shares are still 0 bytes in length. (They are place-holders.) Whenever I try to select one of the videos whose thumbnail is 0 bytes in length, vidmgr locks up. I can exit the app in the TiVo by pressing the <TiVo> button (the left arrow does not work), but if I enter vidmgr again, it is still locked up. I have to restart pyHME to get it working again. I'm still working on getting thumbnails for all my videos, but at this point in time, nearly half are still 0 bytes.

Code:
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 560, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/share/pyhme/start.py", line 141, in __init__
    client_address, server)
  File "/usr/lib/python2.6/SocketServer.py", line 617, in __init__
    self.handle()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 323, in handle_one_request
    method()
  File "/usr/share/pyhme/start.py", line 232, in do_GET
    self._page(True)
  File "/usr/share/pyhme/start.py", line 186, in _page
    appinst.mainloop()
  File "/usr/share/pyhme/hme.py", line 1134, in mainloop
    while self.active and self.get_event():
  File "/usr/share/pyhme/hme.py", line 1187, in get_event
    handle(keynum, rawcode)
  File "/usr/share/pyhme/vidmgr/__init__.py", line 322, in handle_key_press
    self.handle_key_pressList(keynum, rawcode)
  File "/usr/share/pyhme/vidmgr/__init__.py", line 469, in handle_key_pressList
    self.drawScreen()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 768, in drawScreen
    self.drawScreenDetail()
  File "/usr/share/pyhme/vidmgr/__init__.py", line 942, in drawScreenDetail
    self.listing[self.indexDetail]['name'])
  File "/usr/share/pyhme/vidmgr/__init__.py", line 1424, in getThumb
    data = tc.getImageData(tfn)
  File "/usr/share/pyhme/vidmgr/thumbcache.py", line 129, in getImageData
    self.cache[filename]['data'] = resizePic(filename, self.width, self.height)
  File "/usr/share/pyhme/vidmgr/thumbcache.py", line 17, in resizePic
    pic = img.open(fn)
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1980, in open
    raise IOError("cannot identify image file")
IOError: cannot identify image file

lrhorer is offline   Reply With Quote
Old 06-15-2011, 07:07 PM   #215
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by lrhorer View Post
Ooh. That's definitely much, much faster ( ~3 seconds vs. 39 seconds on an 800+ video share ), and the cache code seems to be working just fine, but the PIL code has introduced a bug. A large number of the .jpg files in my shares are still 0 bytes in length. (They are place-holders.) Whenever I try to select one of the videos whose thumbnail is 0 bytes in length, vidmgr locks up. I can exit the app in the TiVo by pressing the <TiVo> button (the left arrow does not work), but if I enter vidmgr again, it is still locked up. I have to restart pyHME to get it working again. I'm still working on getting thumbnails for all my videos, but at this point in time, nearly half are still 0 bytes.
I can, and probably should, put a try block around that code. I'll get something out right away.

Great to hear the other changes are for the better.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 07:21 PM   #216
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
- added logic to scale the thumbnail to fit in the 320 pixel wide view frame. Thanks to wmcbrine for the picture
sample hme app that told me how to do this. Side effect of this - you need to have the python image lib (PIL) installed
You weren't clear in your e-mails why increasing the width of the view frame would be an issue, but I would definitely still like to lobby for a wider view frame, if it is at all a reasonable thing to implement in code. In my opinion, there is absolutely no question that this



and this



are far more impressive on-screen than this



and this



There's plenty of screen real-estate to support these pictures.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 07:27 PM   #217
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
I can, and probably should, put a try block around that code. I'll get something out right away.
Thanks! I suspect non-zero length, but still invalid, files might also cause the problem.

Quote:
Originally Posted by jbernardis View Post
Great to hear the other changes are for the better.
Oh, they are, they are. You rock, man!
lrhorer is offline   Reply With Quote
Old 06-15-2011, 07:28 PM   #218
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by lrhorer View Post
You weren't clear in your e-mails why increasing the width of the view frame would be an issue, but I would definitely still like to lobby for a wider view frame, if it is at all a reasonable thing to implement in code. In my opinion, there is absolutely no question that this

and this

are far more impressive on-screen than this

and this

There's plenty of screen real-estate to support these pictures.
I don't dispute the quality of the pics, and it's really simple code to have a different size image. It's just a question of layout.

Right now, the entire left half of the screen is devoted to the various lists, the right half for details. The top of the right is for description, and the area to the right of the image is for the sub menu (push/delete) and the tivo menu.

In the meantime, 0.5e is on git with the try block
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 07:51 PM   #219
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 08:10 PM   #220
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
In the meantime, 0.5e is on git with the try block
It works just great. Thanks, yet again.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 08:29 PM   #221
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.
Almost all of my thumbnails are taken from cover art, and so approximate a portrait layout. There are a number of exceptions. In addition to the photos above, which are thumbnails taken from some slideshows I produced using my own photographs, there are the following, none of which are portrait aspects:







My preference would be not to scale the images at all.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 08:40 PM   #222
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by lrhorer View Post
Almost all of my thumbnails are taken from cover art, and so approximate a portrait layout. There are a number of exceptions. In addition to the photos above, which are thumbnails taken from some slideshows I produced using my own photographs, there are the following, none of which are portrait aspects:


My preference would be not to scale the images at all.
That's all fine, but I'm not really talking about scaling. In the HME model, I have to define rectangular areas of the screen (called views) into which I place resources (such as text or images). Now these views CAN overlap, but I have certain aspets of the screen that need to be visible. The bottom line is that I need to devote a retangular area of the screen to these images and I don't want it to overlap with any of the other "controls". The question is do you want that to be landscape or portrait.

As far as scaling, I can change the scaling so that it only scales DOWN if images are too big. Aspect ratio will always be maintained.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 08:41 PM   #223
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
I don't dispute the quality of the pics, and it's really simple code to have a different size image. It's just a question of layout.

Right now, the entire left half of the screen is devoted to the various lists, the right half for details. The top of the right is for description, and the area to the right of the image is for the sub menu (push/delete) and the tivo menu.
That's a very reasonable argument. I counter, however, by pointing out that the user generally spends very little time with the sub-menu up. Most of the time is spent browsing the video list to decide which video(s) to transfer (or delete if the user has that funtion enabled - I don't). When the decision is made, the transfer is selected in a few moments and the user continues on browsing the list, or else exits vidmgr. As a test, I changed the view frame in your code to 600 pixels and selected a couple of shows to transfer. The small selection images dutifully popped up over the middle-ground photo for selection. It was not in the least objectionable, and the middle-ground photos were displayed in all their glory.

Of course, it is entirely your call, but my definite preference would be to allow the user to set / create whatever size and aspect he wanted for each individual photo, and have the system simply crop the picture (the way your code did originally) and not worry about the aspect. Even with thumbnails that are more nearly portrait aspect, re-sizing them produces some unpleasant results. That, and 444 pixels is too large for the height, IMO. It causes the photos to protrude down below the title frame, which causes the screen to look lopsided.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 08:55 PM   #224
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by lrhorer View Post
That's a very reasonable argument. I counter, however, by pointing out that the user generally spends very little time with the sub-menu up. Most of the time is spent browsing the video list to decide which video(s) to transfer (or delete if the user has that funtion enabled - I don't). When the decision is made, the transfer is selected in a few moments and the user continues on browsing the list, or else exits vidmgr. As a test, I changed the view frame in your code to 600 pixels and selected a couple of shows to transfer. The small selection images dutifully popped up over the middle-ground photo for selection. It was not in the least objectionable, and the middle-ground photos were displayed in all their glory.

Of course, it is entirely your call, but my definite preference would be to allow the user to set / create whatever size and aspect he wanted for each individual photo, and have the system simply crop the picture (the way your code did originally) and not worry about the aspect. Even with thumbnails that are more nearly portrait aspect, re-sizing them produces some unpleasant results. That, and 444 pixels is too large for the height, IMO. It causes the photos to protrude down below the title frame, which causes the screen to look lopsided.
We're both responding at the same time and our responses are criss-crossing

SO you're saying that when you made the view for the thumbnails the full width of the screen, that the submenus overlapping the image was not objectionable.

Actually looking at the code, it's only because I defined the thumbnail view BEFORE the submenu views that the submenu was even visible. But that''s OK - we can take advantage of that fact, even though that's not why it was done like this.

If I do this, It would remove the PIL dependency and quicken the response time a bit when navigating because there is less image processing going on. At the same time, it allows for more dramatic thumbnails as you showed.

Ok - you convinced me - but I need to unplug for a while - maybe tomorrow

Back when I had to be convinced that I should share this app, the argument was made that the community would help make it better. If it was just me using it, I would have been happy with the SD text-based version. Looking back over the past couple of weeks, I'd have to say this has been a great ride. I'd glad so many people are enjoying using this app. I just hope that it eventually settles down to where it changes a little less often.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 09:09 PM   #225
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
That's all fine, but I'm not really talking about scaling. In the HME model, I have to define rectangular areas of the screen (called views) into which I place resources (such as text or images). Now these views CAN overlap, but I have certain aspets of the screen that need to be visible.
That's clear.

Quote:
Originally Posted by jbernardis View Post
The bottom line is that I need to devote a retangular area of the screen to these images and I don't want it to overlap with any of the other "controls". The question is do you want that to be landscape or portrait.
That isn't. What's wrong with a control being on top of an image? Certainly all the controls are on top of the background image, so how is a middle-ground image so different? Fundamentally, what's wrong with this:



That's how it wound up looking - more or less - in my test.

Quote:
Originally Posted by jbernardis View Post
As far as scaling, I can change the scaling so that it only scales DOWN if images are too big. Aspect ratio will always be maintained.
I think that's better than stretching.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 09:20 PM   #226
reneg
Registered User
 
Join Date: Jun 2002
Posts: 452
Quote:
Originally Posted by jbernardis View Post
Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.
I prefer portrait as most of my files are tv series related and I've been pulling poster images from thetvdb.com which fits within your thumbnail boundaries.

Just an idea if I might offer up a possible alternative, in each directory (or video file) check for a backgroundHD file in the directory or filename.backgroundHD. That could give up to 1280x720 pixels for whatever image the user want.
reneg is offline   Reply With Quote
Old 06-15-2011, 09:25 PM   #227
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
We're both responding at the same time and our responses are criss-crossing
Kind of like chat, isn't it.

Quote:
Originally Posted by jbernardis View Post
SO you're saying that when you made the view for the thumbnails the full width of the screen, that the submenus overlapping the image was not objectionable.
Yeah, see above. Another one of my criss-crossed mesages.

Quote:
Originally Posted by jbernardis View Post
Actually looking at the code, it's only because I defined the thumbnail view BEFORE the submenu views that the submenu was even visible. But that''s OK - we can take advantage of that fact, even though that's not why it was done like this.
Serendipity.

Quote:
Originally Posted by jbernardis View Post
If I do this, It would remove the PIL dependency
and quicken the response time a bit when navigating because there is less image processing going on. At the same time, it allows for more dramatic thumbnails as you showed.
Yeah the PIL issue doesn't really bother me - personally at least - since PIL is automatically included with my distro. I don't know about the Windows and Mac folks, or even other Linux distros. The image processing time is a little more of a philosophical concern, although on this system it's not objectionable. The last bit, obviously, pushes a button for me.

Quote:
Originally Posted by jbernardis View Post
Ok - you convinced me - but I need to unplug for a while - maybe tomorrow
Take all weekend, if you ask me. You deserve a break.

Quote:
Originally Posted by jbernardis View Post
Back when I had to be convinced that I should share this app, the argument was made that the community would help make it better. If it was just me using it, I would have been happy with the SD text-based version.
Yeah, for a guy who said he didn't want to develop or support the app, you are sure doing a good imitation of both.

Quote:
Originally Posted by jbernardis View Post
Looking back over the past couple of weeks, I'd have to say this has been a great ride. I'd glad so many people are enjoying using this app.
We are. I hope it's been fun for you. On that note, are you accepting donations?

Quote:
Originally Posted by jbernardis View Post
I just hope that it eventually settles down to where it changes a little less often.
I think it will, quickly. Realize, too, that there is nothing forcing you to meet any schedule. If you want to delay implementing a feature, or even refuse to implement it altogether, you should not feel any compulsion to second guess yourself just because we want it. I figure you've got to be experiencing the onset of burn-out.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 09:32 PM   #228
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by lrhorer View Post
Take all weekend, if you ask me. You deserve a break.
Actually - I had to see it for myself - it was really a trivial change - it's already on git as version 0.5f - is this a record yet?

Quote:
Originally Posted by lrhorer View Post
Yeah, for a guy who said he didn't want to develop or support the app, you are sure doing a good imitation of both.


We are. I hope it's been fun for you. On that note, are you accepting donations?
No donations please!! I do this for fun.

Quote:
Originally Posted by lrhorer View Post

I think it will, quickly. Realize, too, that there is nothing forcing you to meet any schedule. If you want to delay implementing a feature, or even refuse to implement it altogether, you should not feel any compulsion to second guess yourself just because we want it. I figure you've got to be experiencing the onset of burn-out.
But like I trid to say earlier - all of the suggestions - especially yours, have helped to turn what was a pretty mediocre app into one I am proud of. Yes it's approaching burn out. My wife has forgotten what I look like (and vice-versa) but when I get into something like this, I get consumed.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 09:37 PM   #229
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by reneg View Post
I prefer portrait as most of my files are tv series related and I've been pulling poster images from thetvdb.com which fits within your thumbnail boundaries.

Just an idea if I might offer up a possible alternative, in each directory (or video file) check for a backgroundHD file in the directory or filename.backgroundHD. That could give up to 1280x720 pixels for whatever image the user want.
Have no fear - with the changes made, your portrait images will be unchanged. Actually as I say this, I seem to think that they'll be centered in the larger window - and I was right - I just verified that by checking on my tivo. Actually though, the centered image was not upsetting.

If people want, though, I can make a simple change to left justify the image so it looks like it did before.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-15-2011, 09:50 PM   #230
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jbernardis View Post
Have no fear - with the changes made, your portrait images will be unchanged. Actually as I say this, I seem to think that they'll be centered in the larger window - and I was right - I just verified that by checking on my tivo. Actually though, the centered image was not upsetting.
I wouldn't think so.

Quote:
Originally Posted by jbernardis View Post
If people want, though, I can make a simple change to left justify the image so it looks like it did before.
I think I prefer the left-justified, but it's a mild preference. Centered is fine.
lrhorer is offline   Reply With Quote
Old 06-15-2011, 10:03 PM   #231
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Ok - this is it - at least for today. And to show a sense of finality, I'm bumping the version number, not the letter - version 0.6 is on git.

This one corrects the left justification oversight from the last version. Images are now, by default, left justified. HOWEVER, I also added a config.ini option, thumbjustify, that can be set to center or right if you want that. If you omit this, it will default to left.

Goot night everyone
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-16-2011, 05:54 AM   #232
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,868
I am having some diffeculty in getting vidmgr (and PythonHME) to run properly on my Synology NAS. Its strange. If I execute the following at an SSH command line:

python /usr/local/pythonHME/start.py

It starts normally with the response text shown in the SSH session. Running through the menus on the tivo it works normally. However pythonHME stops when I exit the SSH session.

If i use this command in a startup script executed at bootup:

/opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &

It starts pythonHME but ignores the config.ini file as if it cannot read it. Starts all apps, rather than just vidmgr listed in the apps section and vidmgr bombs if its called from the tivo, likely because its missing information from the config.ini file like path and pytivo location etc.

Suggestions?
__________________
Current : Roamio Base with 2TB drive and 2 Premieres, OTA. kmttg, pyTivo, running with a Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jcthorne is offline   Reply With Quote
Old 06-16-2011, 06:04 AM   #233
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by jbernardis View Post
Would people rather have a landscape oriented view for thumbnails as opposed to the portrait one I have? I chose the present orientation because it is a good aspect ratio for DVD cover art, but I also know that people have been using video thumbnail maker, which would lend itself to landscape orientation. I'm willing to lay the screen out with a landscape orientation if that seems to be the concensus among users. Let me know.
Could you use image.size to determine the dimensions of the image, and choose orientation dynamically?

Code:
width=image.size[0] 
height=image.size[1]

if width > height:
    orientation=landscape
else:
    orientation=portrait

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 06-16-2011, 07:06 AM   #234
windracer
joined the 10k club
 
windracer's Avatar
 
Join Date: Jan 2003
Location: St. Pete, FL
Posts: 11,222
Quote:
Originally Posted by jcthorne View Post
I am having some diffeculty in getting vidmgr (and PythonHME) to run properly on my Synology NAS.
Maybe make sure in your script you 'cd' into your pyhme directory first? In my startup script, I do this:
Code:
    cd /etc/tivo/pyhme
    /etc/tivo/pyhme/start.py > /var/log/pyhme.log 2>&1 &

__________________
840~Roamio Pro (TA, MoCA) + two A92~Minis, 758~Premiere XL4 (TA, MoCA)
S/old: 746~S4, 658~HDXL, 648~OLED S3, 565~TX20, 230~S2, 140~S2

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
windracer is offline   Reply With Quote
Old 06-16-2011, 07:22 AM   #235
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by windracer View Post
Maybe make sure in your script you 'cd' into your pyhme directory first? In my startup script, I do this:
Code:
    cd /etc/tivo/pyhme
    /etc/tivo/pyhme/start.py > /var/log/pyhme.log 2>&1 &
Yeah, I had issues with start.py and/or installed apps finding the config file when invoking start.py outside it's directory. Adding in a cd command clear things right up for me (on Windows).
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 06-16-2011, 08:18 AM   #236
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by orangeboy View Post
Could you use image.size to determine the dimensions of the image, and choose orientation dynamically?
The final (for now) design that I ended up with just drops the image into the view whatever its orientation - no scaling. The view is no longer 320X444 - it is now 620x450 - basically the entire lower right. If you have portrait thumbs that fit into the old view - nothing will change - they will be top/left justified in the view and appear the same. If you have larger (and wider) images, then as much as possible will fit into the viewport - this will allow for landscape images also. The difference is that for these wide images, the push/delete/tivo buttons COULD overlay the actual image.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-16-2011, 08:33 AM   #237
jcthorne
Registered User
 
Join Date: Jan 2002
Location: Houston
Posts: 1,868
tried your suggestion. No Go. Here is my startup script called startHME.sh:

Code:
`sleep 60`
cd /usr/local/pythonHME
/opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &
Is the name of the folder start.py is located in significant? I notice yours is /pyhme

I ran the script from a command line and get this feedback:

Code:
: not foundtc/rc.d/startHME.sh: line 1: 
/usr/syno/etc/rc.d/startHME.sh: cd: line 2: can't cd to /usr/local/pythonHME
: not foundtc/rc.d/startHME.sh: line 3:
after this start.py is running but again did not ready the config.ini file
__________________
Current : Roamio Base with 2TB drive and 2 Premieres, OTA. kmttg, pyTivo, running with a Synology 1511 NAS....serving up the world.

Setup help for pytivo under windows:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by jcthorne : 06-16-2011 at 08:41 AM.
jcthorne is offline   Reply With Quote
Old 06-16-2011, 08:40 AM   #238
jbernardis
Registered User
 
Join Date: Oct 2003
Location: Princeton NJ
Posts: 1,064
Quote:
Originally Posted by jcthorne View Post
tried your suggestion. No Go. Here is my startup script called startHME.sh:

Code:
`sleep 60`
cd /usr/local/pythonHME
/opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &
Is the name of the folder start.py is located in significant? I notice yours is /pyhme
The name of the pyhme folder is not significant, but all of the apps, including vidmgr, should be off of that directory and must be named the same as the application class in the __init__.py file (vidmgr) in my case.

Try running it without throwing away your output - or redirect it to a real file - to see what is says.
__________________
2 Series 3
1 HDTivo
1 Series 1 (Lifetime)
1 Win7 HTPC with Ceton Quad Tuner


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jbernardis is offline   Reply With Quote
Old 06-16-2011, 08:52 AM   #239
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jcthorne View Post
/opt/bin/python /usr/local/pythonHME/start.py > /dev/null 2>&1 &

It starts pythonHME but ignores the config.ini file as if it cannot read it. Starts all apps, rather than just vidmgr listed in the apps section and vidmgr bombs if its called from the tivo, likely because its missing information from the config.ini file like path and pytivo location etc.

Suggestions?
I do this:

Code:
#! /bin/bash
PIDFILE=/var/run/pyHME.pid
RUNDIR=/usr/share/pyhme
LOGFILE=/var/log/pyhme.log
cd $RUNDIR
/usr/bin/nohup $RUNDIR/start.py > $LOGFILE 2>&1 &
echo $! > $PIDFILE
exit 0
This in turn is called from the startup script:

Code:
RAID-Server:/usr/share/pyhme# cat /etc/init.d/pyHME 
#! /bin/sh
### BEGIN INIT INFO
# Provides:          pyHME
# Required-Start:    $remote_fs $syslog $network $pyTivo
# Required-Stop:     $remote_fs $syslog $network $pyTivo
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: HME Services
# Description:       Provides HME services for TiVo
#
### END INIT INFO

# Author: Leslie Rhorer

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="HME Services"
NAME=pyHME
DAEMON=/usr/share/pyhme/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started
        if [ -e "$PIDFILE" ];
        then
                PIDVAL=$( cat $PIDFILE )
                ps -ef | grep $PIDVAL | grep -qv grep && return 1
                rm $PIDFILE
        fi
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        if [ -e $PIDFILE ];
        then
                PIDVAL=$( cat $PIDFILE )
                rm -f $PIDFILE
                kill -15 $PIDVAL 2> /dev/null
                return "$?"
        else
                return 1
        fi
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  restart)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
        exit 3
        ;;
esac

lrhorer is offline   Reply With Quote
Old 06-16-2011, 09:01 AM   #240
lrhorer
Registered User
 
Join Date: Aug 2003
Location: San Antonio, Texas, USA
Posts: 6,858
Quote:
Originally Posted by jcthorne View Post
I am having some diffeculty in getting vidmgr (and PythonHME) to run properly on my Synology NAS. Its strange. If I execute the following at an SSH command line:

python /usr/local/pythonHME/start.py

It starts normally with the response text shown in the SSH session. Running through the menus on the tivo it works normally. However pythonHME stops when I exit the SSH session.
Use nohup to prevent the process from terminating when the shell quits. Normally, a spawned process is assigned the calling shell as the parent. Nohup causes the process to be assigned init ( PID 1) as the parent.
lrhorer is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 01:34 AM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |