Need help with "command" function.

Vangelis forthnet northmedia1 at the.forthnet.gr
Wed Nov 11 15:53:39 PST 2015


On Wed Nov 11 12:19:28 GMT 2015, C E Macfarlane wrote:

> --ffmpeg-radio-opts '-acodec mp3'

"-acodec mp3" (I use Windows, so it should be inside double quotes)
is a non valid entry; AFAIK, ffmpeg lacks a native MP3 encoder and
has to be compiled with the "--enable-libmp3lame" configuration option
(see my previous post in this thread); libmp3lame is a "free" library,
so many precompiled ffmpeg binaries for various OSes can be found
on line; also see:
http://trac.ffmpeg.org/wiki/Encode/MP3

> --ffmpeg-radio-opts '-c:a libmp3lame -b:a 96k'

"-c:a libmp3lame" is the right incantation,
however here you are trying to mix different things
(read below)

> one problem seems to be that the default option
> that GiP feeds to ffmpeg ... (-acodec copy)
> ... is still being applied as well as and before the option
> from the GiP command-line ...

 You are fetching a flashaaclow radiomode;
this uses rtmpdump to produce an .FLV file,
which contains a raw HE-AACv1 (~ 48kbpsABR)
audio stream.
 Normally, this FLV file is further remuxed (losslessly)
in a one-step process into the MP4 container and
given the Apple .m4a file extension.

As per the GiP 2.94 longhelp,

--ffmpeg-radio-opts <options>    Add custom options to ffmpeg re-muxing for 
radio

the "--ffmpeg-radio-opts" switch is to be used to
add additional custom options to the LOSSLESS
REMUX TO THE MP4 (.M4A) CONTAINER.

If you probe the vanilla 2.94 code, the remuxing code
is at line 10356:

http://git.infradead.org/get_iplayer.git/blob/e8e81942394eed7e0f63cf977737054a5a22530a:/get_iplayer#l10356

where, as you say, "-vn -acodec copy"
is already issued by GiP; @ffmpeg_opts
are the "--ffmpeg-radio-opts" you define:

http://git.infradead.org/get_iplayer.git/blob/e8e81942394eed7e0f63cf977737054a5a22530a:/get_iplayer#l10310

moreover, when --aactomp3 is not defined,
$prog->{filepart}
will have the ".m4a" file extension.

http://git.infradead.org/get_iplayer.git/blob/e8e81942394eed7e0f63cf977737054a5a22530a:/get_iplayer#l8865

"--ffmpeg-radio-opts "-c:a libmp3lame -b:a 96k"" is
of course a transcoding instruction; I can't be certain
whether this takes precedence over "-acodec copy"
when both present, but even if it did and even if your
ffmpeg copy was able to encode to MP3, it would
still "barf", as it would have to put an MP3 transcoded
stream inside the MP4 container (OK-ish so far),
but the .m4a extension is incompatible, as it always
implies an AAC type raw audio stream...

If your intention is to transcode (post download)
a flashaaclow radiomode to MP3 at 96kbpsCBR,
then you should  first patch the 2.94 script manually:

http://git.infradead.org/get_iplayer.git/blob/e8e81942394eed7e0f63cf977737054a5a22530a:/get_iplayer#l10342

-my @br_opts = ('-ab', '128k');
+my @br_opts = ('-ab', '96k');

use an ffmpeg binary with mp3 encoding support
and then use the --(aacto)mp3 switch:

get_iplayer --type=radio -g "Bells on 
Sunday" --modes=flashaaclow --mp3 --force

---------------------------------------------
    Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, fltp, 96 kb/s
    Metadata:
      encoder         : Lavc56.41.100 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
size=    1115kB time=00:01:35.04 bitrate=  96.1kbits/s
video:0kB audio:1114kB subtitle:0kB other streams:0kB global headers:0kB 
muxing
overhead: 0.044005%
INFO: Recorded D:\Vangelis\iPlayer 
Recordings\Bells_on_Sunday_-_08_11_2015_b06nl
725_default.mp3

INFO: ID3 tagging MP3 file
---------------------------------------------

Kind regards,
Vangelis. 




More information about the get_iplayer mailing list