[Spam?] Re: Anyone know how to do a timed program with mplayer

2005-11-15 Thread Adam Funk
 and I've successfully recorded (using scripts and at) fixed-duration
 RealPlayer radio shows to .wav to listen to them later.  But I'd
 like to record a specific show tonight from the continuous live ogg
 stream.

In case anyone else cares, here's what I developed.  

$ at 16:00
 record-wuvt 15 15

for example, should produce files wuvt--20051115-1600.mp3 and
wuvt--20051115-1615.mp3, both just under 15 minutes long
(unfortunately you lose a few seconds between segments).

HTH someone,
Adam


#!/bin/sh
# Arguments: numbers of minutes to record

URL='http://engine.collegemedia.vt.edu:8000/wuvt.ogg'
BASENAME='wuvt-'

for MINUTES in $@
do
  FILENAME=${BASENAME}-`date +%Y%m%d-%H%M`
  
  date
  echo Start recording  ${FILENAME}  for ${MINUTES} minutes
  
  mplayer -really-quiet -ao  pcm:file=${FILENAME}.wav  ${URL}  
  PID=$!
  
  sleep ${MINUTES}m
  echo Ding!
  date

  killall mplayer
  wait ${PID}

  # normalize and encode in the background
  nice -18 normalize-audio -q -a -19dB ${FILENAME}.wav  \
  nice -18 lame --quiet  ${FILENAME}.wav  ${FILENAME}.mp3  \
  rm -v ${FILENAME}.wav 

done

wait
ls -l *.mp3
date


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Anyone know how to do a timed program with mplayer?

2005-10-19 Thread csj
On 17. October 2005 at 5:03PM +0100,
Adam Funk [EMAIL PROTECTED] wrote:

 I can listen to a continuously ogg-streaming radio station with
 this command:
 
 mplayer http://engine.collegemedia.vt.edu:8000/wuvt.ogg
 
 and I've successfully recorded (using scripts and at)
 fixed-duration RealPlayer radio shows to .wav to listen to them
 later.  But I'd like to record a specific show tonight from the
 continuous live ogg stream.
 
 I suppose I could set up an at job to start recording at 18:30
 and another to killall mplayer at 20:00, but I think that
 might cause problems (and it's hideously inelegant).
 
 Is there a better way?


I think it's better to kill elegantly with killall -3 mplayer.

You could also try mencoder -oac copy -endpos mm:ss, although if
I recall correctly mencoder doesn't or pure audio well (since
after all the m is supposed to stand for movie.).


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Anyone know how to do a timed program with mplayer?

2005-10-19 Thread Hugo Vanwoerkom

Adam Funk wrote:

On Monday 17 October 2005 17:50, Oliver Lupton wrote:



I guess this isn't the neatest either, but how about using mplayer's
slave mode (-slave), so it reads for commands from stdin. And have a
simple script which sleeps for 1:30 and then prints whatever mplayer's
stop command is to mplayer?



Interesting, thanks.



As I said it's not the neatest, but it's neater than killall mplayer
:)



Actually, a friend sent me a link to this site

  http://osl.iu.edu/~tveldhui/radio/
  Linux Radio Timeshift HOWTO

which includes the following slightly more sophisticated version of
killall in a sample script.

vsound realplay http://www.bbc.co.uk/cgi-bin/... 
VSOUND_PID=$!
sleep 3660
kill `ps | grep realplay | awk '{ print $1 }'`

# Wait for vsound to terminate, creating vsound.wav
wait $VSOUND_PID



But there is a big difference between realplay and mplayer. Mplayer has 
much cleaner sound. With vsound you get sound AND recording, can you do 
that with mplayer?


H


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Anyone know how to do a timed program with mplayer?

2005-10-19 Thread Adam Funk
On Wednesday 19 October 2005 12:30, Hugo Vanwoerkom wrote:

 But there is a big difference between realplay and mplayer. Mplayer
 has much cleaner sound. With vsound you get sound AND recording, can
 you do that with mplayer?

With mplayer, you can record sound from a stream as part of a batch job
without an X display, so you can (for example) run a script from at
while you're logged out.

mplayer -really-quiet -ao pcm:file=foo.wav 'rtsp://example.com/foo.ra'

lame --quiet foo.wav foo.mp3rm foo.wav


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Anyone know how to do a timed program with mplayer?

2005-10-18 Thread Hugo Vanwoerkom

Adam Funk wrote:

I can listen to a continuously ogg-streaming radio station with this
command:

mplayer http://engine.collegemedia.vt.edu:8000/wuvt.ogg

and I've successfully recorded (using scripts and at) fixed-duration
RealPlayer radio shows to .wav to listen to them later.  But I'd like to
record a specific show tonight from the continuous live ogg stream.

I suppose I could set up an at job to start recording at 18:30 and another
to killall mplayer at 20:00, but I think that might cause problems (and
it's hideously inelegant).



I've done just that to listen to KUSC at 2AM and stop at 5AM.

But I did it with two commands I implemented with Qt: do_sm and do_km.

Crontab starts do_sm at 2AM and it spawns mplayer to record.

Crontab starts do_km at 5AM and it finds the record with the PID of 
do_sm and kills it with a TERM, which mplayer gets and terminates.


Very elegant, but only because I did it that way of course ;-)

If you want I can send you the code but don't respond to the from 
address but to hugovanwoerkom at yahoo dot com. Care2 is the pits.


This prompts the question again: can you list and record at the same 
time with mplayer?


H


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Anyone know how to do a timed program with mplayer?

2005-10-18 Thread Adam Funk
On Monday 17 October 2005 17:50, Oliver Lupton wrote:

 I guess this isn't the neatest either, but how about using mplayer's
 slave mode (-slave), so it reads for commands from stdin. And have a
 simple script which sleeps for 1:30 and then prints whatever mplayer's
 stop command is to mplayer?

Interesting, thanks.

 As I said it's not the neatest, but it's neater than killall mplayer
 :)

Actually, a friend sent me a link to this site

  http://osl.iu.edu/~tveldhui/radio/
  Linux Radio Timeshift HOWTO

which includes the following slightly more sophisticated version of
killall in a sample script.

vsound realplay http://www.bbc.co.uk/cgi-bin/... 
VSOUND_PID=$!
sleep 3660
kill `ps | grep realplay | awk '{ print $1 }'`

# Wait for vsound to terminate, creating vsound.wav
wait $VSOUND_PID

-- 
Adam


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Anyone know how to do a timed program with mplayer?

2005-10-17 Thread Oliver Lupton

Adam Funk wrote:


I can listen to a continuously ogg-streaming radio station with this
command:

mplayer http://engine.collegemedia.vt.edu:8000/wuvt.ogg

and I've successfully recorded (using scripts and at) fixed-duration
RealPlayer radio shows to .wav to listen to them later.  But I'd like to
record a specific show tonight from the continuous live ogg stream.

I suppose I could set up an at job to start recording at 18:30 and another
to killall mplayer at 20:00, but I think that might cause problems (and
it's hideously inelegant).

Is there a better way?


 

I guess this isn't the neatest either, but how about using mplayer's 
slave mode (-slave), so it reads for commands from stdin. And have a 
simple script which sleeps for 1:30 and then prints whatever mplayer's 
stop command is to mplayer?


As I said it's not the neatest, but it's neater than killall mplayer :)

Cheers,

-ol


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]