aactomp3 - get-iplayer/get_iplayer GitHub Wiki

Convert radio programmes to MP3

get_iplayer NO LONGER SUPPORTS CONVERTING FILES TO MP3
THE EXAMPLES GIVEN BELOW ARE NOT SUPPORTED IN ANY WAY
DO NOT ASK FOR HELP IF YOU DO NOT UNDERSTAND THEM
YOU ARE RESPONSIBLE FOR YOUR OWN MP3 FILE CONVERSIONS

Use --command-radio to run a custom user command using substitution parameters after a successful recording of a radio programme. This facility can be used to convert radio programmes to MP3, replacing the functionality formerly supplied by the --aactomp3 and --mp3vbr options. This requires a version of ffmpeg built with libmp3lame.

  • Only one --command-radio option may be specified, but it can execute multiple commands though the use of command separators and conditional operators appropriate to your command shell. You can also use shell scripts or batch files.
  • User commands may be added to preferences, presets and pvr jobs for ease of reuse.
  • You will find it helpful to first work out the syntax of your user commands at a command prompt before using --command-radio.

Examples are given for converting at both variable and constant bit rate. Some MP3 players may not properly handle variable bit rate files. In that case, convert radio programmes to MP3 using a constant bit rate.

Applications with obsolete ID3 support may not be able to read ID3v2.4 tags. In that event, add -id3v2_version 3 -write_id3v1 1 to your ffmpeg command arguments.

The examples below show you how to remove the original M4A file after conversion to MP3. If you wish to retain the original M4A file, remove && rm "<filename>" or && del \""<filename>"\" from the command string as appropriate.

Ignore --get 12345 in the following examples. It is merely a placeholder for whatever options you may be using to download programmes.

Important: On Windows, substitution parameters (e.g., <filename>) must not be located within quotes.

Convert radio programmes to MP3 at variable bit rate (VBR)

Convert a single radio programme to MP3 format at best variable bit rate (VBR) and automatically delete M4A file:

Unix/macOS:

get_iplayer --get 12345 --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -q:a 0 -y "<dir>/<fileprefix>.mp3" && rm "<filename>"'

Windows:

get_iplayer --get 12345 --command-radio="ffmpeg -i \""<filename>"\" -c:v copy -c:a libmp3lame -q:a 0 -y \""<dir>\<fileprefix>".mp3\" && del \""<filename>"\""

Lower-quality VBR output can be generated using values 1-9 for -q:a ffmpeg option.

Create a preset named aactomp3 that can be used to convert radio programmes to MP3 format at best variable bit rate (VBR) and automatically delete M4A files by setting --command-radio in preset:

Unix/macOS:

get_iplayer --prefs-add --preset aactomp3 --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -q:a 0 -y "<dir>/<fileprefix>.mp3" && rm "<filename>"'

Windows:

get_iplayer --prefs-add --preset aactomp3 --command-radio="ffmpeg -i \""<filename>"\" -c:v copy -c:a libmp3lame -q:a 0 -y \""<dir>\<fileprefix>".mp3\" && del \""<filename>"\""

Lower-quality VBR output can be generated using values 1-9 for -q:a ffmpeg option.

Use the preset with recording commands. Examples:

get_iplayer --get 12345 --preset=aactomp3
get_iplayer --pvr-add myshow --preset=aactomp3 "My Show"

Always convert every radio programme to MP3 format at best variable bit rate (VBR) and automatically delete M4A file by setting --command-radio in preferences:

Unix/macOS:

get_iplayer --prefs-add --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -q:a 0 -y "<dir>/<fileprefix>.mp3" && rm "<filename>"'

Windows:

get_iplayer --prefs-add --command-radio="ffmpeg -i \""<filename>"\" -c:v copy -c:a libmp3lame -q:a 0 -y \""<dir>\<fileprefix>".mp3\" && del \""<filename>"\""

Lower-quality VBR output can be generated using values 1-9 for -q:a ffmpeg option.

Remember to override --command-radio on the command line if you want to do something different with your radio programmes.

NOTE: When you set --command-radio in preferences, it will also be applied to downloads in the Web PVR Manager.

Convert radio programmes to MP3 at constant bit rate (CBR)

Convert a single radio programme to MP3 format at 320kbps constant bit rate (CBR) and automatically delete M4A file:

Unix/macOS:

get_iplayer --get 12345 --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -b:a 320k -y "<dir>/<fileprefix>.mp3" && rm "<filename>"'

Windows:

get_iplayer --get 12345 --command-radio="ffmpeg -i \""<filename>"\" -c:v copy -c:a libmp3lame -b:a 320k -y \""<dir>\<fileprefix>".mp3\" && del \""<filename>"\""

Lower-quality CBR output can be generated by adjusting the bit rate value for -b:a ffmpeg option (e.g., 128k, 96k, 48k).

Create a preset named aactomp3 that can be used to convert radio programmes to MP3 format at 320kbps constant bit rate (CBR) and automatically delete M4A files by setting --command-radio in preset:

Unix/macOS:

get_iplayer --prefs-add --preset aactomp3 --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -b:a 320k 1 -y "<dir>/<fileprefix>.mp3" && rm "<filename>"'

Windows:

get_iplayer --prefs-add --preset aactomp3 --command-radio="ffmpeg -i \""<filename>"\" -c:v copy -c:a libmp3lame -b:a 320k -y \""<dir>\<fileprefix>".mp3\" && del \""<filename>"\""

Lower-quality CBR output can be generated by adjusting the bit rate value for -b:a ffmpeg option (e.g., 128k, 96k, 48k).

Use the preset with recording commands. Examples:

get_iplayer --get 12345 --preset=aactomp3
get_iplayer --pvr-add myshow --preset=aactomp3 "^My Show$"

Always convert every radio programme to MP3 format at 320k constant bit rate (CBR) and automatically delete M4A file by setting --command-radio in preferences:

Unix/macOS:

get_iplayer --prefs-add --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -b:a 320k -y "<dir>/<fileprefix>.mp3" && rm "<filename>"'

Windows:

get_iplayer --prefs-add --command-radio="ffmpeg -i \""<filename>"\" -c:v copy -c:a libmp3lame -b:a 320k -y \""<dir>\<fileprefix>".mp3\" && del \""<filename>"\""

Lower-quality CBR output can be generated by adjusting the bit rate value for -b:a ffmpeg option (e.g., 128k, 96k, 48k).

Remember to override --command-radio on the command line if you want to do something different with your radio programmes.

NOTE: When you set --command-radio in preferences, it will also be applied to downloads in the Web PVR Manager.

⚠️ **GitHub.com Fallback** ⚠️