Posts tagged: radio

Jul 22 2009

Stream High Quality AAC BBC iPlayer Radio and Live Radio to your Squeezebox


Update: See Part II of this post – all this has been improved and simplified…

I’ve been playing with get_iplayer PVR Manager (get_iplayer.cgi) on Linux (although it works on MacOSX and Windows also). It can now also act as an RTMP proxy to allow simple streaming of any flashaac radio or liveradio BBC iPlayer programme to a Slim Devices / Logitech Squeezebox (SBII or better). WARNING: This is still alpha quality experimental code….

All you need to do is:
Install and start the get_iplayer PVR Manager:

  • download get_iplayer.cgi from SVN (see the get_iplayer PVR Manager page)
  • Ensure you have flvstreamer installed and it’s location saved in your options
  • Ensure ffmpeg is installed and in the system PATH
  • Start it on your Linux server:

    perl get_iplayer.cgi –port=1935 –getiplayer=/path/to/get_iplayer –ffmpeg=/path/to/ffmpeg

Now configure the Squeezebox:

  • Go to the Squeezecenter page for your Squeezebox
  • Add a Favourite with the streaming URL. e.g. http://[server_ip_address]:1935/?ACTION=stream&PROGTYPES=liveradio&PID=bbc_radio_one&MODES=flashaac&OUTTYPE=a.wav
  • Go to your Squeezebox remote control or web page and play the favourite you have added.
  • Sit back and listen to much higher quality Radio at up to 192kbps AAC on your Hi-Fi

Similarly you can stream all sorts of programmes and modes on other http based media players. e.g.:

* Stream flash AAC liveradio as 320k mp3 stream:

vlc "http://localhost:1935/?ACTION=stream&PROGTYPES=liveradio&PID=[PID]&BITRATE=320&MODES=flashaac\
  &OUTTYPE=nnn.mp3"

* Stream flash livetv as an flv stream:

vlc "http://localhost:1935/?ACTION=stream&PROGTYPES=livetv&PID=[PID]&MODES=flashnormal\
  &OUTTYPE=nnn.flv"

* Stream flash AAC liveradio as a raw wav stream:

vlc "http://localhost:1935/?ACTION=stream&PROGTYPES=liveradio&PID=[PID]&MODES=flashaac\
  &OUTTYPE=nnn.wav"

* Stream tv as a quicktime stream:

mplayer "http://localhost:1935/?ACTION=stream&PROGTYPES=tv&PID=[PID]&MODES=iphone\
  &OUTTYPE=nnn.mov" -cache 2048

* Stream iphone radio as http mp3 stream:

vlc "http://localhost:1935/?ACTION=stream&PROGTYPES=radio&PID=[PID]&MODES=iphone\
  &OUTTYPE=nnn.mp3"

* Stream flash mp3 radio as http flac stream:

vlc "http://localhost:1935/?ACTION=stream&PROGTYPES=radio&PID=[PID]&MODES=flashaudio\
  &OUTTYPE=nnn.flac"

***PLEASE REWRITE THE DOUBLE QUOTES – this blog mangles them***

The valid [PID]s for any programme type can be determined by running:

get_iplayer –info [usual search terms]

Update (July 30th 2009): I changed SEARCH= to PID= in the latest version…Also updated to use new cmdline options. Also now works in Windows with the latest Automated Installer.
Update (September 18th 2009): I changed streaming URLs for the latest version.

Jun 25 2009

Simplified Live BBC TV and Radio Support in get_iplayer

get_iplayer v2.04 now has very much simplified Live TV and Radio support.

Two new programme types have been added: ‘livetv’ and ‘liveradio’. These types, if selected, will list the available programmes in the familiar listing format:

get_iplayer --type=livetv
Matches:
80000:  BBC Four - live
80001:  BBC News 24 - live
80002:  BBC One - live
80003:  BBC Parliament - live
80004:  BBC Three - live
80005:  BBC Two - live
80006:  CBBC - live
80007:  CBeebies - live

INFO: 8 Matching Programmes

Or you can just search, stream or playback by channel/programme name:

get_iplayer --type=liveradio 'Radio 1'
Matches:
80132:  BBC Radio 1 - live

INFO: 1 Matching Programmes

To directly stream a selected live programme in all OSes (except Win32) you can use:

get_iplayer --stream 80001 --player='mplayer -cache 256 -'

