使用 ffmpeg 编码的 mp4 无法在 chrome 上显示

使用 ffmpeg 编码的 mp4 无法在 chrome 上显示

我正在使用命令

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 -c:a copy output.mp4

以便压缩我的 mp4 文件。这是输出:

ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.29)
configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2 --enable-shared --enable- 
pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay 
--enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d -- 
enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable- 
librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable- 
libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx -- 
enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid -- 
enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable- 
libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg -- 
enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack - 
-disable-indev=jack --enable-videotoolbox
libavutil      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'servo.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf59.27.100
Duration: 00:00:03.11, start: 0.000000, bitrate: 3184 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, 
progressive), 1920x1080, 3052 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
Metadata:
  handler_name    : Core Media Video
  vendor_id       : [0][0][0][0]
  encoder         : Lavc59.37.100 libx264
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 
126 kb/s (default)
Metadata:
  handler_name    : Core Media Audio
  vendor_id       : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.4+31-6722fce1f
x265 [info]: build info [Mac OS X][clang 12.0.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 
AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 25 / 250 / 40 / 5.00 
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing lslices=6 deblock sao
Output #0, mp4, to 'blah.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf59.27.100
Stream #0:0(und): Video: hevc (hvc1 / 0x31637668), yuv420p(tv, bt709, progressive),             
1920x1080, q=2-31, 29.97 fps, 30k tbn (default)
Metadata:
  handler_name    : Core Media Video
  vendor_id       : [0][0][0][0]
  encoder         : Lavc59.37.100 libx265
Side data:
  cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 
kb/s (default)
Metadata:
  handler_name    : Core Media Audio
  vendor_id       : [0][0][0][0]
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.41 bitrate=       
0.8kbits/sframe=   30 fps=0.0 q=27.0 size=       0kB time=00:00:01.39 bitrate=   
0.3kbits/frame=   56 fps= 52 q=32.9 size=       0kB time=00:00:02.27 bitrate=       
0.2kbits/frame=   84 fps= 53 q=34.7 size=       0kB time=00:00:03.11 bitrate=   
0.1kbits/frame=   93 fps= 44 q=36.0 Lsize=     325kB time=00:00:03.11 bitrate= 
855.3kbits/s speed=1.47x    
video:269kB audio:48kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 2.255045%
x265 [info]: frame I:      1, Avg QP:26.98  kb/s: 11019.14
x265 [info]: frame P:     23, Avg QP:27.96  kb/s: 2008.48 
x265 [info]: frame B:     69, Avg QP:35.17  kb/s: 127.45  
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 4.2% 0.0% 0.0% 95.8% 0.0% 

encoded 93 frames in 2.06s (45.17 fps), 709.77 kb/s, Avg QP:33.30

如您所见,视频已正确压缩。我可以在我的电脑和 Safari 上播放视频,但不能在 Chrome 上播放。过去两个小时我一直在绞尽脑汁试图解决这个问题。我不明白为什么视频无法在 Chrome 上播放。我咨询了这个帖子,但那里的标记对我不起作用。希望尽快得到帮助。

谢谢。

相关内容