[MPlayer-users] problem running mplayer in script

Steve steve at szmidt.org
Mon May 10 08:57:34 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I've been trying to get mplayer to play/convert .wma files and it only works 
from the command prompt for some reason. Here's the script:

Dir="~/MyMusic"
CDir="`pwd`"
cd $Dir
i=1
CmdLine="mplayer -aop list=volume:volume=100"

find /home/steve/MyMusic/* -name "*.wma"|sort|while read song ; do
#find /home/steve/MyMusic/* -name "*.wma"|sort|while read -d. song ; do
        #echo "Song is ${song}.wma"
        #song="/home/steve/MyMusic/mohmp3/enya.mp3"
        #ext=".wma"
        song="/home/steve/MyMusic/Yes/Union/13-Evensong.ogg"
        exec $CmdLine "${song}${ext}"
        #mplayer -ao pcm ${song}.wma
        i=$(($i+1))
        # If file is over 1000 bytes it's OK
#       if [ "`ls -l audiodump.wav|cut -d' ' -f6`" -gt "1000" ] ;then
#               sox audiodump.wav ${song}.ogg
#       fi
        exit 0
done
cd "$CDir"

The commented out lines where for testing purposes.

Being that there are about 1800 files to convert it's not something I want 
to do by hand. The first find locates the whole name including the 
extension which I wanted to remove to make it convert nicer. The second one 
looks for file names with a period so I can do that processing. 

Then later on I decided to put the name in there to see if there's a problem 
with the name it finds. First I tried with a mp3 song with simple file 
name. Next was a harder name as it contains a dash.

Running them manually from the shell works fine. As soon as I execute the 
script it fails either with not being able to find the name or with many 
lines like below:

It 's clear that it does not like the name due to containing underscores and 
other symbols. So if you put them in quotes on the command line it solves 
it just fine. However I cannot get get the script to do that without it 
becoming an unknown file name.

So I cannot for the life of me see how to solve this. I've googled for 
others with similar problems to no avail. Ditto with searching this list.

Dir structure is ~/MyMusic/<Artist>/<Album>/song.ext
___________________________________________________________

MPlayer 1.0pre2-3.2.2 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred 1754 MHz (Family: 6, 
Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Reading config file /etc/mplayer/mplayer.conf: No such file or directory
Reading config file /home/s/.mplayer/config
Reading /home/steve/.mplayer/codecs.conf: Can't open 
'/home/steve/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/codecs.conf: Can't open '/etc/mplayer/codecs.conf': No 
such file or directory
Using built-in default codecs.conf
font: can't open file: /home/steve/.mplayer/font/font.desc
Font /usr/share/mplayer/font/font.desc loaded successfully! (206 chars)
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system 
startup scripts.
Using usleep() timing
Can't open input config file /home/steve/.mplayer/input.conf: No such file 
or directory
Can't open input config file /etc/mplayer/input.conf: No such file or 
directory
Falling back on default (hardcoded) input config
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0 : No such device
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.

Playing /home/steve/MyMusic/Yes/Union/13-Evensong.ogg
OGG file format detected.
==========================================================================
Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 14000->176400 (112.0 kbit)
Selected audio codec: [vorbis] afm:libvorbis (OggVorbis Audio Decoder)
==========================================================================
Checking audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
[pl_volume] Software volume control in use.
[pl_volume] Software volume control in use.
AO: [plugin] 44100Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
Video: no video
Starting playback...
No bind found for key M
No bind found for key M
No bind found for key A
No bind found for key b
No bind found for key _
No bind found for key _
No bind found for key _
No bind found for key N
No bind found for key G
No bind found for key _
No bind found for key E
No bind found for key _
No bind found for key O
..
and so on

- -- 
Steve

"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
                                Benjamin Franklin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAnyfiljK16xgETzkRAifbAKCEA0tD4xswZt9FByLg+XjsgWd4OACg57ap
iXcaeJeRCpSIEAFGpZh0T1I=
=5/yl
-----END PGP SIGNATURE-----




More information about the MPlayer-users mailing list