Posts: 36
Threads: 5
Joined: Jul 2013
06-02-2017, 01:52 PM
(This post was last modified: 11-02-2017, 01:06 AM by dinky.)
Hi guys,
I've been using 2.97 and older versions for yonks, and with the deprecation of aactomp3 function, Im wondering if there's a switch to invoke ffmpeg to convert from M4a to mp3 when downloaded. Im running get_iplayer on the latest Raspbian on a Pi3.
Steve
Posts: 2,037
Threads: 19
Joined: Jul 2013
See advanced section of FAQ list
Posts: 13
Threads: 5
Joined: Aug 2016
Apologies for being a bit thick but...
I've reverted back to version 2.97 (Win 10) after finding that the output to mp3 no longer works.
Am I correct in thinking that to get an mp3 output with version 2.98 I need to type in...
Code: get_iplayer --get 123 --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -b:a 320k -y "<dir>/<fileprefix>.mp3"'
...then use ...
Code: get_iplayer --get 12345 --preset=aactomp3
...to download a show?
If that's correct will I have type in '--preset=aactomp3' every time?
Thanks,
Andrew.
Posts: 2,037
Threads: 19
Joined: Jul 2013
You're mixing up two different examples. Have another look at the documentation. It shows you how to create a preset before using it.
A preset gives you the choice of converting radio programmes to MP3 only when you need to, so you would need to include --preset in your commands as shown in the example. If you want to convert every single radio programme to MP3 every single time no matter what, you can set --command-radio in your default preferences. Use just --prefs-add instead of --prefs-add --preset aactomp3. Just remember to override --command-radio manually if you want to do something different with your radio programmes.
Posts: 13
Threads: 5
Joined: Aug 2016
Thanks.
I'll take another look at the docs to see if I can understand what to do.
I only use get_iplayer for radio rips, essentially to copy to CD for the missus to listen to stuff in her car.
Andrew
Posts: 36
Threads: 5
Joined: Jul 2013
06-02-2017, 06:02 PM
(This post was last modified: 12-02-2017, 08:30 PM by dinky.)
Sorry, Im really struggling with this, where do I save --command-radio, and would I need to type anything other than get_iplayer --pvr, when all settings are entered correctly?
Id I do prefs-add command-radio, it saves a blank file in .get_iplayer/presets.
TIA
Steve
If I type this
get_iplayer --force --pid b08crt5z --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -b:a 320k -y "<dir>/<fileprefix>.mp3"'
It works and converts to an mp3, how do I incorporate this into my permanent preferences?
(I only ever download Radio)
Steve
Posts: 2,037
Threads: 19
Joined: Jul 2013
06-02-2017, 06:20 PM
(This post was last modified: 06-02-2017, 06:20 PM by dinky.)
(06-02-2017, 06:02 PM)startreksteve Wrote: It works and converts to an mp3, how do I incorporate this into my permanent preferences?
(I only ever download Radio) The documentation provides an example (using MP3 VBR) of exactly that. Have another look and adjust to suit if you want to use other ffmpeg parameters.
Posts: 7
Threads: 2
Joined: Dec 2013
06-02-2017, 07:40 PM
(This post was last modified: 06-02-2017, 07:43 PM by gsullymorgan.)
Er, where in the docs? I've got exactly the same question but following the link in the Radio section ( https://squarepenguin.co.uk/guides/radio...mes-to-mp3) just takes me to "This is an advanced topic beyond the scope of this introductory guide" and then links to the Custom Commands WIKI with "Create a preset named aactomp3 that can be used to extract the audio from a radio programme "
Posts: 483
Threads: 14
Joined: Jul 2013
06-02-2017, 07:41 PM
(This post was last modified: 13-02-2017, 03:52 PM by dinky.
Edit Reason: put wrong wiki page!
)
@startreksteve
Scroll a little further down than you're currently reading in the Example Commands list.
@dinky
Do you use bold heading instead of h4 for a set reason (i.e. something breaks if you don't)? If not, I'll change the smaller headings like I have done in this example above (they're visually identical) as you can get anchor links directly to them with a simple click.
Posts: 2,037
Threads: 19
Joined: Jul 2013
06-02-2017, 07:56 PM
(This post was last modified: 06-02-2017, 07:57 PM by dinky.)
(06-02-2017, 07:41 PM)SquarePenguin Wrote: Do you use bold heading instead of h4 for a set reason (i.e. something breaks if you don't)? If not, I'll change the smaller headings like I have done in this example above (they're visually identical) as you can get anchor links directly to them with a simple click. By all means, edit away. The idea was to get people to read the whole section on custom commands so they might actually understand the different ways to approach the problem, but that has clearly failed at the first hurdle.
Posts: 36
Threads: 5
Joined: Jul 2013
Aha!
got it, that seems to work fine but the finished mp3 is a little larger, no worries, I'll have a fiddle about with the bitrates..
Cheers
Steve
Posts: 483
Threads: 14
Joined: Jul 2013
I think it might just be above most users desire to parse the volume of info now.
The amount of 'adjacent knowledge' needed is higher too, like these commands come from simple building block principles but collecting that knowledge over the wiki is a big barrier for many (not least the time factor, let alone motivation).
It'll probably reduce the support burden to be able to link directly to this solution (at least) as I'm sure there will be more coming who were relying on the `--aactomp3` option.
I'll edit the Wiki as time allows.
Posts: 2,037
Threads: 19
Joined: Jul 2013
06-02-2017, 08:28 PM
(This post was last modified: 06-02-2017, 08:29 PM by dinky.)
(06-02-2017, 08:08 PM)startreksteve Wrote: got it, that seems to work fine but the finished mp3 is a little larger, no worries, I'll have a fiddle about with the bitrates.. One more thing: Previous versions of get_iplayer used constant bit rate encoding for MP3 by default. If you opt to try variable bit rate encoding to save a bit on storage, I suggest that before going all in, you test a few files with your particular hardware to make sure they play OK and that the sound quality suits you. Everyone's hardware (and ears) are different.
Posts: 36
Threads: 5
Joined: Jul 2013
One final question, after conversion, can I tell it to automatically delete the m4a?
Steve
Posts: 2,037
Threads: 19
Joined: Jul 2013
(06-02-2017, 08:39 PM)startreksteve Wrote: One final question, after conversion, can I tell it to automatically delete the m4a? You can string together multiple system commands in --command-radio. Combine them just as you would if typing them at a command prompt. Obviously, you need to be careful and only call rm if ffmpeg completes successfully. Work out your desired sequence at a command prompt before trying it with --command-radio. That said, if you're going to use more a couple of commands you will likely find it better to encapsulate all your post-processing in a shell script and then invoke the script from --command-radio.
Posts: 36
Threads: 5
Joined: Jul 2013
06-02-2017, 08:56 PM
(This post was last modified: 06-02-2017, 08:57 PM by startreksteve.)
Yeah, I used to do that with version 2.95..
I used to move the converted m4a's to another folder and delete them manually every few weeks.
Steve
Posts: 2,037
Threads: 19
Joined: Jul 2013
06-02-2017, 09:01 PM
(This post was last modified: 06-02-2017, 09:05 PM by dinky.)
(06-02-2017, 08:56 PM)startreksteve Wrote: I used to move the converted m4a's to another folder and delete them manually every few weeks. Wise move. For anyone else: This would be preferable to deleting m4a files as you go. No point in wasting bandwidth to re-download if something goes wrong when you don't have to.
Posts: 36
Threads: 5
Joined: Jul 2013
I checked that M4A folder after I said that, and there was 10gb of files in it! obviously I DONT empty it every few weeks! No wonder Im running out of space!
Posts: 85
Threads: 14
Joined: Nov 2013
10-02-2017, 12:31 AM
(This post was last modified: 10-02-2017, 12:32 AM by mrg9999.)
(06-02-2017, 06:02 PM)Steve. If you do get it working, can you post an example. I\ve had problems getting command to work. I was post using ffmpeg to boost the audio volume with post saving and would like to do it all in one hit. ffmpeg -i "%%f" -acodec libmp3lame -q:a %quality% -af Wrote: Sorry, Im really struggling with this, where do I save --command-radio, and would I need to type anything other than get_iplayer --pvr, when all settings are entered correctly?
Id I do prefs-add command-radio, it saves a blank file in .get_iplayer/presets.
TIA
Steve
If I type this
get_iplayer --force --pid b08crt5z --command-radio='ffmpeg -i "<filename>" -c:v copy -c:a libmp3lame -b:a 320k -y "<dir>/<fileprefix>.mp3"'
It works and converts to an mp3, how do I incorporate this into my permanent preferences?
(I only ever download Radio)
Steve
Posts: 36
Threads: 5
Joined: Jul 2013
Its stopped working again now with the following error:
libmp3lame IS installed
: A B7 production for BBC Radio 4.
:
: EPISODE
: http://www.bbc.co.uk/programmes/b08crt5z
:
: SERIES
: http://www.bbc.co.uk/programmes/b08f1dfw
Duration: 00:13:37.92, start: 0.000000, bitrate: 129 kb/s
Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 150x84 [SAR 72:72 DAR 25:14], 90k tbr, 90k tbn, 90k tbc
Unknown encoder 'libmp3lame'
INFO: Command exit code 1 (raw code = 256)
ERROR: Command Exit Code: 1
|