Tidying up Radio Downloads

Vangelis forthnet northmedia1 at the.forthnet.gr
Tue Aug 22 19:26:55 PDT 2017


On Tue Aug 22 22:47:09 BST 2017, Ralph Corderoy wrote:

> this is to avoid attempting to copy any "video" album sleeve, etc?

 Hi Ralph :-)

 FFmpeg treats the MP4 embedded thumbnail (artwork) present
in both .mp4/.m4a GiP files as a VIDEO STREAM in the input file.

 During manipulation of such files, it'll attempt to copy that thumbnail
into a video stream muxed to the end MPEG-4 container. If you assign
an ".mp4" file extension to the output file, which is indeed allowed for
an audio-only MP4 file, then you'll end up with an unwanted video stream!

 However, if you assign the ".m4a" file extension, then ffmpeg is smart
enough to not allow a video stream inside an audio-only Apple file and
thus the conversion fails altogether (if only -c copy or -c:a copy was 
used).

 Explicitly including the -vn flag will allow for an audio-only mp4 file
to be produced, the same goes for an "ipod brand" .m4a file.

 If you plan to edit a GiP .m4a file with ffmpeg, then it is advised
you fetch it with the --no-artwork switch (no thumbnail is
embedded) or even --no-tag (no metadata written).
You can always (re-)tag the edited file afterwards...

> always using -map 0:0 or similar to pluck just the audio in those cases.

 ... Afraid I only use the -map switch in cases with multiple 
video/audio/subs streams
in input file; I mostly deal with simple AV files with just 1 video + 1 
audio stream;
when I want to manipulate only one or the other, I find it easier to just 
issue:

-vn -c:a copy (disregard video) or
-an -c:v copy (disregard audio)

But then again, I don't consider myself really FFmpeg savvy!

Best regards,
Vangelis. 




More information about the get_iplayer mailing list