View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Cataloguing DVD's
PostPosted: Tue Nov 08, 2005 6:31 pm 
Offline
Joined: Mon Jan 24, 2005 11:38 pm
Posts: 109
I have approx. 300 DVDs and counting, and while I've ripped many of them to Divx/Xvid for playback on my Myth box, I don't want to/don't have the time and HD space to archive them all. I had an idea of adding them to the MythVideo database so that when we are browsing for a movie to watch instead of having to look through the DVDs AND browse MythVideo we could just look in one place. I thought it would also be nice to see descriptions/etc since I keep my discs in jackets without the covers/cases.

I found a way to almost do what I wanted in this thread on the MythTV mailing list:
http://www.gossamer-threads.com/lists/m ... ers/143039
To summarize, you create blank files with the ".dvd" extension and symlink them to this executable script :

Code:
#!/bin/bash

MEDIA_TYPE=$1
FILE_NAME=$2

# Find the name of the disc
case "${MEDIA_TYPE}" in
  DVD)
    DISC_NAME=`basename "$FILE_NAME" .dvd`
    ;;
  CD)
    DISC_NAME=`basename "$FILE_NAME" .cd`
    ;;
  VCD)
    DISC_NAME=`basename "$FILE_NAME" .vcd`
    ;;
esac

# Prompt the user to insert the disc
xterm -bg NavyBlue -fg White +sb -fs 18 -geometry 40x6 \
      -e prompt "Please insert ${MEDIA_TYPE}:" "${DISC_NAME}"

# Play the disc
case "${MEDIA_TYPE}" in
  DVD)
    xine --no-splash --auto-play=fhq --auto-scan dvd
    ;;
  CD)
    xine --no-splash --auto-play=fhq /mnt/cd
    ;;
  VCD)
    xine --no-splash --auto-play=fhq --auto-scan vcd
    ;;
esac


The "prompt" command in line 21 is this script:

Code:
#!/bin/bash

MESSAGE=$1
MESSAGE2=$2

echo "${MESSAGE}"
echo
echo "${MESSAGE2}"

## Uncomment the for loop for a standard 80x24 terminal or use the
## xterm command line to customize the display for 5 or 6 lines
#for line in `seq 1 20`; do
  echo
#done

read -n 1 -p "Press any key to continue."


You then have to create a new file type in your video settings for the "dvd" extension, uncheck "Use default player" and make the command
bash %s DVD %s

Now when you open one of your "dvd" files an xterm window pops up telling you to insert the disc. There are a couple of modifications I'd like to make so this works more to my liking. My issues are:

1. I keep all of my movies on a Windows computer on my network, and AFAIK I cannot symlink these files to the script across machines. (For the time being I've created a new directory on the Myth box for the dvd files so that it will work, but I'd like to keep all of the movies together for browsing.)
2. Since I have so many movies, I'd like to number them and have the prompt tell you what disc# to insert.
3. The xterm window does not fit well with the rest of the MythTV UI, so if I could figure out a way to get a prompt that does that would be ideal.

Further down in that thread another user has a perl script he uses to play videos that accounts for his abnormal directory structure. He creates files with the movie name, pathname and aspect ratio which get read by the script and passed to mplayer. I would like to combine these two methods into one, creating files with a "dvd" extension that contain one line e.g.
Disc=162

The disc number gets read by the script and is included in the prompt so that when I select a movie I will know where to look for it. This will be my first attempt at perl (only done VB programming in the past, linux newbie) but I'm going to try to figure it out (along with whatever assistance anyone here can give me :D )

The questions I have as I begin are:
If I do this with perl, can I make the command for the "dvd" extension my perl script to avoid the issue of not being able to symlink across machines?

How would I go about getting a prompt/pop-up that matches the Myth UI?

Thanks in advance for any assistance anyone can give me.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 8:30 pm 
Offline
Joined: Tue Mar 22, 2005 9:18 pm
Posts: 1422
Location: Brisbane, Queensland, Australia
I am really fascinated by this idea and looks very promising. Unfortunately I am working on something else at the moment, so I can't help directly, but I do have this advice.

