1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PyTivo Video Manager HME App for pyhme

Discussion in 'Developers Corner' started by jbernardis, Apr 20, 2011.

  1. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    OK, I have another request that I think should not be too difficult. Lucasnz over on the pyTivo forum has picked up development of the DVD plugin for pyTivo, and has re-worked the code so that (with one small fork differential) pyTivo can now push DVD titles. It would be great if vidmgr supported this functionality. See the thread here.
     
  2. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    This is my point. The shell is NOT going to interpret a config file. It's up to the program to do that. Many people think that the wildcards you use on the command line are processed internally by the program, and therefore it should be no hardship (or at least no different) to also process wildcards from a config file.

    This is not the case, however. The invoked program has no idea that wildcards were used on the command line - the shell takes care of the expansion/file name matching. If wildcards are in a config file, however, the reading program would have to do the expansion explicitly. Most languages provide facilities for doing this (at least I know Perl does and I assume python does too) but it's not a normal practice to do so.
     
  3. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I have never used the DVD plugin myself, but it looks intriguing. I noticed when it was first announced, but haven't followed its evolution. I am actually using vidmgr and pytivo to manage some DVD rip videos, but am having some issues with the proper format. Maybe this plugin will solve my issues.

    Let me get it going on my installation so that I know better how it's used. After I'm familiar with it, I'll evaluate how it could best be incorporated into vidmgr, and what the impacts on the program will be.
     
  4. Jul 1, 2011 #284 of 735
    lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    With the exception of some audio track selection issues, which the most recent updates have fixed, I've never had any problems with simply ripping the DVD using DVD Decrypter, renaming the directory to suit my taste, and going about my business.

    Aside from support for rather more complex and numerous metafiles, to the user it is almost identical to the mainstream pyTivo program. The only major difference is each DVD has its own directory, rather than just being a single file.
     
  5. Jul 9, 2011 #285 of 735
    jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    FYI - I have been working on this and am just about finished. I am away from home right now, but have taken the source code with me and I believe I have finished my changes, Problem is I won't be able to test until I get home, so it still could be quite a while before it's released.

    There are some significant differences between processing these shares and normal video shares. Most notably, when I am processing a video share, if there is no meta data available, I at least have the file name as a reasonable title substitute and I can easily count up the number of titles in any directory. Not so with a dvdvideo share - the only real way to know how many titles I am dealing with is to process the binary IFO files, and that just gives me the count - There is no real title.

    So I made a simplifying decision. I am ONLY processing the metadata. If a directory contains a VIDEO_TS directory but does not have any metadata, then I assume that there is only a single title (with the same name as the directory name). If there is metadata, the number of titles and their text is extracted from there.
     
  6. Jul 9, 2011 #286 of 735
    lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    Terrific!

    'A little less terrific, but still good news.

    Absolutely. Metadata is essential with the DVD plug-in.

    Indubitably. I don't see how else you could reasonably attack the problem.

    Excellent.

    Does the DVD Plug-in solve the issues you were having with your rips?
     
  7. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Not quite - I'm not sure that I'm going to end up using the dvdvideo plugin for several reasons.

    1) Even though we are "pushing" videos, there is still some ffmpeg processing going on. When I push a dvd video using this plugin, it's takes about 5 times as long as pushing the same video transcoded into MP4 (and the MP4 file is not significantly smaller)

    2) All I ever want from a DVD is the main title - this plugin introduces another level in the directory hierarchy, which is unnecessary for a single title.

    3) I have several movies that span multiple disks. With all of the video tools I have at my disposal, I am able to combine these into a single file. This is impossible with the dvdvideo plugin.

    4) I have some series with multiple titles on multiple disks. In this situation, adding a disk level to the hierarchy and needing to traverse up and then down into another directory to continue with the series seems unnatural to me.

    5) I also play these videos on my PS3 - which I can do directly from my NAS with the native software of the PS3. I'm not sure if this would be possible if the files were in VIDEO_TS format.

    I think I'm just going to continue transcoding my videos to either MP4 or MPG format.
     
  8. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    Odd. Still, since all DVDs are SD, they still transfer at several times real-time, and since there are no commercials, I rarely have any reason to FF or RW.

    You don't have any multi-title DVDs? I have several, plus several with theatrical and non-theatrical releases. There are also several whose extra features I like. Admittedly, most I only want the main title, but there are a number of exceptions.

    It's not impossible, at all. I only have one, that I recall (Exodus), and I ripped it to a pair of MPEG files, and then re-authored / spliced it using VideoRedo.

    You could splice it into a single, multi-title collection. You may not consider this convenient, however.

    That, I can't say.

    OK. I definitely prefer just ripping and forgetting about it. I haven't done even a single rip in ages, but when I was archiving my DVDs, I sometimes ripped four at a time.
     
  9. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Ok - version 0.7 is out on git - follow the link in my signature.

    This version adds support for the dvdvideo plugin. As mentioned in the above posts, this is highly dependent on accurate metadata. If you do not have metadata, then I assume that there is only 1 title - the main feature - available.

    lrhorer - I am counting on you doing some testing here. I put a few dvds up on my NAS, but as I stated, I do not use the dvdvideo plugin. The few dvds I inserted allow me to do little more than elementary testing. I certainly do not have the variety of scenarios that I think you have :)
     
  10. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    'Just downloaded it.

    Oh, you bet. I'm going to try a couple right now. I won't be able to do any real testing until this weekend, though.
     
  11. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    Um, something is broken. First of all it is no longer possible to gracefully exit vidmgr, or even to get back to the main menu from any of the shares. In the main menu, hitting left arrow does nothing, and once I have entered a share, the left arrow won't take me back to the main menu. I can drill into subdirectories inside a share and get back to the root of a share, but that's as far as I can get. Hitting the <TiVo> button takes me back to the main TiVo menu, though.

    The DVD share doesn't work, at all, though. No folder icon shows up next to the DVD share. Hitting the right arrow brings up a very slight shadow of an icon (the clock, icon, I think) in the middle of the screen, and then the app locks up tight. I'm including a copy of the log, gained from moving around various places in the app. The log file is gzipped, but I changed the extension to .zip so I could upload it.
     

    Attached Files:

  12. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    It always seems to be related to the display of an icon. I can certainly make the code more defensive here, but it almost seems to me that one of your png files is missing, although I didn's see a message in the logs you provided. I didn't state it explicitly in my last email, but there is a new png file - dvdfolder.png. If you are using your own skin, make sure to copy this over from eith the skins/blue or skins/orig directory.

    The exception happens because the listing dictionary has a value of None for key 'icon', and the only way this can happen is if one of the png files is missing.

    Edit: Possible reason why the error message is not showing up - Are you only directing stderr to your log file and NOT stdout? My message is going to stdout. I can fix this too - but before I make a change, let's find out if your file is missing.
     
  13. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    Oops. That would do it. I have skin=local set in my config.ini file. When I pulled the git, I simply copy over the entire directory structure, but of course nothing gets copied to the ./vidmgr/skins/local directory, by design.

    Yep, that did the trick. From now on, I'll have to remember to scan the ./vidmgr/skins/orig/ directory for new files whenever I pull a git. I like the icon, BTW. It provides a nice visual cue to the fact these are DVDs.

    That was established. Meanwhile:

    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 is called from

    Code:
    NAME=pyHME
    DAEMON=/usr/share/pyhme/$NAME
    PIDFILE=/var/run/$NAME.pid
    
    ...
    
    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON || return 2
    in /etc/init.d. Stdout and stderr are both being re-directed to the logfile. Nohup and the daemon service manager should not interfere with stdout. Obviously, since stderr is being re-directed to stdout, and the messages from stderr are showing up in the log file, stdout must be properly re-directed. For some reason, the message is not showing up to stdout.
     
  14. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    I can't explain the missing message - there IS a print statement if an image file is missing.

    But since copying the file got you going, I'm not going to worry too much about that. I am going to make a delivery with defensive code in case the icon file is missing, but there is no urgency for it (unless you report further issues)

    Incidentally - I apologize for not emphasizing that there was a new graphic file in this release. I intended to do so, but it slipped my mind while I was composing the message.
     
  15. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    Hmm. Odd. I have no explanation.

    Quite the contrary. Everything so far looks perfect. As I mentioned, however, my testing so far has been fairly perfunctory. I won't be able to really beat up the app until this weekend.

    One very interesting note. I noticed if there is a folder.jpg file in the directory for a DVD, but no individual __Txx.mpg.jpg file, then rather than display no cover art, for the specific title, the app displays the main folder.jpg artwork. I like that.

    No worries. It was more my fault for not thinking of it. Given the fact I have a custom icon folder, scanning your release skin folders for new artwork files should have been SOP for me whenever I pull a new git all along.
     
  16. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    Actually, the folder.jpg behavior was my original intent. It wasn't until I finished coding that I realized the __Txx.mpg.jpg "feature" was going to be a by-product. I had a note to myself to try to work this in, and then I realized that it just ought to work. So I tried it and sure enough the existing logic already took care of it. Glad you like it.
     
  17. jbernardis

    jbernardis New Member

    1,072
    0
    Oct 21, 2003
    Princeton NJ
    BTW - did you notice that if you are looking at the directory listing and have the hilite on the DVD folder, if you press the info button, you see the info from the default.txt file, including the list of titles.
     
  18. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    No, I didn't catch that. Neat.
     
  19. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    OK, I've hit the DVD feature at least once with everything of which I can think, and it seems to be performing flawlessly with one tiny exception. Subdirectories are not properly sorted by Alpha even though force_alpha = True is set in pyTivo.conf. OTOH, when I double-checked, the pyTivo DVD plug-in does not sort properly, either. If vidmgr relies on the DVD plug-in to relay the directory listing back to the app, then this is more properly a small bug in the DVD plug-in. If not, then both the DVD plug-in and vidmgr have the same little bug-let.

    Edit: Oh, pfft! Nevermind. Silly me. If forgot on an Alph sort, 25 comes before 3 and 4, and 43 comes before 6.
     
  20. lrhorer

    lrhorer New Member

    6,922
    0
    Aug 31, 2003
    San...
    OK, no sooner did I submit a false bug report, than I have another feature request, if it isn't too difficult to manage. (No one can say I don't have chutzpah, I guess.) Would it be possible to make folder descriptions multi-line? I was thinking something like the following.

    If the file default.txt in "/Videos/Twilight Zone" has the lines

    Code:
    description : Four Episodes from the original TV series
    description : 1. Steel
    description : 2. A Game of Pool
    description : 3. Walking Distance
    description : 4. Kick the Can
    Then rather than only the first line showing up in the info text, all four will show up like so:

    Code:
    Four Episodes from the original TV series
    1. Steel
    2. A Game of Pool
    3. Walking Distance
    4. Kick the Can
    Of course, I could put them all on one line, but this reads easier, especially when there are a number of titles.
     

Share This Page