Difference between revisions of "Get iplayer"

From TMB Wiki
Jump to: navigation, search
(Steps)
(Updated the get_iplayer link in Download section to make it easier. Rolledback previous update as no need for multiple get_iplayer external links. Removed squarepenguin link as no longer available)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''get_iplayer''' is a free and Open Source program released under the GNU GPL that allows you to access content from the [[BBC]] iPlayer. It is primarily used to capture video (TV) and audio (Radio) broadcasts. You are able to capture these media files from both the archived watch/listen again iPlayer as well as live streams. The media files captured are the actual source files transmitted by the iPlayer and so the quality is excellent.  
+
'''get_iplayer''' is a free and Open Source program released under the GNU GPL that allows you to access content from the [[BBC]] iPlayer. It is primarily used to capture video (TV) and audio (Radio) broadcasts. You are able to capture these media files from both the archived watch/listen again iPlayer as well as live streams. The media files captured are the actual source files transmitted by the [[BBC]] iPlayer.  
  
==Capturing & Preparing Radio Shows==
+
Currently the BBC iplayer live streams are transmitted at 320kpbs. However, only BBC Radio 3 & BBC 6 Music does so with full frequency range. Thus, there is still an imposed 15-16kHz frequency cut-off for all other stations. The listen again iPlayer transmits at 128kbps.
 +
 
 +
The reason for highlighting the use of the get_iplayer is that the quality is as good as we have ever been able to get. Even a 128kbps [[M4A]] ([[AAC]]) file sounds excellent and of comparable quality to the very best FM recording. And with the 320kbps broadcasts the audio is truly excellent. Therefore, this is the recommend way to record BBC content. 
 +
 
 +
 
 +
==Capturing & Preparing BBC Radio Shows==
  
 
===Windows OS===
 
===Windows OS===
Line 15: Line 20:
  
 
# Run '''get_iplayer''' and use the appropriate commands to capture the content you want:
 
# Run '''get_iplayer''' and use the appropriate commands to capture the content you want:
#* '''Live iPlayer Streams''' (these are broadcasts/transmissions that are going out live across the BBC station)
+
#* '''Live iPlayer Streams''' (these are broadcasts/transmissions that are going out live on the BBC station)
#** <big><code>get_iplayer --type=liveradio --pid=bbc_radio_one --start=01:10:05 --stop=03:15:10 --force </code></big>
+
#** <big><code>get_iplayer --type=liveradio --get 80131 --stop=02:10:10 --force --attempts=5 --raw --ffmpeg-liveradio-opts="-bsf:a aac_adtstoasc"</code></big>
#*** the above command captures 2 hours 5 minutes and 10 seconds of the live transmission from the BBC Radio 1 station 1 hour 10 minutes and 5 seconds after get_iplayer has been sent the command.
+
#*** The above command captures 2 hours 10 minutes and 10 seconds of the live transmission from the BBC Radio 1 station once the get_iplayer program has been sent the command. The <big><code>--stop</code></big> option is hh:mm:ss. This enables you to cleanly end a recording. Do not use the <big><code>--start</code></big> option with live stream recording. Multiple instances of get_iplayer can also be scheduled to run. And using a Windows scheduler allows you to set up weekly repeats, which will be described later.
#*** the <big><code>--start</code></big> and <big><code>--stop</code></big> parameters are hh:mm:ss. This enables you to schedule a recording without having to do it live. Multiple instances of get_iplayer can also be scheduled to run. And using a Windows scheduler allows you to set up weekly repeats.
+
#*** You will be left with a [[Transport Stream]] (.ts) file. You can extract the raw [[AAC]] audio from it using [[FFmpeg]] with the following command:
 +
#**** <big><code>ffmpeg -i input.ts -acodec copy output.aac</code></big>
 +
#:* Or better yet, create a batch script to make the process easier. Create a folder called <big><code>ts2aac2m4a</code></big>. Copy the following into a file named <big><code>ts2aac.cmd</code></big> and place the file into the folder you have just created (you might need to first make the file a text file and then change the .txt to .cmd):
 +
#:* <big><code>@ECHO OFF </big></code>
 +
#::<big><code>MKDIR aac</big></code>
 +
#::<big><code>FOR %%f IN ("*.ts") DO ffmpeg -i "%%f" -acodec copy "aac\%%~nf.aac"</code></big>
 +
#:* To run the above file you will need to have ffmpeg.exe in your PATH or within the same folder as the batch script or you can use [http://wiki.themixingbowl.org/User:Jaybeee jaybeee's] batch scripts.
 
#* '''Listen Again iPlayer Stream'''
 
#* '''Listen Again iPlayer Stream'''
 
#** <big><code>get_iplayer --type=radio --pid=b006wkfp</code></big>
 
#** <big><code>get_iplayer --type=radio --pid=b006wkfp</code></big>
#*** the above command captures the audio that relates to the program with the pid as defined above.
+
#*** The above command captures the audio that relates to the program with the pid as defined above; make sure you change it to the programme you want.
# You will most likely need to '''edit the audio''' to remove unwanted parts from the start and end. You can [[lossless]]ly do this with [[MP3DirectCut]]. However, [[MP3DirectCut]] only works on [[AAC]] files and so you will need to unpackage the [[M4A]] file using [[MP4Box]] to extract the raw [[AAC]] file.
+
# You will most likely need to '''edit the audio''' to remove unwanted parts from the start and end. You can [[lossless]]ly do this with [[MP3DirectCut]]. It is vital to use a lossless / non-destructive audio editor to preserve the audio quality; otherwise you will decode and then re-encode (aka [[transcode]]) and further compress the file. However, [[MP3DirectCut]] only works on [[AAC]] (and [[MP3]]) files and not the [[M4A]] format, so you will need to '''unpackage the [[M4A]] file''' using [[MP4Box]] to '''extract the raw [[AAC]] file'''.
 +
#* Run [[MP4Box]] with the following commands:
 +
#** <big><code>mp4box -raw 1 input.m4a -out output.aac</code></big>
 +
#* Or better yet, create a batch script to make the process easier. Create a folder called <big><code>ts2aac2m4a</code></big>. Copy the following into a file named <big><code>m4a2aac.cmd</code></big> and place the file into the folder you have just created (you might need to first make the file a text file and then change the .txt to .cmd):
 +
#** <big><code>@ECHO OFF </big></code>
 +
#::<big><code>MKDIR aac </big></code>
 +
#::<big><code>FOR %%f IN ("*.m4a") DO mp4box -raw 1 "%%f" -out "aac\%%~nf.aac"</code></big>
 +
#* So now all you have to do is place the captured .m4a file into the <big><code>ts2aac2m4a</code></big> folder, run the <big><code>m4a2aac.cmd</code></big> batch script and you will find the extracted [[AAC]] file in a sub-folder called <big><code>\ts2aac2ma4\aac</code></big>.
 +
# Run [[MP3DirectCut]] and open the extracted [[AAC]] file and make the necessary edits. Make sure you save your changes.
 +
# The [[AAC]] file must now be repackaged back into a [[M4A]] container to ensure correct playback and compatibility with media players (and to allow you to tag the file).
 
#* Run [[MP4Box]] with the following commands:
 
#* Run [[MP4Box]] with the following commands:
#** <big><code>mp4box -raw 1 inputfile.m4a -out outputfile.aac</code></big>
+
#** <big><code>mp4box -add input.aac output.m4a -new</code></big>
#* Or better yet, create a batch script to make the process easier. Create a folder called ''m4a2aac2ma4''. Copy the following into a file named ''m4a2aac.bat'' and place file into the folder you have just created (you might need to first make the file a text file and then change the .txt to .bat):
+
#* Or better yet, create a batch script like above to make the process easier. Copy the following into a file named <big><code>aac2m4a.cmd</code></big> and save the file into the folder <big><code>\ts2aac2m4a\aac</code></big>:
#** <big><code>@echo off
+
#** <big><code>@ECHO OFF</big></code>
#::mkdir aac
+
#::<big><code>MKDIR m4a</big></code>
#::for %%f in (*.m4a) do mp4box -raw 1 "%%f" -out "aac\%%f.aac"</code></big>
+
#::<big><code>FOR %%f IN ("*.aac") do mp4box -add "%%f" "m4a\%%~nf.m4a" -new</code></big>
#* So now all you have to do is place the captured .m4a file into the ''m4a2aac2m4a'' folder, run the ''m4a2aac.bat'' batch script and you will find the extracted [[AAC]] file in a sub-folder called ''aac''.
+
#* Run the <big><code>aac2m4a.cmd</code></big> batch script and you will find the repackaged [[M4A]] file in a sub-folder <big><code>\ts2aac2m4a\aac\m4a</code></big>.
# the
+
# Using your preferred '''tagging tool''' (we recommend [[Foobar2000]] or [[MP3tag]]) add the appropriate tags.
 +
#* Take pride in your uploads by tagging them correctly. It helps the grateful listeners organise their media files.
 +
# Optional part: [[Replaygain]] the file. In [[Foobar2000]] you can do this by adding [[Replaygain]] tags or even permanently apply the [[Replaygain]] changes to the actual file, meaning all media players will play the file at this adjusted loudness.
 +
# Upload to [[TMB]], sit back and have thousands download and admire your great work... or get a few thumbsup :-P
 +
 
 +
==Troubleshooting==
 +
* To re-mux without transcoding a .ts [[Transport Stream]] file to an [[M4A]] file use the following [[FFmpeg]] command:
 +
** <big><code>ffmpeg -i input.ts -acodec copy -acodec copy out.m4a</code></big>
 +
* To re-mux without transcoding a .ts [[Transport Stream]] file to an [[AAC]] file use the following [[FFmpeg]] command:
 +
** <big><code>ffmpeg -i input.ts -acodec copy output.aac</code></big>
 +
* When you forcibly kill a get_iplayer session when it is capturing content (leaving you with a file with the extension .ts), the above command is unlikely to work. This [[Transport Stream]] file will need to have it's bitstream filter fixed and then packaged to an [[M4A]] or [[MP4]] file in order to adequately use it. You can do this with [[FFmpeg]]:
 +
** <big><code>ffmpeg -i "input.ts" -c:a copy -c:a copy -bsf:a aac_adtstoasc "output.m4a"</code></big>
 +
*** get_iplayer installs [[FFmpeg]] as part of it's own installation.
  
 
==Download==
 
==Download==
*[https://github.com/get-iplayer/ Github get_iplayer official repository]
+
*[https://github.com/get-iplayer/get_iplayer Github get_iplayer official repository]
*[https://squarepenguin.co.uk/ Squarepenguin website] - a nicely designed website that mirrors the Github site
+
 
 +
==Further Reading==
 +
*[http://www.bbc.co.uk/blogs/internet/entries/296ac283-54df-4c21-a38f-8cc1fa8731c8 Official BBC Audio Factory project info]
 +
*[http://www.audiomisc.co.uk/BBC/AudioFactory/AudioFactory.html Audio Factory explained by an audiophile]
  
  
 
[[category:Audio Tools]]
 
[[category:Audio Tools]]
 +
[[Category:Uploading Own Recordings]]

Latest revision as of 17:10, 28 November 2022

get_iplayer is a free and Open Source program released under the GNU GPL that allows you to access content from the BBC iPlayer. It is primarily used to capture video (TV) and audio (Radio) broadcasts. You are able to capture these media files from both the archived watch/listen again iPlayer as well as live streams. The media files captured are the actual source files transmitted by the BBC iPlayer.

Currently the BBC iplayer live streams are transmitted at 320kpbs. However, only BBC Radio 3 & BBC 6 Music does so with full frequency range. Thus, there is still an imposed 15-16kHz frequency cut-off for all other stations. The listen again iPlayer transmits at 128kbps.

The reason for highlighting the use of the get_iplayer is that the quality is as good as we have ever been able to get. Even a 128kbps M4A (AAC) file sounds excellent and of comparable quality to the very best FM recording. And with the 320kbps broadcasts the audio is truly excellent. Therefore, this is the recommend way to record BBC content.


Capturing & Preparing BBC Radio Shows

Windows OS

Required Programs

Steps

  1. Run get_iplayer and use the appropriate commands to capture the content you want:
    • Live iPlayer Streams (these are broadcasts/transmissions that are going out live on the BBC station)
      • get_iplayer --type=liveradio --get 80131 --stop=02:10:10 --force --attempts=5 --raw --ffmpeg-liveradio-opts="-bsf:a aac_adtstoasc"
        • The above command captures 2 hours 10 minutes and 10 seconds of the live transmission from the BBC Radio 1 station once the get_iplayer program has been sent the command. The --stop option is hh:mm:ss. This enables you to cleanly end a recording. Do not use the --start option with live stream recording. Multiple instances of get_iplayer can also be scheduled to run. And using a Windows scheduler allows you to set up weekly repeats, which will be described later.
        • You will be left with a Transport Stream (.ts) file. You can extract the raw AAC audio from it using FFmpeg with the following command:
          • ffmpeg -i input.ts -acodec copy output.aac
    • Or better yet, create a batch script to make the process easier. Create a folder called ts2aac2m4a. Copy the following into a file named ts2aac.cmd and place the file into the folder you have just created (you might need to first make the file a text file and then change the .txt to .cmd):
    • @ECHO OFF
    MKDIR aac
    FOR %%f IN ("*.ts") DO ffmpeg -i "%%f" -acodec copy "aac\%%~nf.aac"
    • To run the above file you will need to have ffmpeg.exe in your PATH or within the same folder as the batch script or you can use jaybeee's batch scripts.
    • Listen Again iPlayer Stream
      • get_iplayer --type=radio --pid=b006wkfp
        • The above command captures the audio that relates to the program with the pid as defined above; make sure you change it to the programme you want.
  2. You will most likely need to edit the audio to remove unwanted parts from the start and end. You can losslessly do this with MP3DirectCut. It is vital to use a lossless / non-destructive audio editor to preserve the audio quality; otherwise you will decode and then re-encode (aka transcode) and further compress the file. However, MP3DirectCut only works on AAC (and MP3) files and not the M4A format, so you will need to unpackage the M4A file using MP4Box to extract the raw AAC file.
    • Run MP4Box with the following commands:
      • mp4box -raw 1 input.m4a -out output.aac
    • Or better yet, create a batch script to make the process easier. Create a folder called ts2aac2m4a. Copy the following into a file named m4a2aac.cmd and place the file into the folder you have just created (you might need to first make the file a text file and then change the .txt to .cmd):
      • @ECHO OFF
    MKDIR aac
    FOR %%f IN ("*.m4a") DO mp4box -raw 1 "%%f" -out "aac\%%~nf.aac"
    • So now all you have to do is place the captured .m4a file into the ts2aac2m4a folder, run the m4a2aac.cmd batch script and you will find the extracted AAC file in a sub-folder called \ts2aac2ma4\aac.
  3. Run MP3DirectCut and open the extracted AAC file and make the necessary edits. Make sure you save your changes.
  4. The AAC file must now be repackaged back into a M4A container to ensure correct playback and compatibility with media players (and to allow you to tag the file).
    • Run MP4Box with the following commands:
      • mp4box -add input.aac output.m4a -new
    • Or better yet, create a batch script like above to make the process easier. Copy the following into a file named aac2m4a.cmd and save the file into the folder \ts2aac2m4a\aac:
      • @ECHO OFF
    MKDIR m4a
    FOR %%f IN ("*.aac") do mp4box -add "%%f" "m4a\%%~nf.m4a" -new
    • Run the aac2m4a.cmd batch script and you will find the repackaged M4A file in a sub-folder \ts2aac2m4a\aac\m4a.
  5. Using your preferred tagging tool (we recommend Foobar2000 or MP3tag) add the appropriate tags.
    • Take pride in your uploads by tagging them correctly. It helps the grateful listeners organise their media files.
  6. Optional part: Replaygain the file. In Foobar2000 you can do this by adding Replaygain tags or even permanently apply the Replaygain changes to the actual file, meaning all media players will play the file at this adjusted loudness.
  7. Upload to TMB, sit back and have thousands download and admire your great work... or get a few thumbsup :-P

Troubleshooting

  • To re-mux without transcoding a .ts Transport Stream file to an M4A file use the following FFmpeg command:
    • ffmpeg -i input.ts -acodec copy -acodec copy out.m4a
  • To re-mux without transcoding a .ts Transport Stream file to an AAC file use the following FFmpeg command:
    • ffmpeg -i input.ts -acodec copy output.aac
  • When you forcibly kill a get_iplayer session when it is capturing content (leaving you with a file with the extension .ts), the above command is unlikely to work. This Transport Stream file will need to have it's bitstream filter fixed and then packaged to an M4A or MP4 file in order to adequately use it. You can do this with FFmpeg:
    • ffmpeg -i "input.ts" -c:a copy -c:a copy -bsf:a aac_adtstoasc "output.m4a"
      • get_iplayer installs FFmpeg as part of it's own installation.

Download

Further Reading