为什么这个 MP4 视频不能在 iOS 上播放?

问题描述 投票:0回答:0

用文档App打开,只会显示文件名和文件类型,一般视频可以直接播放

所以,我换成AVplayer来播放这个只有声音没有画面的视频

mp4信息:

File:
  major brand:      mp42
  minor version:    0
  compatible brand: mp42
  compatible brand: mp41
  fast start:       yes

Movie:
  duration:   18842880 (media timescale units)
  duration:   209365 (ms)
  time scale: 90000
  fragments:  no

Found 2 Tracks
Track 1:
  flags:        1 ENABLED
  id:           1
  type:         Video
  duration: 209320 ms
  language: eng
  media:
    sample count: 5233
    timescale:    25000
    duration:     5233000 (media timescale units)
    duration:     209320 (ms)
    bitrate (computed): 9592.363 Kbps
  display width:  1920.000000
  display height: 1080.000000
  frame rate (computed): 25.000
  Sample Description 0
    Coding:       avc1 (H.264)
    Codec String: avc1.640029
    AVC Profile:          100 (High)
    AVC Profile Compat:   0
    AVC Level:            41
    AVC NALU Length Size: 4
    AVC SPS: [67640029ac2ca501e0111f7350101014000003000400000300ca10]
    AVC PPS: [68e881135250]
    Width:       1920
    Height:      1080
    Depth:       24
Track 2:
  flags:        1 ENABLED
  id:           2
  type:         Audio
  duration: 209320 ms
  language: eng
  media:
    sample count: 9814
    timescale:    48000
    duration:     10049536 (media timescale units)
    duration:     209365 (ms)
    bitrate (computed): 317.376 Kbps
  Sample Description 0
    Coding:       mp4a (MPEG-4 Audio)
    Codec String: mp4a.40.2
    Stream Type: Audio
    Object Type: MPEG-4 Audio
    Max Bitrate: 407250
    Avg Bitrate: 317375
    Buffer Size: 1536
    MPEG-4 Audio Object Type: 2 (AAC Low Complexity)
    MPEG-4 Audio Decoder Config:
      Sampling Frequency: 48000
      Channels: 2
    Sample Rate: 48000
    Sample Size: 16
    Channels:    2

我用视频转换工具转换成适配iPhone:


File:
  major brand:      isom
  minor version:    200
  compatible brand: isom
  compatible brand: iso2
  compatible brand: avc1
  compatible brand: mp41
  fast start:       yes

Movie:
  duration:   209320 (media timescale units)
  duration:   209320 (ms)
  time scale: 1000
  fragments:  no

Found 2 Tracks
Track 1:
  flags:        3 ENABLED IN-MOVIE
  id:           1
  type:         Video
  duration: 209320 ms
  language: eng
  media:
    sample count: 5233
    timescale:    12800
    duration:     2679296 (media timescale units)
    duration:     209320 (ms)
    bitrate (computed): 11996.339 Kbps
  display width:  1920.000000
  display height: 1080.000000
  frame rate (computed): 25.000
  Sample Description 0
    Coding:       avc1 (H.264)
    Codec String: avc1.640033
    AVC Profile:          100 (High)
    AVC Profile Compat:   0
    AVC Level:            51
    AVC NALU Length Size: 4
    AVC SPS: [27640033ac1316c0780227e5c05a8080809818002ee0000bb82f7be0f8442370]
    AVC PPS: [28ee1f2c]
    Width:       1920
    Height:      1080
    Depth:       24
Track 2:
  flags:        3 ENABLED IN-MOVIE
  id:           2
  type:         Audio
  duration: 209320 ms
  language: eng
  media:
    sample count: 9812
    timescale:    48000
    duration:     10047360 (media timescale units)
    duration:     209320 (ms)
    bitrate (computed): 317.379 Kbps
  Sample Description 0
    Coding:       mp4a (MPEG-4 Audio)
    Codec String: mp4a.40.2
    Stream Type: Audio
    Object Type: MPEG-4 Audio
    Max Bitrate: 317379
    Avg Bitrate: 317379
    Buffer Size: 0
    MPEG-4 Audio Object Type: 2 (AAC Low Complexity)
    MPEG-4 Audio Decoder Config:
      Sampling Frequency: 48000
      Channels: 2
    Sample Rate: 48000
    Sample Size: 16
    Channels:    2

AVC Level和比特率都比第一个视频高,但播放正常。

那为什么第一个视频播放不了?

ios swift h.264
© www.soinside.com 2019 - 2024. All rights reserved.