[MPlayer-users] (no subject)

John Coulthard bahhab at hotmail.com
Mon Jan 2 15:18:38 CET 2006


Hi

If I run the shell script below I get an mp3 file of the radio broadcast I 
want. Works great run as root or as me and the files always end up the 
directory I've hard coded for them.  I want to run it from a cron job but 
it's not happening, can anyone tell me how to get it to work?

Using cron:-
Run as me I don't think I get any output at all.  (least not a Show.wav or 
an audiodump.wav)
Run as root I get a file in the roots home dir on the /dev/hda1 partition 
called audiodump.wav.  This partition isn't big enought to take a 3 hr show 
and I don't want it there anyway, the script says put the donload in 
/home/ann/rips/ .  ???  Obviously the mp3 conversion fails because the .wav 
is in the wrong place.

It's not a target directory permissions issue.
[root at tri: /home/ann]# ls -l
drwxrwxr-x    2 ann      ann          4096 Jan  2 13:47 rips

Any ideas much appreciated.  I'm using Linux redhat9 and MPlayer 
dev-CVS-050927-16:40-3.2.2
Thanks

---------------------THE SHELL SCRIPT------------------
#!/bin/bash

DATE=`date +%F`
echo "recording"
rm /home/ann/rips/Show*.wav #remove previous show .wav files
mplayer -cache 256 -playlist 
http://www.station.co.uk/radio/aod/shows/rpms/show.rpm -ao 
pcm:file=/home/ann/rips/Show.wav -vc dummy -vo null -really-quiet &
#sleep 10800  #sleep for 3hrs
sleep 120   #sleep for 120sec
kill $! #kill the mplayer job
echo "recording done"
head -17600000 /home/ann/rips/Show.wav >/home/ann/rips/Show1.wav
#if I don't do a 'head' LAME can't find the 3 hour .wav file, I'm guessing 
that it's too big
echo "head done"
lame /home/ann/rips/Show1.wav /home/ann/rips/Show$DATE.mp3
echo "all done :)"


--------------The output when run as a cron job-------------------------
recording
MPlayer 1.0pre6-RPM-3.2.2 (C) 2000-2004 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 7)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with 
--disable-runtime-cpudetection.

Warning unknown option cache_min at line 144
Warning unknown option cache_prefill at line 147

Resolving www.station.co.uk for AF_INET...
Connecting to server www.station.co.uk[212.54.244.46]:80 ...
Cache size set to 256 KBytes
Connected to server: www.station.co.uk
======= WAVE Format =======
Format Tag: 28515 (0x6F63)
Channels: 2
Samplerate: 44100
avg byte/sec: 44100
Block align: 640
bits/sample: 16
cbSize: 26
Unknown extra header dump: [80] [0] [10] [0] [17] [0] [80] [2] [10] [0] [1] 
[0] [0] [3] [8] [0] [0] [25] [0] [0] [0] [0] [0] [2] [0] [4]
===========================
recording done
head: /home/ann/rips/Show.wav: No such file or directory
head done
Assuming raw pcm input file
LAME version 3.96.1 (http://lame.sourceforge.net/)
Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz
Encoding /home/ann/rips/Show1.wav
     to /home/ann/rips/Show2006-01-02.mp3
Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3

   Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
    0/       ( 0%)|    0:00/     :  |    0:00/     :  |         x|     :

    0/2      ( 0%)|    0:00/    0:00|    0:00/    0:00|   0.0000x|    0:00
average: 128.0 kbps                    MS: 2 (100.0%)

Writing LAME Tag...done
ReplayGain: +51.0dB
all done

[root at tri: /home/ann]# ls -l /audiodump.wav
-rw-r--r--    1 root     root     20250668 Jan  2 13:47 /audiodump.wav
[root at tri: /home/ann]# ls -l rips/
total 112068
-rw-r--r--    1 root     root            0 Jan  2 13:47 RockShow1.wav
-rw-r--r--    1 root     root         1252 Jan  2 13:47 
RockShow2006-01-02.mp3
[root at tri: /home/ann]#


--------------Running the shell script directly as root--------------------
[root at tric: /home/ann]# ./rec
recording
MPlayer dev-CVS-050927-16:40-3.2.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 7)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2


STREAM_HTTP(1), URL: http://www.station.co.uk/radio/aod/shows/rpms/show.rpm
Resolving www.station.co.uk for AF_INET...
Connecting to server www.station.co.uk[212.54.244.46]:80 ...
Cache size set to 256 KBytes
Stream description: audio/x-pn-multirate-realaudio logical stream
Stream mimetype: audio/x-pn-realaudio
recording done
head done
LAME version 3.96.1 (http://lame.sourceforge.net/)
Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz
Encoding /home/ann/rips/Show1.wav
     to /home/ann/rips/Show2006-01-02.mp3
Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=3
   Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
4465/4467  (100%)|    0:10/    0:10|    0:10/    0:10|   11.629x|    0:00
average: 128.0 kbps   LR: 75 (1.679%)   MS: 4393 (98.32%)

Writing LAME Tag...done
ReplayGain: +6.8dB
all done :)
[root at tri: /home/ann]# ls -l rips/
total 154144
-rw-r--r--    1 root     root     20578348 Jan  2 13:33 Show1.wav
-rw-r--r--    1 root     root      1867858 Jan  2 13:33 Show2006-01-02.mp3
-rw-r--r--    1 root     root     20578348 Jan  2 13:33 Show.wav
[root at tri: /home/ann]#

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/




More information about the MPlayer-users mailing list