【问题标题】:FFmpeg screen blend mode turns image pinkFFmpeg 屏幕混合模式将图像变为粉红色
【发布时间】:2021-02-02 17:26:39
【问题描述】:

我在使用屏幕混合模式时遇到问题。我正在尝试创建视频延迟/回声效果。我的东西工作得很好,但是每当我尝试使用屏幕混合模式时,我都会得到一个粉红色的图像。其他混合模式没有这个问题,但屏幕模式可能会给我最好的视觉效果。

我看到有人问过类似的问题here,答案建议在进行混合之前转换为 RGBa。我已经尝试过了,但它没有用。这是我的代码和 ffmpeg 信息。

ffmpeg -i sampleVideo.mov -c:v prores -profile:v 3 -filter_complex "split[dry][toEcho];[toEcho]setpts=PTS+0.2/TB[wet];[wet][dry]blend=all_mode=screen:all_opacity=1,format=yuv422p10le[out]" -map [out] sampleVideo_echo.mov

ffmpeg 信息:

ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.3_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/morgan/Movies/AVAA/TapeDamage01.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:00:05.16, start: 0.000000, bitrate: 3717 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 81:80 DAR 27:20], 3560 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : Apple Video Media Handler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      handler_name    : Apple Sound Media Handler
File '/Users/morgan/Movies/AVAA/TapeDamage01_echo.mov' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 (h264) -> split
  format -> Stream #0:0 (prores)
Press [q] to stop, [?] for help
Output #0, mov, to '/Users/morgan/Movies/AVAA/TapeDamage01_echo.mov':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
    Stream #0:0: Video: prores (HQ) (apch / 0x68637061), yuv422p10le, 640x480 [SAR 81:80 DAR 27:20], q=2-31, 200 kb/s, 29.97 fps, 30k tbn, 29.97 tbc (default)
    Metadata:
      encoder         : Lavc58.54.100 prores

这是输入文件的示例:

这是粉红色的输出

【问题讨论】:

    标签: video ffmpeg echo delay blend


    【解决方案1】:

    您应该将像素格式更改为gbrp(使用format=gbrp)。 Read more for details.

    【讨论】:

      【解决方案2】:

      查看所有混合模式:

      #!/bin/bash
      for i in  addition ‘grainmerge and average burn darken difference grainextract divide dodge freeze exclusion extremity glow hardlight hardmix heat lighten linearlight multiply multiply128 negation normal or overlay phoenix pinlight  reflect screen softlight subtract vividlight xor; do
        ffplay -autoexit -t 2 -vf "
        split[dry][toEcho];
        [toEcho]setpts=PTS+0.2/TB[wet];
        [wet][dry]blend=all_mode=${i}:all_opacity=1[bl];
        [bl]drawtext=text=${i}:fontsize=100:fontcolor=white[out]
        " sampleVideo.mov
      done
      

      https://ffmpeg.org/ffmpeg-filters.html#blend-1

      【讨论】:

        猜你喜欢
        • 2013-12-01
        • 1970-01-01
        • 1970-01-01
        • 2016-01-24
        • 2012-07-29
        • 1970-01-01
        • 2022-10-12
        • 1970-01-01
        • 2011-11-14
        相关资源
        最近更新 更多