Whatsapp FFMPEG缩略图未显示

时间:2019-11-08 12:29:23

标签: python-3.x facebook ffmpeg command-line-interface whatsapp

我想运行一个将图像作为缩略图添加到视频的命令。视频将由WhatsApp共享,并显示缩略图。

问题在于,尽管在Windows 10上显示了以下命令,但在Whatsapp中没有显示缩略图。

ffmpeg -i path/to/Video.mp4 -i path/to/Video.png -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic -strict -2 path/to/out.mp4

另一个问题是带有缩略图的视频无法在Android,iPhone,Windows和Linux上播放。

日志:

ffmpeg version 4.1.4-1+rpt1~deb10u1 2000-2019 the FFmpeg developers
  built with gcc 8 (Debian)
  configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[libaom-av1 @ 0x5b7130] v1.0.0
Input #0, matroska,webm, from 'Video.mp4':
  Metadata:
    COMPATIBLE_BRANDS: iso6av01mp41
    MAJOR_BRAND     : dash
    MINOR_VERSION   : 0
    ENCODER         : Lavf58.20.100
  Duration: 00:03:30.70, start: -0.007000, bitrate: 213 kb/s
    Stream #0:0: Video: av1 (Main), yuv420p(tv, bt709), 256x144, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      HANDLER_NAME    : ISO Media file produced by Google Inc.
      DURATION        : 00:03:30.627000000
    Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:03:30.701000000
Input #1, image2, from 'Video.png':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 23403 kb/s
    Stream #1:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[mp4 @ 0x625260] track 2: codec frame size is not set
Output #0, mp4, to 'out.mp4':
  Metadata:
    COMPATIBLE_BRANDS: iso6av01mp41
    MAJOR_BRAND     : dash
    MINOR_VERSION   : 0
    encoder         : Lavf58.20.100
    Stream #0:0: Video: mjpeg (mp4v / 0x7634706D), yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 tbr, 12800 tbn, 25 tbc
    Stream #0:1: Video: av1 (Main) (av01 / 0x31307661), yuv420p(tv, bt709), 256x144, q=2-31, 23.98 fps, 23.98 tbr, 16k tbn, 1k tbc (default)
    Metadata:
      HANDLER_NAME    : ISO Media file produced by Google Inc.
      DURATION        : 00:03:30.627000000
    Stream #0:2(eng): Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, fltp (default)
    Metadata:
      DURATION        : 00:03:30.701000000
Stream mapping:
  Stream #1:0 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
  Stream #0:1 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=-1.0 q=-1.0 size=    3840kB time=00:02:47.56 bitrate= 187.frame=    1 fps=0.0 q=-1.0 Lq=-1.0 size=    5632kB time=00:03:30.68 bitrate= 219.0kbits/s speed= 324x    
video:2275kB audio:3221kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.464468%

我在做什么错了?

注意:可以与python一起使用。

1 个答案:

答案 0 :(得分:1)

我注意到当我将视频转码为30 fps时,我在WhatsApp中获得了预览。 也许有帮助。