Twitter不接受由ffmpeg創建的有效幻燈片視頻


0

我使用ffmpeg從幻燈片創建視頻。最後我有一個有效的視頻。VLC播放該視頻,YouTube也播放。我想直接在Twitter上顯示最終產品。

我根據Twitter接受此視頻所需的分辨率,幀率,寬高比和大小檢查了recommened specs。但是,當仍然嘗試將視頻直接添加到Twitter時,仍然收到錯誤消息"找不到支持格式或MIME類型的視頻"。

Ffmpeg不顯示任何錯誤或警告。

參數:

ffmpeg -f image2pipe -framerate 1 -i pipe:.png -c:v libx264 -crf 21  -r 30 -y "Blathering.noaudio.mp4"

如您所見,我每幀創建一個圖像(幀速率1),但是創建一個30fps的輸出文件(-r 30)

ffmpeg的輸出如下:

ffmpeg version git-2020-06-17-0b3bd00 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 92.100 / 58. 92.100
  libavformat    58. 46.101 / 58. 46.101
  libavdevice    58. 11.100 / 58. 11.100
  libavfilter     7. 86.100 /  7. 86.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, image2pipe, from 'pipe:.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba(pc), 680x420 [SAR 3779:3779 DAR 34:21], 1 fps, 1 tbr, 1 tbn, 1 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
[libx264 @ 00000217ad682780] using SAR=1/1
[libx264 @ 00000217ad682780] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000217ad682780] profile High 4:4:4 Predictive, level 3.0, 4:4:4, 8-bit
[libx264 @ 00000217ad682780] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: 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=4 threads=12 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=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=21.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'Blathering.noaudio.mp4':
  Metadata:
    encoder         : Lavf58.46.101
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p, 680x420 [SAR 1:1 DAR 34:21], q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.92.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=  150 fps=0.0 q=-1.0 Lsize=      17kB time=00:00:04.90 bitrate=  29.2kbits/s dup=145 drop=0 speed=  29x
video:15kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 17.439800%
[libx264 @ 00000217ad682780] frame I:1     Avg QP:12.52  size:  9283
[libx264 @ 00000217ad682780] frame P:38    Avg QP:10.45  size:    53
[libx264 @ 00000217ad682780] frame B:111   Avg QP:11.67  size:    29
[libx264 @ 00000217ad682780] consecutive B-frames:  1.3%  0.0%  0.0% 98.7%
[libx264 @ 00000217ad682780] mb I  I16..4: 66.0% 25.8%  8.3%
[libx264 @ 00000217ad682780] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:99.9%
[libx264 @ 00000217ad682780] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.5%  0.0%  0.0%  direct: 0.0%  skip:99.5%  L0:64.2% L1:35.8% BI: 0.0%
[libx264 @ 00000217ad682780] 8x8 transform intra:25.9% inter:0.0%
[libx264 @ 00000217ad682780] coded y,u,v intra: 5.2% 3.2% 3.1% inter: 0.0% 0.0% 0.0%
[libx264 @ 00000217ad682780] i16 v,h,dc,p: 89% 11%  0%  0%
[libx264 @ 00000217ad682780] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 60%  4% 36%  0%  0%  0%  0%  0%  0%
[libx264 @ 00000217ad682780] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 36% 19%  2%  3%  3%  5%  2%  4%
[libx264 @ 00000217ad682780] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000217ad682780] ref P L0: 86.2%  3.4% 10.3%
[libx264 @ 00000217ad682780] ref B L0: 51.9% 48.1%
[libx264 @ 00000217ad682780] kb/s:23.31

編解碼器信息如下:

codec

這是純圖像,視頻中目前沒有音頻。是否有我缺少的參數?恕我直言,這看起來像是我在其中創建的非常常見的視頻文件。

1

PNG contain RGB data and video contains YUV pixels. FFmpeg will select yuv444p to preserve chroma sampling resolution but that pixel format is not widely compatible. Force yuv420p output.

Use ffmpeg -f image2pipe -framerate 1 -i pipe:.png -c:v libx264 -pix_fmt yuv420p -crf 21 -r 30 -y "Blathering.noaudio.mp4"