Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > Audio stream recording
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 07-01-2017, 03:12 PM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

How to record BBC iPlayer without signing-in


As of July 1st, 2017, any attempt to listen to the BBC Radio iPlayer is met with a refusal, unless you are signed-in to a BBC account.

The schedules for iPlayer are at (for example) here:
http://www.bbc.co.uk/radio4extra/programmes/schedules

To listen without signing in, there are various options.


Listen to the live stream, using Winamp (or any media player of your choice), with one of these URLs -
http://bbcmedia.ic.llnwd.net/stream/...dio4extra_mf_p
http://bbcmedia.ic.llnwd.net/stream/...dio4extra_mf_q
http://www.radiofeeds.co.uk/bbcradio4extra.pls



Listen to the live stream (the 320 kbps version), using VLC Media Player, with this URL -
http://as-hls-uk-live.akamaized.net/...%3d320000.m3u8
The VLC media player is here: http://www.videolan.org/vlc/




Download one of the live streams, using the program FFMPEG.EXE, with one of these commands (at a command prompt, or in a batch file) -

Code:
ffmpeg -v 16 -stats -i "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_p" Out.mp2
Code:
ffmpeg -v 16 -stats -i "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_q" Out.mp2



Listen to an on-demand Listen Again programme (but not the live stream), using Internet Explorer 8.

Because IE8 uses an old version of javascript, it does not recognise the newer forms of javascript used in iPlayer. It in effect ignores them, and so the audio stream plays normally.

Just turning off javascript won't work. The iPlayer refuses to stream any audio if the browser has no javascript support at all.



Here's how to download an on-demand programme from the Listen Again service -


FFMPEG command line from Greasemonkey script

These instructions are for use in Windows XP / Vista / 7 / 8 / 10. There are links below to obtain the software mentioned.


To obtain the command line -

1. Open the Firefox browser (must have the Greasemonkey extension installed, and the iPlayer greasemonkey script installed).

2. Open the iPlayer page which plays the radio show, using Firefox. After a few moments, an FFMPEG command line will be displayed immediately below the area where the radio show plays.


To run the command line -

3. Create a batch file (a plain-text file with the extension .bat or .cmd).
4. FFMPEG.exe must be copied into the same directory/folder as the batch file.
5. Copy-and-paste the command line into the batch file.
6. Modify the file extension specified on the command line: change it from .mp3 to whatever you want (see below).
7. Run the batch file.


Software required -

FFMPEG.exe (Static build recommended)
https://ffmpeg.zeranoe.com/builds/

Firefox 39
https://ftp.mozilla.org/pub/firefox/...tup%2039.0.exe

Greasemonkey extension for Firefox 39
https://addons.mozilla.org/en-US/fir.../greasemonkey/

Greasemonkey script 'BBC iPlayer video download', for Firefox 39
https://greasyfork.org/en/scripts/81...ideo-download/

Addendum : You might need to replace the .js file installed by the current version of the installer with an older version of that file (version 3.6.3) to get the script to work in Windows. Here's a link to v3.6.3:

BBC iPlayer video download v 3.6.3 -
https://www.mediafire.com/?awx3o4v2l49yceg

In Windows 7, the .js file is in this folder -

C:\Users\%Username%\AppData\Roaming\Mozilla\Firefo x\Profiles\<ProfileName>\gm_scripts\BBC_iPlayer_vi deo_download


Notes -

The above procedure can download a file in various formats, including (for radio): .mp3, .mp2, .m4a, .ts

For instance, .MP2 files have a 384 kbps stream, of better audio quality than the MP3 stream.


M4A : Variable KBPS rate, up to 200 kbps; 48 kHz; Stereo; MPEG-4 AAC LC
MP3 : Fixed 128 KBPS rate; 48 kHz; Stereo; MPEG-1 layer 3
MP2 : Fixed 384 KBPS rate; 48 kHz; Stereo; MPEG-1 layer 2
TS : Fixed 384 KBPS rate; 48 kHz; Stereo; 16 bit per sample
WAV : Fixed 1536 KBPS rate; 48 kHz; Stereo; Signed 16 bit PCM


M4A is downloaded if the command line specifies an output file with the extension .M4A
MP3 is downloaded if the command line specifies an output file with the extension .MP3
MP2 is downloaded if the command line specifies an output file with the extension .MP2
TS is downloaded if the command line specifies an output file with the extension .TS
WAV is downloaded if the command line specifies an output file with the extension .WAV


