FFmpeg corrupts M4A files

4

I am trying to create M4A files to play in my car, which has a USB interface.
This file works fine as is. However if I remux the file using:

ffmpeg -i Miaow-02-Hidden.m4a -c copy outfile.m4a

It will no longer play in my car.

Steven Penny

Posted 2013-07-07T04:34:08.083

Reputation: 7 294

From my experience car radios tend to be very picky. Might be worth a shot asking the vendor what kinds of formats are supported, or enquiring in a product support forum. Does it work if you re-encode the audio? – slhck – 2013-07-07T07:04:57.623

Answers

4

I can the two files through TagEditor and noticed a difference:

$ tageditor --info --files Miaow-02-Hidden.m4a outfile.m4a
Technical information for "Miaow-02-Hidden.m4a":
  Container format: MPEG-4 Part 14
    Document type                 M4A
    Duration                      4 min 5 s 156 ms
    Creation time                 2010-11-03 09:42:53
    Modification time             2010-11-03 09:43:12
    Tag position                  before data
    Index position                before data
    Padding                       3.12 KiB

Technical information for "outfile.m4a":
  Container format: MPEG-4 Part 14
    Document type                 M4A
    Version                       512
    Duration                      4 min 5 s 157 ms
    Creation time                 1904-01-01 00:00:00
    Modification time             1904-01-01 00:00:00
    Tag position                  after data
    Index position                after data
    Padding                       8 bytes

As you can see, the original file has the index (moov atom) at the beginning of the file. This is known as faststart. I changed my command and it fixed the problem:

ffmpeg -i Miaow-02-Hidden.m4a -c copy -movflags faststart outfile.m4a

Steven Penny

Posted 2013-07-07T04:34:08.083

Reputation: 7 294