【问题标题】:Is there iOS browser support for mp4 with h264 video and 4 (or more) AAC audio channels?iOS 浏览器是否支持带有 h264 视频和 4 个(或更多)AAC 音频通道的 mp4?
【发布时间】:2021-12-08 17:00:36
【问题描述】:

我使用 ffmpeg 将 4 个通道(两个立体声)的 AAC 音频添加到带有 h264 视频的 mp4 中。我正在使用 Web Audio Api 来拆分通道并将它们重新合并在一起,以便与视频同步进行独立控制。这在 Windows 和 macOS 浏览器(Chrome、Firefox、Safari、Opera、Edge)上成功运行,但该文件无法在 iOS(Safari 和 Chrome)上播放。我正在等待一个 android 设备在该平台上进行测试,但从我收集到的内容来看,这将起作用。有人对这个问题有任何见解吗?提前谢谢!

我在下面添加了 mediainfo 查询的日志,以及我从 React 应用程序返回的 html 代码(也在 React 之外进行了测试),以及来自 videojs 的错误日志(也测试了绕过 videojs)。

Complete name                            : multi_channel.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 25.7 MiB
Duration                                 : 4 min 33 s
Overall bit rate                         : 787 kb/s
Writing application                      : Lavf58.76.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 4 min 33 s
Bit rate                                 : 525 kb/s
Width                                    : 1 280 pixels
Height                                   : 536 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.032
Stream size                              : 17.1 MiB (67%)
Title                                    : ISO Media file produced by Google Inc. Created on: 09/03/2019.
Writing library                          : x264 core 163 r3060 5db6aa6
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=17 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Menus                                    : 3
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 4 min 33 s
Source duration                          : 4 min 33 s
Source_Duration_LastFrame                : -22 ms
Bit rate mode                            : Constant
Bit rate                                 : 257 kb/s
Channel(s)                               : 4 channels
Channel layout                           : L R Ls Rs
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 8.37 MiB (33%)
Source stream size                       : 8.37 MiB (33%)
Default                                  : Yes
Alternate group                          : 1
Menus                                    : 3
mdhd_Duration                            : 273764

Menu #1
ID                                       : 3
Codec ID                                 : text
Duration                                 : 4 min 33 s
Language                                 : English
Menu For                                 : 1,2
00:00:00.000                             : Tempo: 120.0

Menu #2
00:00:00.000                             : Tempo: 120.0


  <video
      playsInline
      crossOrigin="anonymous"
      ref={videoEl}
      width="750"
      height="500"
      controls >
      <source src={constants.mp4} type={'video/mp4'}/>
  </video>

ERRORVIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) 媒体播放因损坏问题或您的浏览器不支持的媒体使用的功能而中止。

【问题讨论】:

    标签: web audio html5-video html5-audio mp4


    【解决方案1】:

    您能否添加一些代码 - 例如视频属性 - iOS 需要“playsinline”属性 - 这是首先要检查的内容。

    如果存在 - 控制台日志会告诉您什么?

    【讨论】:

    • 感谢您的回复@Doug。我正在使用 React 开发它,并使用 videojs 处理视频。为简化起见,我断开了 videojs 和所有 Web Audio Api 集成的连接,只是从 React 渲染了一个 html5
    • 看来 iOS 浏览器不支持 mp4 中的多声道音频。也许没有解决方法,但我不确定格式化 mp4 是否有问题/可调整。
    猜你喜欢
    • 2011-05-25
    • 1970-01-01
    • 1970-01-01
    • 2018-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多