LinHES Forums
http://forum.linhes.org/

Need some help on thumbnail script SOLVED
http://forum.linhes.org/viewtopic.php?f=14&t=11478
Page 1 of 1

Author:  tripmix [ Thu Sep 07, 2006 5:58 am ]
Post subject:  Need some help on thumbnail script SOLVED

Hi, I'm new here.
I found this script http://www.gossamer-threads.com/lists/m ... ers/182932 at the bottom. It's for makeing thumbnails for files that don't have cover art in mythvideo.

This is what it looks like after I changed a few small things

Code:
#!/bin/sh -x

until [ "$count" = "0" ]
do

##find out how many movies to process
mysql -u mythtv --password=***** <\
/home/mythtv/.mythtv/MythVideo/scripts/movielist.sql >\
/home/mythtv/.mythtv/MythVideo/scripts/sqllist.out
count=`wc -l /home/mythtv/.mythtv/MythVideo/scripts/sqllist.out | awk '{print $1}'`


##get a movie to process
mysql -u mythtv --password=***** <\
/home/mythtv/.mythtv/MythVideo/scripts/moviefind.sql >\
/home/mythtv/.mythtv/MythVideo/scripts/sql.out
MOVIE="`cat /home/mythtv/.mythtv/MythVideo/scripts/sql.out | grep -v title | grep -v filename | grep /opt`"
MOVIEID="`cat /home/mythtv/.mythtv/MythVideo/scripts/sql.out | grep -v filename | grep -v title | grep -v /opt`"

##create the thumbnail using mplayer
mplayer -ss 00:5:44 -vo jpeg:quality=95:outdir=/home/mythtv/.mythtv/MythVideo/scripts/ -frames 1 -nosound "$MOVIE"
mv /home/mythtv/.mythtv/MythVideo/scripts/00000001.jpg /home/mythtv/.mythtv/MythVideo/"$MOVIEID".jpg

##update the database
mysql -u mythtv --password=***** <\
/home/mythtv/.mythtv/MythVideo/scripts/movieupdate.sql

done


The problems I'm haveing is whit this line:
Code:
MOVIE="`cat /home/mythtv/.mythtv/MythVideo/scripts/sql.out | grep -v title | grep -v filename | grep /opt`"


I'v tried many diffrent ways of useing grep to get only the filename out of sql.out but the truth is I don't know what I'm doing and I have no idea what | grep /opt does... /opt is just an empty folder on my box.

So if anyone can help me figgure this line out I'll be very happy :)

If you want to try the script yoursellf you'll need to make 3 sql files, you can find them at the link above bottom post.

EDIT: just made it look nice...

Author:  tripmix [ Thu Sep 07, 2006 8:36 am ]
Post subject: 

Since all my videos are on /media/disk1/Videos/ this worked
Code:
MOVIE="`cat /home/mythtv/.mythtv/MythVideo/scripts/sql.out | grep media | grep -v /opt`"

And I had to change the mplayer part to:
Code:
mplayer -ss 00:5:44 -vo jpeg:quality=95:outdir=/home/mythtv/.mythtv/MythVideo/scripts/ -frames 2 -nosound "$MOVIE"
mv /home/mythtv/.mythtv/MythVideo/scripts/00000002.jpg /home/mythtv/.mythtv/MythVideo/"$MOVIEID".jpg

Guess this will work as long as I dont name my files media somthing, or I could always change it to disk1 :)

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/