By default, the Greasemonkey script adds .mp3 to the command line; but you can replace that with any of the above alternatives (or some other). I recommend replacing it with .mp2 instead, because of its superior bitrate.


I developed this solution on my laptop, which happens to be running the Firefox v39 browser. The solution will probably work in other versions of Firefox; but if it doesn't (some add-ons only work on particular Firefox versions), be aware that you can always force it to work - by installing Firefox 39.

If you are running Internet Explorer, don't uninstall IE. On Windows 7, there are no problems arising if you also install Firefox. The most that might happen is all urls start opening in Firefox (which is easy to fix): both browsers co-exist happily on my laptop, and have done for years.



Read this article (by Andrea Lazzarotto) for further information -
https://andrealazzarotto.com/2015/02...player-videos/
I only understand Windows! But Andrea develops this software in the Linux operating system. So Andrea's webpage has information for anyone wishing to download from iPlayer using a computer running on Linux.
Reply With Quote
  #2  
Old 07-08-2017, 08:53 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Re: How to record BBC iPlayer without signing-in


As of July 1st, any attempt to listen to the BBC Radio iPlayer is met with a refusal, unless you are signed-in to a BBC account.

To listen without signing in, there are various options (in addition to those mentioned above).


If you are running any version of the Windows operating system, edit the HOSTS file.

Add the following line (blocks the script which forces you to sign-in):
127.0.0.1 ssl.bbc.co.uk
Note: How to edit a HOSTS file - Edit HOSTS file




Listen to the live stream, using Winamp (or any media player of your choice), with one of these URLs -
http://bbcmedia.ic.llnwd.net/stream/...dio4extra_mf_p
http://bbcmedia.ic.llnwd.net/stream/...dio4extra_mf_q
http://www.radiofeeds.co.uk/bbcradio4extra.pls



Listen to the live stream, using VLC Media Player, with one of these URLs -

128 kbps stream:
http://a.files.bbci.co.uk/media/live...our_extra.m3u8
http://a.files.bbci.co.uk/media/live...our_extra.m3u8

320 kbps stream:
http://a.files.bbci.co.uk/media/live...our_extra.m3u8
http://as-hls-uk-live.akamaized.net/...%3d320000.m3u8

VLC media player is here: http://www.videolan.org/vlc/




If Andrea Lazzarotto's script doesn't display a command line (even when you replace the latest version with version 3.6.3), you might be able to get a working stream url from the following site:
http://www.iplayerconverter.co.uk/convert.aspx

To get the vpid which that site needs (an 8-digit text string):
1. Open the iPlayer page for the radio show, in Firefox.
2. Without playing that show, right-click on that page, and select 'View Page Source'.
3. Search (on the toolbar: Edit > Find) the resulting text for the phrase: "vpid"

The following 2-line batch file (name it, say, download.bat) can be used to test whether any given url works (put ffmpeg.exe in the same folder as the .bat file) -
SET url=
ffmpeg -v 16 -stats -i %url% output.mp2

Copy-and-paste the url address into the batch file, so that the SET command looks like this example -

Code:
SET url=http://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/dc7feb-b006bm2h/vf_b006bm2h_8c83614a-8af7-4054-a60c-13241d62d475.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499036530_28808d5a86fb76d13d26039fc83f8cc5
Note that a HLS stream is an mpeg stream, therefore should probably ONLY be used to download a stream in the .mp3 or .mp2 or .mpeg or .ts format. Most likely it will throw a wobbly if you use it to download in .mp4 or .m4a or .aac format.




