ffmpeg - what is the default format for .m4a output?

自古美人都是妖i 提交于 2021-01-29 08:44:13

问题


I have two commands, one in which I specify the output format as -f mp4:

ffmpeg -i input.wav -ac 1 -c:a libfdk_aac -profile:a aac_he -vbr 2 -f mp4 test_export_1.m4a

And one which lets ffmpeg guess based on the extension:

ffmpeg -i input.wav -ac 1 -c:a libfdk_aac -profile:a aac_he -vbr 2 test_export_2.m4a

This gives me two different results.

The first one:

$ffprobe test_export_1.m4a
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_export_1.m4a':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:07.13, start: 0.000000, bitrate: 40 kb/s
    Stream #0:0(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 39 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

The second one:

$ffprobe test_export_2.m4a
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_export_2.m4a':
  Metadata:
    major_brand     : M4A 
    minor_version   : 512
    compatible_brands: isomiso2
    encoder         : Lavf58.29.100
  Duration: 00:00:07.13, start: 0.000000, bitrate: 40 kb/s
    Stream #0:0(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 39 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

The first one with the brand isom won't play on Android devices. The second one works fine. Why are these outputs different, and how can I specify the correct format to get major_brand : M4A like the second one? I'm using pydub to run the commands, which requires a format flag.


回答1:


.m4a is not a recommended ISO extension but is typically used by Apple. It has a limited list of acceptable codecs as compared to .mp4. Format flag is -f ipod.



来源:https://stackoverflow.com/questions/62718725/ffmpeg-what-is-the-default-format-for-m4a-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!