Step 3Save script, make pkill script and make scripts executable
cd /scripts
chmod 700 streamrecord (This makes the script you just created into an executable file.)
Create one more file in the /scripts directory. This will be called pkill, and will be your hitman. That is, it will kill the mplayer process to allow the first script to continue with renaming and encoding the captured stream. The full text of the pkill script is exactly as follows:
pkill mplayer
Now, this breaks scripting etiquette, by not having #!/bin/sh at the top, but it works for me. Once you've saved the file pkill in the /scripts directory, use the chmod command again to make this one executable. You need to be in a terminal session, in the /scripts directory first, then type:
chmod 700 pkill
A quick "ls" will show you the files you just created, now in a lovely green instead of the standard black.
| « Previous Step | Download PDFView All Steps | Next Step » |









































mplayer "mms://rx-wes-sea20.rbn.com/farm/pull/tx-rbn-sea34:1259/wmtencoder/cspan/cspan/wmlive/cspan4db.asf" -ao pcm:file=/tmp/mystream.wav -vc dummy -vo null -endpos "01:00:00";
This would record for 1 hour and stop. A bit cleaner than using kill, plus one less line in crontab.
mplayer $STREAM -endpos $DURATION -vo null -ao pcm:waveheader:file=$FILENAME.wav
Where $DURATION is of the form "1:30:00"
More details:
http://www.mbeckler.org/scripts.php#savestream