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
Mon Apr 11 12:24:14 EDT 2011


Simon Nash wrote:
> richard wrote:
>> On Sun Apr 10 02 Simon Nash wrote:
>>
>>> I would be interested in trying these on my Linn DS.
>>
>> I will send you three m4a files off list of Bells on Sunday (2.8Mb each)
>> downloaded with get_iplayer for you to try. The 3 files are:
>>
>> Bells1_noscript.m4a
>> This file does not use Jon's script. The file does not play.
>>
>> Bells1_noscript_mp4creator.m4a This file does not use Jon's script, 
>> but has been optimized with
>> mp4creator using:
>> mp4creator -optimize Bells1_noscript_mp4creator.m4a
>> The file does not play.
>>
>> Bells1_script.m4a This file uses Jon's script. The file plays OK.
>>
>> I also ran the files with AtomicParsley. The results were:
>>
>> :~/audio$ AtomicParsley Bells1_noscript.m4a -t + free atom space: 2056
>> padding available: 2048 bytes
>> user data space: 5700
>> media data space: 2880808
>>
>> :~/audio$ AtomicParsley Bells1_noscript_mp4creator.m4a -t +
>> free atom space: 0
>> padding available: 0 bytes
>> user data space: 5700
>> media data space: 2880808
>>
>> :~/audio$ AtomicParsley Bells1_script.m4a -t +
>> free atom space: 0
>> padding available: 0 bytes
>> user data space: 5700
>> media data space: 2880808
>>
> Thanks for sending these.  I tried them on the Linn DS and they all
> played OK.  It seems that there is some other issue with the Marantz
> that doesn't affect the Linn DS.  I'll look at the three files in
> more detail to see if I can get any clues from that.
> 
I've narrowed down the vital difference (with a little more help from
Richard).  In the DecoderConfigDescriptor within the esds atom, there's
a field named avgBitrate (average bit rate).  In the file that doesn't
play, this field is set to zero.  In the file that does play, this field
is set to a non-zero value.

I think the most efficient way to get this field set correctly is to
use ffmpeg to create a .aac file and then use mp4creator -optimize to
convert this file to a .mp4 file.  This will put the moov atom at the
start of the file, set the esds descriptor lengths using the 4-byte
format, and set the average bitrate field correctly.

I have sent Richard a .mp4 file created in this way for him to try.

   Simon

>> I'd be interested to know how you managed to get a m4a file to play on
>> my Marantz using only mp4creator. I cannot replicate that. It seems to
>> need mp4tags to rewrite the metadata atoms to make the file playable.
>> Unless you know otherwise.
>>  
> The test files that I sent you were actually created using iTunes and then
> patched to remove the iTunes-specific header information.  I have verified
> that files produced by mp4creator with the -optimize option play OK on the
> Linn DS, but it seems that for some reason they don't play on the Marantz.
> 
>   Simon
> 
> 
> _______________________________________________
> 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