[Re: Mp3 from Radio]
Andy Bircumshaw
andy at networkned.co.uk
Tue Jan 4 10:44:41 EST 2011
On 4/1/2011, at 1:55pm, David Woodhouse wrote:
> On Tue, 2011-01-04 at 13:41 +0000, Jimmy Aitken wrote:
>> For similar reasons I made a change to my copy of get_iplayer to add
>> the switch '--mp3' When set, it uses ffmpeg to transcode the
>> downloaded file from aac to mp3 and then adds the tags as normal.
>> ...
> ...
> If you want to show me a patch which handles this in a fairly generic
> and graceful way, and isn't a dirty hack, then I suppose I have no real
> objection to merging it.
I hope this is treated with all care.
MJW has already posted that the correct way to do this is to use "--modes=flashaudio1". I see this was last discussed in the thread "Radio 4 recordings" 18-12-2010 - 20-12-2010, only a couple of weeks ago.
get_iplayer already has too many options.
Adding --mp3 would seem to add significant risk of users downloading AAC files then transcoding them, when they would be better off by downloading the MP3 version directly (no loss of quality during transcoding).
There are a number of ways to ensure MP3 output without hacking get_iplayer any further.
Running `get_iplayer --radiomode flashaudio,flashaudio1 --prefs-add` will ensure thet get_iplayer *always* uses this mode, unless manually over-ridden.
If there is a risk that programmes will be available only in AAC (eg flashaachigh,flashaacstd) and not in flashaudio, then one can write a bash script in about 5 lines which will perform the transcode conditionally. This can be called with the "--command" flag and again this can be added to defaults. See the "Custom Commands" section at <http://linuxcentre.net/getiplayer/documentation>
Very quick and ugly aac2mp3.sh:
# /bin/bash
if [[ $(file "$1") =~ "AAC" ]]
then
ffmpeg -i "$1" "$1".mp3
fi
Thus something like:
get_iplayer "Pete Tong" --command '/usr/local/bin/aac2mp3.sh "<filename>"'
will download Mr Tong's show and convert it to MP3 only if the download turns out to be AAC.
get_iplayer --command '/usr/local/bin/aac2mp3.sh "<filename>"' --prefs-add
will ensure conversion on all future downloads.
The aac2mp3.sh should probably not be so short, but should probably do error-checking. See <http://www.google.com/search?q=convert%20aac%20to%20mp3%20linux> for some much longer and better examples.
Anything we add to get_iplayer adds complexity and adds to the risk of breakage. Adding more transcoding features to get_iplayer cannot be a 3-line job because it must necessarily do error checking; we can't foist out extra features to end users without doing that.
I don't think any of us are enthusiastic to maintain get_iplayer. get_iplayer is very much Phil's creation, and Phil is no longer maintaining it. We should avoid making it more fragile. Aren't we all just waiting for Project Canvas / YouView to see what happens then? Possibly we'll have to start again from scratch.
http://en.wikipedia.org/wiki/YouView
MP3 is a poor format; I'm greatly in favour of get_iplayer remuxing, but not of transcoding. Transcoding can be done so easily by user-submitted 3rd-party scripts.
aB.
More information about the get_iplayer
mailing list