【问题标题】:.m4a is considered audio/m4a or audio/mp4.m4a 被认为是 audio/m4a 或 audio/mp4
【发布时间】:2017-02-14 14:15:28
【问题描述】:

我正在尝试将音频上传到 S3,但我有点困惑我应该将我的 mime 类型声明为什么。我的音频文件是在 iphone 上录制为 kAudioFormatMPEG4AAC 的 m4a。这会被视为audio/m4a 还是audio/mp4?我在网上看到相互矛盾的答案。

【问题讨论】:

    标签: ios audio core-audio


    【解决方案1】:

    m4a 中的m4MPEG-4 的简写,就像mp4MPEG-4 的简写一样。

    实际上,m4am4vmp4 文件都具有相同的内部MPEG-4 原子结构。文件之间的区别在于它们的内容(视频文件有视频原子和音频原子。)

    尽管使用相同的文件扩展名,音频的编解码器也可能不同,例如alacAAC 格式都使用MPEG-4 容器格式和m4a 文件扩展名。

    所以要回答你的问题,这真的没有太大区别。我个人的偏好是audio/mp4,因为这实际上是在说

    MPEG-4 容器中的音频数据

    audio/m4a 就像在说

    MPEG-4 容器中包含音频的音频数据

    【讨论】:

      【解决方案2】:

      使用audio/mp4audio/m4a 可能有效,但无效。

      MP4 MIME type registration:

      2.  Selection of MIME Types for MP4 Files
      
         The MIME types to be assigned to MP4 files are selected according to
         the contents.  Basic guidelines for selecting MIME types are as
         follows:
      
         a) if the file contains neither visual nor audio presentations, but
            only, for example, MPEG-J or MPEG-7, use application/mp4;
      
         b) for all other files, including those that have MPEG-J, etc., in
            addition to video or audio streams, video/mp4 should be used;
            however:
      
         c) for files with audio but no visual aspect, including those that
            have MPEG-J, etc., in addition to audio streams, audio/mp4 may be
            used.
      
         In any case, these indicate files conforming to the "MP4"
         specification, ISO/IEC 14496-1:2000, systems file format.
      

      此外,the list of standard MIME types 包括 audio/mp4,而不是 audio/m4a,非标准 MIME 类型应包括“x-”,如 audio/x-m4a

      【讨论】:

      • 另外,.m4a 是 MP4 容器的非标准扩展。
      【解决方案3】:

      在 2021 年对我来说,audio/mp4 .m4a 文件在 Firefox + Chrome (Linux)、Opera (Android) 上工作,但在 iPhone Safari 上不工作。对于某些格式,操作系统由于编解码器而发挥作用。 我使用了一个带有类型属性集的源标签,我还在流/下载文件的Content-Type 标头中设置了相同的类型

      另见:How to play .m4a with HTML5 audio in IE(9+) and Safari (Pad)?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-01-18
        • 2011-12-23
        • 2018-05-12
        • 1970-01-01
        • 2012-03-13
        • 2016-04-07
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多