Where –player can refer to any player command than can play programmes from STDIN. Or simply use:

get_iplayer --stream 80001 | mplayer -cache 256 -

The advantage of the –player option is that it can be saved in your default options as follows:

get_iplayer --prefs-add --player='mplayer -cache 256 -'

Then you can just stream via mplayer using:

get_iplayer --stream 80001

( –stream is just a synonym for –stdout –nowrite )

To record a live stream use:

get_iplayer --get 80001

Specifying modes has changed a little. –amode has become –radiomode and –vmode is now –tvmode. Additionally, –modes=<modelist> can be used to set a general default set of modes for all programme types.

Likewise, embedded media web pages can be played more easily. e.g.:

get_iplayer --stream --type=radio
  --url="http://www.bbc.co.uk/robertburns/works/a_bards_epitaph/"

Or recorded using:

get_iplayer --get --type=radio
  --url="http://www.bbc.co.uk/robertburns/works/a_bards_epitaph/"

The only major thing I’ve not been able to get working is direct streamed playback under native Windows. If anyone knows why it won’t work or has a fix or workaround please let me know! I’ve tried with ‘vlc -‘, ‘ffplay -‘ and ‘mplayer -‘ and all seem to just fail.

Apr 29 2009

get_iplayer now Searches and Records All Standard UK TV Channels

Update 6th May 2009: You might want to read this first…

A milestone has been reached today with the addition of Channel 5’s Demand Five service to the list of DRM-free services that get_iplayer can index, search and record. The following are now supported:

Supported platforms are: Linux, MacOSX, Windows and pretty much any modern OS that can run perl. See the download and installation pages.

To download and search programmes use:

get_iplayer –type=TYPE <other options>

Where TYPE is either ‘tv’ (BBC TV), ‘itv’, ‘ch4’, ‘five’, ‘radio’ (BBC Radio), or ‘podcast’ (BBC).

For full instructions see the documentation page

Now I’m off for a beer….

Feb 14 2009

BBC iPlayer AAC Radio streams now available using get_iplayer

It’s just been pointed out to me the after much waiting, the BBC have started to make AAC streams available for their listen again content on the iPlayer. The bitrates vary from 96 kbps to 128 kbps from what I can see. This will possibly result in better quality. AAC 128kbps can certainly be an improvement over the same bit-rate MP3 but it does seem that the BBC have reduced the bandwidth and quality to AAC 96kbps to save us a whole 32 kbps !! Oh well, you at least still have the choice between MP3 and AAC. Make sure you have rtmpdump installed to be able to download AAC.

In get_iplayer, the default order of trying to download a Radio programme is: iphone,flashaac,flashaudio and realaudio. You can explicitly specify to use AAC mode by using

get_iplayer --type=radio --amode=flashaac [other search options]
Sep 24 2008

get_iplayer now downloads BBC iPlayer Radio in glorious 128k MP3 format + other features

It was discovered this evening that the iPhone can get BBC iPlayer radio programmes in higher quality MP3 format. It basically uses the same method used for the iPhone video downloads. get_iplayer v0.74 now supports this fully and can also fallback to RealAudio format for those shows that still have not been made available to the iPhone. The MP3s are 128kbps stereo 44.1kHz – better than the rather sad 64kbps realaudio streams we had before. Shame there are no ID3 tags yet – come on BBC 🙂
For reverting to downloading the realaudio streams in get_iplayer you must use the –amode=realaudio option.

Other New features in get_iplayer lately are:

  • A download history is now maintained which prevents the accidental re-downloading of programmes that you may have deleted
  • Ability to see which programmes have become available since the last cache refresh
  • The –since option which allows you to see programmes added to the cache since a number of hours ago
  • The –list [channel|categories] option which displays a unique list of categories and channels for the specified type of programme

Try using the get_iplayer –help option to see all new options.

Update v0.75:

  • get_iplayer will now automatically try to download the MP3 radio stream and then fallback on RealAudio streams.
  • In radio mode –amode=realaudio option will prevent mp3 streams being downloaded
  • In radio mode –amode=mp3 will ensure that no RealAudio is downloaded – i.e. it disables the default fallback to realaudio
  • –force-download will make get_iplayer ignore the download history

Another update: Classical music appears to be encoded at 192kbps and speech at 80kbps.

WordPress Themes