我经常使用 ffmpeg 在 mp4 文件(以 H264 和 AAC 编码)中编码一些视频、蓝光等,以便在网络浏览器上播放。
基于 Chromium 的浏览器(例如 Google Chrome 或新的 Microsoft Edge)可以完美地播放我的所有文件。
但是今天我注意到某些网络浏览器无法加载某些视频文件。看起来它们无法由任何非基于 Chromium 的网络浏览器加载。 (Safari、Firefox 等。)
所以我决定检查并比较适用于任何网络浏览器的文件的规范,以及不适用于非基于 Chromium 的浏览器的文件。
这就是我得到的:
General
Complete name : /storage/100.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/iso2/avc1/mp41)
File size : 624 MiB
Duration : 23 min 54 s
Overall bit rate : 3 648 kb/s
Encoded date : UTC 2019-10-02 22:15:27
Tagged date : UTC 2019-10-02 22:15:27
Writing application : HandBrake 1.2.2 2019022300
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=3, N=24
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 23 min 54 s
Bit rate : 3 481 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 23.976 (24000/1001) FPS
Minimum frame rate : 23.974 FPS
Maximum frame rate : 23.981 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.070
Stream size : 595 MiB (95%)
Encoded date : UTC 2019-10-02 22:15:27
Tagged date : UTC 2019-10-02 22:15:27
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 23 min 54 s
Bit rate mode : Constant
Bit rate : 160 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 27.4 MiB (4%)
Title : Stereo
Language : Japanese
Default : Yes
Alternate group : 1
Encoded date : UTC 2019-10-02 22:15:27
Tagged date : UTC 2019-10-02 22:15:27
General
Complete name : /storage/DL/test.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 329 MiB
Duration : 23 min 52 s
Overall bit rate : 1 926 kb/s
Writing application : Lavf58.20.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 23 min 52 s
Bit rate : 1 792 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
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.036
Stream size : 306 MiB (93%)
Writing library : x264 core 155 r2917 0a84d98
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=34 / lookahead_threads=8 / 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=1 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=21.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : Japanese
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 23 min 52 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 21.9 MiB (7%)
Language : Japanese
Default : Yes
Alternate group : 1
我的知识有限,我无法理解为什么以及哪些差异导致了我的问题。
有人可以找出问题并帮助我用 ffmpeg 解决它吗?
谢谢
最佳答案
哦,我的错,看起来问题不是由引用计数引起的。
实际上,“非基于 Chromium 的网络浏览器无法播放”视频是 10 位视频。
在这里问我的问题之前,我怀疑位深度可能是我的问题。为了确认,我把这个 10bits 的文件转换成 8bits 的文件,试了一下,还是不行。所以我在这里发布了这个新转换的 8 位文件的信息以及有效的文件。
我不知道转换后测试这一集时发生了什么,但我刚刚再次测试它,现在它可以工作了。
很抱歉不必要地发布,因为我的问题实际上不是问题,感谢您尝试帮助我:)
关于audio - 任何非基于 Chromium 的网络浏览器都无法加载某些 H264-mp4 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61561476/