Workaround for broken(?) m4a files from ffmpeg, was Re: [PATCH] Output AAC as M4A for iTunes with metadata tags

Simon Nash get_iplayer at cjnash.com
Sat Apr 9 10:08:50 EDT 2011


Jon Davies wrote:
> dinkypumpkin did some great work putting together a patch which makes
> mpeg4/m4a the default file format for aac sources, rather than raw
> aac.  This works for most people but ...
> 
> On 1 April 2011 21:15, richard <richard at richsim900.plus.com> wrote:
>> The m4a file did not play in the Marantz CD player.It will play after
>> using EasyTag to change a tag.
> 
> I did some work off-list with Richard to try and diagnose this, and my
> conclusion is that there's a bug in the mpeg4 container code in
> ffmpeg, but I've yet to prove this.
> 
I've been doing some investigation into this and I can report that it's
not a bug in ffmpeg.  It's actually a bug in the Marantz CD player.
For details of the cause of the problem, see
http://forums.linn.co.uk/bb/showthread.php?tid=10543

I have confirmed that this is the cause of the problem by sending Richard
the same test files that I used to diagnose this problem with the Linn DS.

The workaround (as Jon has also discovered) is to create the m4a file
using mp4creator.  But...

There has been a recent change to ffmpeg to use the 4-byte length format
(see http://ffmpeg.org/pipermail/ffmpeg-cvslog/2011-March/035858.html).
This is included in the 0.6.90-rc0 release of ffpmeg, according to the
changelog (http://ffmpeg.org/releases/ffmpeg-0.6.90-rc0.changelog).
So files produced using this release of ffmpeg should work OK in the
Marantz CD player (I haven't tried this).

   Simon

> I did however find some command-line tools which fix the problem, and
> built a script which is called using the command option in get_iplayer
> to fix up the m4a file so that it plays on Marantz CD players.  This
> automates the fixup process for those still having problems.  I'm not
> proposing that this becomes part of get_iplayer - it shouldn't - it's
> just a workaround for this problem until someone gets to the bottom of
> what's not working with ffmpeg and some players.
> 
> I'm posting this here so that if anyone else still has problems with
> m4a files not playing in their favourite media player, there's a
> workaround.
> 
> Unfortunately this script only works on linux, and it requires a
> couple of additional programs.  If there's interest I'm happy to have
> a go at a windows equivalent (I have source and windows executables
> for the additional programs, it just needs the script).  Sorry, I
> can't help out on macos since I don't have access to a macos system.
> 
> To install the patch on Ubuntu:
> 
> $ sudo apt-get install mpeg4ip-utils mpeg4ip-server
> 
> (from mpeg4ip-utils we need mp4info and mp4tags, and from
> mpeg4ip-server we need mp4creator.  it happens that easytag uses the
> same underlying mpeg4 library as these tools)
> 
> There's a script called fixupm4a.sh attached - put this anywhere you
> like, I'll use /some/path/fixupm4a.sh to refer to it.
> 
> then make it executable
> 
> $ chmod a+rx /some/path/fixupm4a.sh
> 
> and set an option for get_iplayer to call it thus
> 
> $ get_iplayer --prefs-add --command "/some/path/fixupm4a.sh \"<filename>\""
> 
> (or add the following line to ~/.get_iplayer/options
> command /some/path/fixupm4a.sh "<filename>"
> - the quotes matter if you end up with a space in the name)
> 
> You're done.  Now every .m4a file produced by get_iplayer will have
> its metadata fixed and optimised, and it plays nicely on Marantz CD
> players, and still imports nicely into iTunes.
> 
> fixupm4a.sh takes a filename as a single parameter, if it's an m4a
> file then it sets the artist tag to whatever the artist tag was before
> (this makes mp4tags rewrite the metadata atoms, doing the fix to make
> the file play), and then optimizes the resulting file to move the
> metadata to the front.
> 
> Cheers
> Jon
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> get_iplayer mailing list
> get_iplayer at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/get_iplayer




More information about the get_iplayer mailing list