With your Windows files you should be able to create a directory in your /myth/video directory and mount your windows share into this directory thus negating the need for symlinks.

_________________
Girkers


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 10:38 pm 
Offline
Joined: Mon Jan 24, 2005 11:38 pm
Posts: 109
So I looked into this a little more tonight, and I've hacked together a solution. I didn't use perl to make it work, just bash scripting. Unfortunately I'm still using an xterm window instead of something that better matches the MythTV UI, if anyone has an idea on how to make a prettier looking popup I'm all ears. You also need to press any key on the keyboard to make the xterm go away (any idea how to make it respond to the remote?) I created files with a .dvd extension for all of my DVD's that have one line in them like this:

disc=101

I then assign the following command to the .dvd filetype in Setup->Media Settings->Video Settings->Filetypes

/usr/local/bin/playdvd %s

The playdvd script is as follows (I apologize if it is ugly or if I break any rules of bash scripting, this is my absolute first attempt at doing anything of this nature. Any suggestions for improvement are greatly appreciated):

Code:
#!/bin/bash

filename=$1

tmp=`grep disc ${filename}`
result=`echo $tmp | cut -d = -f 2`

# Prompt the user to insert the disc
xterm -xrm "xterm*allowSendEvents: true" -bg NavyBlue -fg White +sb -fs 48 -fn 12x24 -geometry 40x7+600+300 -e prompt "Please insert disc" "${result}"


It reads the file for the disc number and prompts the user which one to insert. I use my standalone DVD player, so I did not need any command to actually play the DVD, but it should be simple enough to add the appropriate xine command if you play DVD's with Myth.

So if you want to browse all of your discs and easily find them just create .dvd files for each of them and add a line with the number. I guess this is really only useful if you keep your discs in a book and number them like I do (I learned the hard way how difficult it is to try and keep them alphabetical, especially when you add 10-15 discs per month to your collection). If this doesn't fit anyone else's needs maybe at the very least it will inspire someone to create a better solution for cataloguing movies.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 28, 2005 9:45 pm 
Offline
Joined: Tue Feb 08, 2005 5:18 pm
Posts: 70
There are a few tools for doing gui type pop-ups from shell scripts. I don't know how well they'll integrate with myth though. You can take a look at zenity, xmessage, xdialog, gtkdialog... There may be others. I haven't actually used these, just heard of them. Also, xmessage is probably the only one installed by default.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 15, 2006 7:08 am 
Offline
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location: Philadelphia, PA US
I was playing with this following crabby's idea and using the xmessage command can get a window that appears with a timeout. Works pretty well and with xmessage you don't have to configure lirc with a special function because of timeout and eliminates the need for prompt script.

/usr/local/bin/playdvd
Code:
#!/bin/bash

filename=$1

tmp=`grep disc ${filename}`
result=`echo $tmp | cut -d = -f 2`

# Prompt the user to insert the disc for 5 seconds
xmessage -title "INSERT MEDIA" -center -timeout 5  "Please insert disc" "${result}"


I am still looking into how MythTVOSD could be used. It should be workable as there is a thread doing email to OSD using mythtvosd.

http://mysettopbox.tv/phpBB2/viewtopic.php?t=7968


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 11:08 pm 
Offline
Joined: Mon Jan 24, 2005 11:38 pm
Posts: 109
Excellent! That's the only part I hadn't worked out, and it was a little annoying to dig out the keyboard everytime to make the xterm go away. I will try this out tomorrow night. Should up the WAF even more. :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 10:02 pm 
Offline
Joined: Mon Jan 24, 2005 11:38 pm
Posts: 109
This worked great. I looked into mythvosd a little bit, and unfortunately it only works when you are watching Live TV or a recording.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 4:53 am 
Offline
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location: Philadelphia, PA US
Quote:
...mythvosd a little bit, and unfortunately it only works when you are watching Live TV or a recording.


Yea, I found the same thing. Which sucks as MythTVosd really does look sharp.

Another idea I was thinking of was xyac or something similar. I use it for CallerID and works great. Text is larger than xmessage and works from wherever you are in the myth menus.

http://mysettopbox.tv/phpBB2/viewtopic. ... light=xyac


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu