[MPlayer-users] mplayer - recording streaming media

Christian Schramm schramm at e-connect.lu
Thu Jun 5 14:57:31 CEST 2008


Hi @all,

I'm having a small problem and perhaps one of you guys can help me with 
this.

I've created a script that will record streaming audio as follows:
..............
# Schedule mplayer to rip stream to file
nohup /usr/bin/mplayer -really-quiet -cache 512 -playlist 
http://example.net/blabla.asx -vo null -ao pcm:file=$tmp_file_name 
</dev/null &

# Get PID of this mplayer process
mplayer_pid=$!

# Schedule process to kill mplayer after designated time
nohup /home/user/stream_record/recorderStop.sh $mplayer_pid $2 $1 &
.............

This works as follows.
The recorderStart-script receives 2 parameters: 1. filename, 2. time to 
record in seconds.
Then it starts up mplayer in background and also the recordStop-script.
The recordStop-Script will sleep the given amount of seconds before 
killing the mplayer process and converting the output (pcm) to mp3 via lame.

Now finally the problem:
I notice that some of the records over the day are complete but some are 
not, whats really strange.
I also added some logging output to the bash scripts to see wether the 
problem might be something else, but it seems that mplayer is recording 
and sometimes, without any logical background, it stops recording while 
the process is still running (I conclude this from the fact that there 
is no error from the kill command).
The outcoming pcm file is too small and also incomplete, so its not a 
problem with lame.

The bash-script is runing on a gentoo server without X.
The strange thing is that it sometimes works and sometimes not.

Any ideas about that?

At the end, my current mplayer version:
MPlayer 1.0rc1-4.1.2 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) D CPU 3.40GHz (Family: 15, Model: 6, Stepping: 4)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
-- 

e-connect <http://www.e-connect.lu>

Schramm Christian
Analyste-développeur

TEL : (+352) 26 44 02 10 - 40
FAX : (+352) 26 44 02 10 - 90
EMAIL : schramm at e-connect.lu <mailto:schramm at e-connect.lu>

428, route de Longwy
L-1940 Luxembourg




More information about the MPlayer-users mailing list