Given this file:
youtube-dl -f 140 -o in.m4a --fixup warn https://youtube.com/watch?v=j-70HbaR4g4
I am having mixed results writing metadata. For example these commands:
ffmpeg -i in.m4a -c copy in.mp4
ffmpeg -i in.mp4 -c copy good.aac
ffmpeg -i good.aac -c copy -bsf aac_adtstoasc -metadata title=Confetti `
-movflags faststart good.m4a
Will generate an M4A file that plays correctly with metadata that is recognized. However this command:
ffmpeg -i in.m4a -c copy -movflags faststart -metadata title=Confetti bad.m4a
Generates a file that plays correctly, but my player does not recognize the
metadata. Also, I remembered that I worked on this problem years ago, and I think
I know part of the problem. I ran both files through mp4dump [1], and I
noticed a difference. Here is good file:
[moov] size=8+41912
[trak] size=8+41666
[mdia] size=8+41530
[minf] size=8+41445
[stbl] size=8+41385
[stsd] size=12+91
[mp4a] size=8+79
[esds] size=12+39
[ESDescriptor] size=5+34
[DecoderConfig] size=5+20
DecoderSpecificInfo = 12 10
and bad file:
[moov] size=8+41976
[trak] size=8+41730
[mdia] size=8+41594
[minf] size=8+41483
[stbl] size=8+41423
[stsd] size=12+105
[mp4a] size=8+93
[esds] size=12+53
[ESDescriptor] size=5+48
[DecoderConfig] size=5+34
DecoderSpecificInfo = 12 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00
If you notice, the bad file has more bytes under DecoderSpecificInfo. However,
it seems FFmpeg is just copying that info from the original file. If FFmpeg has
a way to just trash that data it would be ideal. Essentially I think thats why
my "good" command are doing, but it would be nice to be able to do it in one
command.