Of course, once you have the vpid you can simply modify the following url (substitute the 8-digit vpid for the 8 zero's) -

Code:
http://open.live.bbc.co.uk/mediaselector/5/redir/version/2.0/vpid/00000000/mediaset/audio-syndication/proto/http
That url, once it includes the 8-digit vpid, will work successfully as the url to feed to ffmpeg in my 2-line batch file (download.bat), above.




Note: Alternatively, you might be able to get a working stream url from the following page (a HLS stream):
https://beebotron.org/listings/radio4extra/hls/
Warning - The Beebotron DASH links do not work with this method (FFMPEG can't download the audio stream from a DASH url in this format)
Note that a HLS stream is an mpeg stream, therefore should probably ONLY be used to download a stream in the .mp3 or .mp2 or .mpeg or .ts format. Most likely it will throw a wobbly if you use it to download in .mp4 or .m4a or .aac format.






This is the URL address of the xml page (replace the 8 zero's with the 8-digit vpid):

Code:
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/mobile-phone-main/transferformat/hls/vpid/00000000

The xml page displays 6 links (all .m3u8 playlist links) (and all of them HLS links), ALL six of which will download the target "Listen Again" radio show (using ffmpeg.exe and the file download.bat, above).

Note: In each url, replace all occurances of the character & with ^& to make the url work in a .bat file.


ALL six links give a 384 kbps stream when an .mp2 stream is requested, even though the page says they are only 128 kbps or 320 kbps links. ALL give an .mp2 stream when that stream is requested, even though the page says they are only mp4/aac links. Presumably both effects are a consequence of these being *playlist* links (i.e. behind the scenes - hidden from us - they give branching access to a wide range of differing streams, branches which ffmpeg can follow without additional input from you).

(That level of sophistication is something you only get with ffmpeg. Don't expect to duplicate these results with any other program.)


The six links differ only in that 4 of them give a faultless download, while 2 show errors (and of those 2, each throws different errors) -
Faultless: (http) akamai_hls_open
(https) akamai_hls_open_https
(https) af_akamai_uk_hls_https
(https) af_limelight_uk_hls_https
Errors: (http) af_akamai_uk_hls
(http) af_limelight_uk_hls

So the secure connections (_https), and the open connections (_open), fare best. The faults occur on UK connections (_uk) that are NOT secure (don't use https, i.e. no _https), which is perhaps a consequence/indication of heavier traffic on those links.

Easily the worst performance is Limelight's UK connection over http (af_limelight_uk_hls) - which lost so much data, on some occasions, that the radio show was actually incomplete.

In my tests, the very best performance (perfect download) was given ONLY by the two _open links: akamai_hls_open and akamai_hls_open_https.

I expect the two _open links to work internationally, i.e. for listeners outside the UK. (All six links work for listeners within the UK, or who connect to iPlayer through a proxy node that's within the UK.)






This is the URL address of an alternative xml page (replace the 8 zero's with the 8-digit vpid):

Code:
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/apple-ipad-hls/vpid/00000000
This xml page displays 3 links (all .m3u8 playlist links) (and all of them HLS links), ALL three of which will download the target "Listen Again" radio show (using ffmpeg.exe and the file download.bat, above).

Note: In each url, replace all occurances of the character & with ^& to make the url work in a .bat file.


.

Last edited by Ed999 : 07-08-2017 at 09:35 AM.
Reply With Quote
  #3  
Old 07-08-2017, 09:01 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

How to listen to BBC iPlayer without signing-in -- Examples


Here are some recent examples of the ffmpeg command line which downloads the audio stream (in these examples, downloading an .mp2 file from a HLS stream).

These are just examples of the correct syntax to use.

Obviously, none of these examples will actually download anything now, as the https url is only valid for a couple of hours, and all of these have expired. To use these examples again (within the 30 days that a show is available on the iplayer site), that url must be replaced with a current one.


Code:
ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/3be86f-b08w933f/vf_b08w933f_036923dd-b21a-4507-bc02-6715dcf0c2ef.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1498354121_b90a8c9bcae3a8263772a5fb16def086" -ss 0.7 -aframes 148900 Episode_1_The_Lost_Stories_Point_of_Entry_Doctor_Who_BBC_Radio_4_Extra[148900].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/fef031-b005fsvh/vf_b005fsvh_30bf17f0-dec0-4cc0-a149-638bb8bbf663.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1498845579_d972a3d872dc2d2bfa0d07f083f7e1f5" -ss 0 -aframes 73191 Confrontation_in_Paris_John_Creasey_The_Toff_and_the_Runaway_Bride_BBC_Radio_4_Extra[73191].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/8d0ec4-b00scvd8/vf_b00scvd8_bb0f16de-1089-49e5-a2cd-64dcb05a28f4.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1498845729_0367660370a382568169ecb0ceb6517e" -ss 0.615 -aframes 74024 Episode_9_Series_3_I_m_Sorry_I_ll_Read_That_Again_BBC_Radio_4_Extra[74024].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/d9fb9a-b009xxqs/vf_b009xxqs_14c0eef4-6261-4539-a1ac-6c1bc07026d9.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1498845897_1e8f2b3ededb62e93ba1cb722b1c4886" -ss 0.015 -aframes 73924 In_General_Practice_Doctor_at_Large_BBC_Radio_4_Extra[73924].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/dc7feb-b006bm2h/vf_b006bm2h_8c83614a-8af7-4054-a60c-13241d62d475.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1498930981_04653b10d6ee167d8190829f569201ca" RL_Stevenson_Treasure_Island_BBC_Radio_4_Extra.mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/c6a440-b08wx026/vf_b08wx026_c8727fcc-f6a1-44bd-adcf-f5766667bf28.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1498955654_1b3e124b9c3ca301769fb056cc05d51b" -ss 1.115 -aframes 149045 Episode_2_The_Lost_Stories_Point_of_Entry_Doctor_Who_BBC_Radio_4_Extra[149045].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/457513-b00g9h4n/vf_b00g9h4n_9da5503c-03e5-4d10-9dc9-35cb511d9c22.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499044128_7d491eede9b7d87b6e24d60a3e663f28" -ss 1.315 -aframes 72347 From_30_01_1957_Educating_Archie_BBC_Radio_4_Extra[72347].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/f4b59b-b063j9bz/vf_b063j9bz_4e2e241c-f8f1-4a18-8f40-251febd05484.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499045074_b5999663dfd57847fcac2f0bc058bc2b" -ss 0.515 -aframes 68141 From_18_07_1961_Whack_O_BBC_Radio_4_Extra[68141].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/a87a96-b00279s7/vf_b00279s7_bbd0cc49-3bf3-4385-be98-1d165cb92414.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499101315_147c080b0c35b3d29cb9a64fd858b517" -ss 1.015 -aframes 68821 Mum_s_Army_Series_2_Dad_s_Army_BBC_Radio_4_Extra[68821].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/ecb1f6-b01f9t29/vf_b01f9t29_f603006f-9416-42bf-ba13-c10b202aa076.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499102617_5950d087f40a0ccab3ac9b83c98e2678" -ss 1.015 -aframes 71458 Episode_1_North_East_of_Eden_BBC_Radio_4_Extra[71458].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/6009b8-b0027l55/vf_b0027l55_a4340db0-f8de-46d2-8c7e-340a17176bc7.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499221714_851a7329436c04ca263c82e16ebb623f" -ss 0 -aframes 69073 Upstairs_Downstairs_Upstairs_Downstairs_Series_6_Steptoe_and_Son_BBC_Radio_4_Extra[69073].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/ad967a-b00zmxmc/vf_b00zmxmc_04a4eee4-bb3b-4b43-a953-4c99c567c072.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499222502_d723e08c7e5b71817dee68cfc4fae1b5" -ss 0.2 -aframes 67524 Storm_in_a_Tea_Urn_The_Men_From_the_Ministry_BBC_Radio_4_Extra[67524].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/fdce3a-b005hc91/vf_b005hc91_9b4bd9b1-4f6a-4049-a447-772d3a71c223.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499275466_6bd299693cfcec6e4a617a3c88117642" -ss 0.015 -aframes 74451 Operation_Fag_End_Series_1_The_Navy_Lark_BBC_Radio_4_Extra[74451].mp2

ffmpeg -v 16 -stats -i "https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/b16b8d-b005jy99/vf_b005jy99_6a28ecef-584b-4380-9856-fa7abf5786c7.ism/mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=1499276437_3c5953396fbb94a876a61b121c3106f8" -ss 1.615 -aframes 74333 Sunday_Afternoon_at_Home_Series_5_Hancock_s_Half_Hour_BBC_Radio_4_Extra[74333].mp2

The easiest source of a replacement url for these is probably -
http://www.iPlayerConverter.co.uk/convert.aspx

Looking at the first part of one of these example urls -

Code:
https://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/3be86f-b08w933f/ ...
the section highlighted in red is the vpid which the iPlayerConverter.co.uk page requires.


For instance, this form of url (from iPlayerConverter.co.uk which they call the Playlist URL) works fine as a substitute for the original https url shown in my above examples -

Code:
http://open.live.bbc.co.uk/mediaselector/5/redir/version/2.0/vpid/b08w933f/mediaset/audio-syndication/proto/http
You can in fact simply take this url and put the substitute vpid in yourself (i.e. replacing b08w933f), and that url is then useable, without bothering to go to the iPlayerConverter.co.uk site.

One thing you need to know, though. This is a "HLS MP3 (UK only)" url, so it will probably only work if the download is using the mp3 format (i.e. the filename has either the .mp3 or .mp2 or .mpeg or .ts extension). And if you are in the UK.

For non-UK listeners, try the Firefox add-on anonymoX 2.5.3.1 (compatible with Firefox 39). I can't test it, because I'm in the UK.




Slightly off-topic, for listeners outside the UK here (briefly) is a comparison of a UK stream with a non-UK stream, showing the differences between them. The differences which I think are significant I've highlighted in blue.

Example of Akamai HLS url (UK stream) (a UK Stream for mobile phones) -
http ://aod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/
dc7feb-b006bm2h/vf_b006bm2h_8c83614a-8af7-4054-a60c-13241d62d475.ism/
mobile_wifi_main_sd_abr_v2_uk_hls_master.m3u8?__gda__=
1499036530_28808d5a86fb76d13d26039fc83f8cc5
Example of Akamai DASH url (a nonUK stream) -
http ://aod-dash-ww-live.akamaized.net/usp/auth/vod/piff_abr_full_audio/
03316c-b08vxtx4/vf_b08vxtx4_417a1117-ab79-43bb-bd4a-56d511bce726.ism/
pc_hd_abr_v2_nonuk_dash_master.mpd?__gda__=
1499120071_1e7c85c8b3a4d6fc439d8b41a92171a1

.

Last edited by Ed999 : 07-08-2017 at 09:48 AM.
Reply With Quote
  #4  
Old 07-08-2017, 09:09 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

The simplest solution


Having now had a couple of days to review all the download solutions, in my opinion the simplest is the following.


STEP 1: Get the vpid (an 8-digit text string)

1. Open the iPlayer page for the radio show, in Firefox.
2. Without playing that show, right-click on that page, and select 'View Page Source'.
3. Search (on the toolbar: Edit > Find) the resulting text for the phrase: "vpid"

NB: You might use Internet Explorer instead. Some versions ( e.g. Internet Explorer 8 ) allow you to view a page's source (on the toolbar: View > Source).


STEP 2: Modify the following url (substitute the 8-digit vpid for the 8 zero's) -

Code:
http://open.live.bbc.co.uk/mediaselector/5/redir/version/2.0/vpid/00000000/mediaset/audio-syndication/proto/http

The media player Media Player Classic - Home Cinema (a.k.a "MPC-HC") can play this url, if the vpid is substituted for the 8 zero's.
Get MPC-HC here: https://mpc-hc.org OR https://mpc-hc.org/downloads/
On Windows 7 64-bit I recommend this version: MPC-HC.1.7.10.x64.exe

STEP 3: To download the radio show, create the following .bat file -
a. Create a plain text file, and name it: download.bat
b. Open that file using NOTEPAD.EXE (or any simple text editor), then copy-and-paste the following 2 lines into it -
Code:
SET url=
ffmpeg  -v 16  -stats  -i %url%  "output.mp2"
c. After url=, paste the MODIFIED url from STEP 2, containing the actual 8-digit vpid (in place of the 8 zero's)
d. Save the file. Make certain you save it with the extension .bat (NOT .txt)
e. Put ffmpeg.exe in the same folder as the .bat file
Get it here: https://ffmpeg.zeranoe.com/builds/
f. Double-click the .bat file to run it

When you have copied the url address into the .bat file, in step 3c, that file should look like this example -

Code:
SET url=http://open.live.bbc.co.uk/mediaselector/5/redir/version/2.0/vpid/12345678/mediaset/audio-syndication/proto/http
ffmpeg  -v 16  -stats  -i %url%  "output.mp2"
Note that a HLS stream is an mpeg stream, therefore can probably ONLY be used to download a stream in the .mp3 or .mp2 or .mpeg or .ts format (i.e. the output file should be named output.mp3 or output.mp2 or output.mpeg or output.ts). Obviously, call it what you like; but (to avoid problems) it should have the .mp3 or .mp2 or .mpeg or .ts extension.


.
Reply With Quote
  #5  
Old 07-25-2017, 07:44 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

How to force the Live Stream to use 384kbps


Here is a method for forcing the live stream to run at 384 kbps, instead of at the standard bitrate of 320 kbps.


Use any of these four command lines (these examples are from BBC Radio 4 Extra) -

Code:
SET url=http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_med/ak/bbc_radio_four_extra.m3u8
ffmpeg  -v 16  -stats  -i %url%  output.mp2
Code:
SET url=http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_four_extra.m3u8
ffmpeg  -v 16  -stats  -i %url%  output.mp2
Code:
SET url=http://as-hls-uk-live.akamaized.net/pool_6/live/bbc_radio_four_extra/bbc_radio_four_extra.isml/bbc_radio_four_extra-audio=320000.m3u8
ffmpeg  -v 16  -stats  -i %url%  output.mp2
Code:
SET url=http://as-hls-uk-live.akamaized.net/pool_6/live/bbc_radio_four_extra/bbc_radio_four_extra.isml/bbc_radio_four_extra-audio=320000.norewind.m3u8
ffmpeg  -v 16  -stats  -i %url%  output.mp2

To play the command line, copy-and-paste the url into, for example, VLC Media Player.


To download the live stream, copy-and-paste one of the 2-line command lines into a batch file ( e.g. download.bat ), put the batch file in the same directory as the ffmpeg.exe program, then run the batch file.

Notes on creating a batch file: Create a Batch file
Reply With Quote
  #6  
Old 01-02-2018, 03:19 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

How to record BBC iPlayer without signing-in


Download Radio (or TV) using only the 8-digit PID :


It's now possible to use YouTube-dl.exe to download from BBC iPlayer *without* using the Greasemonkey script that I've discussed previously on this forum.


Here is a method for downloading from BBC iPlayer using only the url address of the BBC iPlayer page. This method works for BBC Radio shows and for BBC TV shows.

This means that -

  • You can download without having to log-in to a BBC account
  • You can download without having to install Adobe's flash player
  • You can download without having to find the broadcast's hidden vpid number


One preliminary step, first. Download the YouTube-dl program (originally developed for downloading from YouTube, but its latest version can download from many websites which use DASH streams including the BBC's iPlayer site) -

https://rg3.github.io/youtube-dl/

The program does NOT require installing. Just put it in any convenient folder/directory.



And a second preliminary step. Download the ffmpeg program -

http://ffmpeg.zeranoe.com/builds/

Put it in the same folder/directory with the YouTube-dl program. That is now your working directory.



For a Radio show, use the following command line (actually two lines in this case!) -

Code:
    SET url=https://www.bbc.co.uk/programmes/00000000

    YouTube-dl.exe  -f "bestaudio[protocol*=dash]"  --add-metadata  "%url%"

1. Copy-and-paste the command (above) into a batch file (in Windows, a batch file is a plain text file with the extension .bat or .cmd instead of .txt), and put the batch file in the same folder as YouTube-dl.exe and ffmpeg.exe

2. Substitute the actual URL address of the iplayer page which plays the radio show for the one shown in my example. In effect you are just replacing the final 8 zero's in my example with the actual 8-digit PID (Programme ID).

3. Then run the batch file by double-clicking it.

The file which downloads should already have the extension .mp4 or .m4a (but if by chance it has not, you simply add either of those extensions). M4A is the iTunes extension.



For a TV show, use the following command line (actually two lines!) -

Code:
    SET url=https://www.bbc.co.uk/iplayer/episode/00000000

    YouTube-dl.exe  "%url%"  -f best  --add-metadata

1. Copy-and-paste the command (above) into a batch file (in Windows, a batch file is a plain text file with the extension .bat or .cmd instead of .txt), and put the batch file in the same folder as YouTube-dl.exe and ffmpeg.exe

2. Substitute the actual URL address of the iplayer page which plays the TV show for the one shown in my example. In effect you are just replacing the final 8 zero's in my example with the actual 8-digit PID (Programme ID).

3. Then run the batch file by double-clicking it.

The file which downloads should already have the extension .mp4 (but if by chance it has not, you simply add that extension).

Note that the command does not mention ffmpeg. This is NOT a mistake. The YouTube-dl program calls ffmpeg when it requires to use certain functions of ffmpeg, and calls it automatically so that you don't need to. Just bear in mind that things will go wrong if ffmpeg is not in the same folder as YouTube-dl.

Note that a tv show uses a different url address to that for a radio show, so be sure to use 2 separate batch files, as there is no benefit in trying to use only one. The 2nd line is also different in the case of a tv show.



That's all there is to it. But there are some additional options for a tv show, if you want to be in better control of the file you end up with.

Unlike radio (which usually has only 2 streams, a 128 kbps one and a 320 kbps one), TV has a large number of available streams. You can use the above command to get the default stream.

But if the default stream gets you a file that won't play (many of the available streams use the new avc3 codec, which only Windows 10 can play, so if you use Windows 7 you will instead prefer to have a file containing a stream which has the avc1 codec), then you need to get a list of the available streams ("formats").

Put the following command in a batch file (name it, say, TV_streams.bat) and run it (substitute the TV show's actual url for the one in my example, just as you did above) -

Code:
    SET url=https://www.bbc.co.uk/iplayer/episode/00000000

    YouTube-dl.exe "%url%" --list-formats > Formats.txt
Wait, then open the text file Formats.txt using Notepad (it will take perhaps a minute to download all the data into it). Then pick a stream: they will be listed by video size, e.g. 640x360, and by codec, e.g. avc1.

The following is a substitute batch file to download the TV stream you choose. This is a simple example (there are many other possibilities); but this is designed to avoid complicating matters -


Code:
    SET url=https://www.bbc.co.uk/iplayer/episode/00000000

    SET format=stream-uk-iptv_streaming_concrete_combined_sd_mf_akamai_uk_hls_https-1836

    YouTube-dl.exe  "%url%"  -f %format%  --add-metadata

Ideally, you will choose a stream which (as in this example) is a "combined" stream - as stated in the name of the stream. A combined stream is one which contains both audio and video.

I recommend the 1836 stream (shown in this example) because it contains AVC video (a.k.a. avc1 video), UK-style 25 fps (frames per second), an image size of 960x540 pixels, and good quality audio at 128 kbps.

Do NOT choose any video stream containing the avc3 codec, unless you have satisfied yourself that your computer can play that! If you are running Windows XP, Windows Vista, or Windows 7 it's a good bet you can't play a file containing the avc3 codec stream.


1. Copy-and-paste the command into a batch file (in Windows, a batch file is a plain text file with the extension .bat or .cmd instead of .txt), name the file (for example) TV_1836stream.BAT, and put the batch file in the same folder as YouTube-dl.exe and ffmpeg.exe

2. Substitute the actual URL address of the iplayer page which plays the TV show for the one shown in my example. In effect you're just replacing the final 8 zero's in my example with the actual 8-digit PID (Programme ID).

3. Substitute the actual name of your chosen stream, if you are not opting for my choice of the 1836 stream. (If you choose separate audio and video files, instead of a combined file, you'll need to make the necessary changes to line 3 of the batch file - so you'll need to do a Google search on the term ffmpeg to find an appropriate command.)

4. Then run the batch file by double-clicking it.
Reply With Quote
  #7  
Old 04-14-2018, 09:27 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: How to record BBC iPlayer without signing-in


Ed,

one humble line from your post caught my eye, .mp2 extension trick to squeeze one extra bit of sound quality.

ffmpeg -v 16 -stats -i %url% output.mp2

Do you listen to music on http://www.shoutcast.com ?

vlc.exe http://104.236.206.12:9302/stream

start "Praise Radio" streamripper.exe http://104.236.206.12:9302/stream -d C:\ -o never -u WinampMPEG/5.66

Default appears to be .mp3 128 kb/s for streamripper.

With ffmpeg I get .mp2 384 kb/s.

Good side of streamripper is that it tags .mp3's with names and saves them one by one rather than
one continuous file like ffmpeg.

Do you have an idea how can we get the same outcome with ffmpeg or 384 kb/s files with streamripper ?

http://streamripper.sourceforge.net/tutorialconsole.php

Unrelated, here is one trick if you prefer .flv file for Sky News.
youtube-dl doesn't give you that option, so here it is.

youtube-dl.exe -f 94 https://www.youtube.com/watch?v=XOacA3RYrXk -o - | ffmpeg.exe -i pipe:0 -c:v copy -c:a aac c:\sky.flv
Reply With Quote
  #8  
Old 04-18-2018, 06:01 AM
j_cool j_cool is offline
Senior Member
 
Join Date: Feb 2016
Posts: 515
j_cool is on a distinguished road
Default

Re: How to record BBC iPlayer without signing-in


Here is a little awkward solution for naming .mp2 files:

Record the same stream at the same time with ffmpeg and streamriper to get .mp3s just for the sake of filenames.

At the end, cut selected songs out of file.mp2 and use names of .mp3s.

Somebody here come with proper solution for the sake of ISP bandwidth.


Last edited by j_cool : 04-18-2018 at 06:43 AM.
Reply With Quote
  #9  
Old 04-19-2018, 01:42 AM
nguyenthanhtam9723 nguyenthanhtam9723 is offline
Member
 
Join Date: Oct 2016
Posts: 33
nguyenthanhtam9723 is on a distinguished road
Default

Re: How to record BBC iPlayer without signing-in


http://caobanlong.org/cao-ban-long-la-gi/
Reply With Quote
  #10  
Old 05-02-2018, 01:21 AM
Ed999 Ed999 is offline
Senior Member
 
Join Date: Feb 2009
Posts: 115
Ed999 is on a distinguished road
Default

Re: How to record BBC iPlayer without signing-in


Quote:
Originally Posted by j_cool View Post
one humble line from your post caught my eye, .mp2 extension trick to squeeze one extra bit of sound quality.

ffmpeg -v 16 -stats -i %url% output.mp2

Do you listen to music on http://www.shoutcast.com ?

vlc.exe http://104.236.206.12:9302/stream

start "Praise Radio" streamripper.exe http://104.236.206.12:9302/stream -d C:\ -o never -u WinampMPEG/5.66

Default appears to be .mp3 128 kb/s for streamripper.

With ffmpeg I get .mp2 384 kb/s.

Good side of streamripper is that it tags .mp3's with names and saves them one by one rather than
one continuous file like ffmpeg.

Do you have an idea how can we get the same outcome with ffmpeg or 384 kb/s files with streamripper ?

http://streamripper.sourceforge.net/tutorialconsole.php



I recently spent a lot more time researching exactly what ffmpeg does, but although I updated some forums where I post, I must apologise for not having updated this thread.

I misunderstood some information about ffmpeg which I found on-line. Although what I posted here was posted in good faith, nevertheless it turned out to be wrong in an important respect. A lot of testing has convinced me that the only effect which specifying .mp2 as the file extension has, is to cause ffmpeg to give special treatment to the input stream it receives.

Note that ffmpeg is called that because it was designed originally to process mpeg streams only. When it receives input as an mpeg stream, which is what an .mp2 stream is, some default behaviour occurs. But the mp2 extension seems to be the only one which still has the behaviour in question. The more popular mp3 format seems to now have its own unique behaviour - so even though it too is an mpeg stream, if you specify mp3 as the output file's extension then ffmpeg exhibits quite different behaviour, not at all what it does with mp2 output.

With mp2 as the output format, recent builds of ffmpeg will save the stream to disk at a 384 kbps bitrate regardless of the bitrate of the incoming stream. Even a 64 kbps stream is automatically saved as a 384 kbps file. The ffmpeg developer apparently believes that the mp2 codec is of such poor quality that saving the stream at less than 320 kbps is pointless. This is a rubbish argument, since I have recordings at 80 kbps using mp2 that are, at least for speech, every bit as good as mp3 at that bitrate.

The 320 kbps streams I was using for testing in my original research were too similar to 384 kbps, so I didn't grasp what was actually happening. And mp2 is not a very common format to run across in a non-video stream. It only became clear to me when I had a 64 kbps mp2 stream to test. Sorry.

Obviously, you can't improve a stream just by saving it to disk at a higher bitrate. The 384 kbps output will fully preserve the sound quality of an mp2 stream, whether it's a 64 kbps input or a 320 kbps input. But there is a slight waste of disk space in doing so (quite a big waste of space if the input was only 64 kbps).

But that's what ffmpeg is doing: if you measure the incoming bitrate of a stream, by playing it in Winamp or in VLC player, you'll see its actual bitrate reported correctly. But try and save it using ffmpeg - as an mp2 file - and it will be saved at an artificially high rate.

Yes, I do listen to SHOUTcast. Yes, I can confirm that if you specify mp2 as the output format, ffmpeg will convert the input stream, even a stream (such as on SHOUTcast) that is not an mp2 stream, and save it to disk at 384 kbps even though it's only a 128 kbps stream. It's a really unhelpful feature of ffmpeg.

For SHOUTcast, streamripper is far and away a better choice than ffmpeg. No possibility at all of streamripper (or stationripper) monkeying with the stream, because streamripper has no ability to modify the bitrate or sample rate of the input.



.
Reply With Quote
Reply Post New Thread
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 10:56 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons