[mythtv-users] Anyone using in crontab?

Todd mythtv at vbref.org
Thu Dec 13 23:05:30 UTC 2007

nospam312 <nospam312 at gmail.com> writes:

> I am using the script available on the Wiki at this URL to generate
> preview images.
> http://www.mythtv.org/wiki/index.php/Generatevideothumbs.pl
> I have commented out the following lines and added a few more logging
> and debug statements.  Everything works fine when I execute the script
> from the command line.
> #if (getpwuid($>) ne "mythtv") {
> #  print STDERR "You must run this script as the mythtv user.\n";
> #  exit 1;
> #};

What user are you executing this as from teh commandline?      Is it
the same user whose crontab you've added a call to thte script to?
Doe the user running the crontab have rights to write into the output
directory of the mplayer command?    (/tmp by default ) 

> However when I add the script to my crontab the script fails when it
> calls the system("mplayer","-noframedrop","-ss",$SKIP,"-vo","jpeg:quality=50:outdir=$OUTPATH","-frames","2", at VC,"-nosound",$FILE);
> line as the 00000002.jpg file is not generated and therefore the mv
> command fails.

I'd definitely add the full path to the call to mplayer. 

I don't see any reference to $OUTPATH/$FRAME   in that mplayer
command, yet that's what the mv command is lookign for.   

my $FRAME='00000002.jpg'

> What is strange is the previous calls to mplayer via the line "my
> $length=`echo -n q | mplayer -vo null -nosound -identify -vc null
> "$FILE" | egrep "^(ID_LENGTH=)" | cut -d '=' -f 2`;" works fine as
> $length is assigned the correct value.
> This seems to point to the script is able to read the file and
> permissions are set correctly.  Does anyone have any idea why the
> system("mplayer"...) line is failing?
> I am using Mythbuntu 7.10.

Check the umask of the user that's running the cron entry.  

More information about the mythtv-users mailing list