Seeking guidance to record streaming audio at time of broadcast

marshall marshall at mcleave.orangehome.co.uk
Wed Sep 28 16:12:39 EDT 2011


On Wed, 28 Sep 2011 20:11:35 +0100
Clive <roadcone at gmx.com> wrote:

> >
> > Your commmand can be simplified a little:-
> > mplayer 'http://www.bbc.co.uk/radio/listen/live/r3_aaclca.pls'
> > -dumpstream -dumpfile r3.aac
> >
> > Then wrap it in m4a:-
> > ffmpeg -i r3.aac -acodec copy -absf aac_adtstoasc r3.m4a
> >
> > I think using the "pls" feed with mPlayer will be more reliable than
> > using the "mediaselector/special_event" feed with get_iplayer. ;-)
> >
> >
> When I use the long url taken from listenlive.eu, a couple of things
> - this seems to change periodically, even when I was trying it out
> this evening, and which url do I use, the '1' or the '2'? Secondly,
> while it is running, the terminal cursor flashes and the file r3.aac
> appears and gets bigger (as one would expect).
> 
> Now, if I use the generic url above, accessing the .pls file, the 
> terminal has all manner of activity; I don't get to see r3.aac
> created and when I press Ctrl+C, the activity stops but I can't find
> r3.aac. Can someone enlighten me please?
> 
> And where are my manners - a sincere thank you to those that have
> posted and got me this far.
> 
> I now need to incorporate this into at or crontab and neither seem to 
> work for me. Both list the job as forthcoming but neither run the 
> command line task. As an alternative, I have generated a bash script 
> r3.sh and the best that gets is a "command not found" error.
> 
> Thank you again, all.
> 
> Clive
> 


I would use atd to
schedule such a task. (I've never mastered cron)

If your script looks something like :

#!/bin/bash
mplayer 'http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lc1_radio3_p?s=1317145324&e=1317159724&h=b006a0bc719af9662e473ebc29ae78a6' -dumpstream -dumpfile r3.aac &

A simple one liner. Then:

chmod +x script.sh


Install atd

Then :
at 6pm monday < script.sh

or

at 6pm today < script.sh

etc....

To check the job has been added to the queue:

atq

you should see a job number.



oh and if you wish to stop the stream after say 2 hours add 


sleep 2h && killall mplayer

to the script.


I hope all that makes some sort of sense, I never know how to layout this sort of thing.
As for the streams changing, I don't know. I would find one that you are confident in and stick it in the script. Then you don't have to worry how long the url is or anything like that, it's just a script name to remember.



-Marshall





More information about the get_iplayer mailing list