[FFmpeg-trac] #10987(avutil:new): Blend video filter *_expr options don't handle store and load functions correctly.

FFmpeg trac at avcodec.org
Tue Apr 30 10:48:40 EEST 2024


#10987: Blend video filter *_expr options don't handle store and load functions
correctly.
-------------------------------------+-------------------------------------
             Reporter:  Fallan       |                     Type:
                                     |  enhancement
               Status:  new          |                 Priority:  normal
            Component:  avutil       |                  Version:  git-
             Keywords:  "blend       |  master
  filter" "store and load" st()      |               Blocked By:
  ld()                               |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 For example make a local gradient over normalized height 0.2 starting at
 0.5, which will be used to transition between 2 input videos. E.G. the
 inputs could be Big Buck Bunny variations, the first having been self-
 modified by blend-glow and the second by blend-burn:
 ffmpeg -i B3.mov -vf "split[F][G];[F][G]blend=all_mode=glow" -c:v ffv1 -an
 glow.mkv
 and similarly burn.mkv with blend=c0_mode=burn.  Now I should be able to
 do
 ffmpeg -i burn.mkv -i glow.mkv -filter_complex
 "[0:v][1:v]blend=all_expr=st(0,clip((Y/H-0.5)/0.2\,0.0\,1.0))\;A*ld(0)+B*(1.0-ld(0))"
 -c:v libx265 -crf 16 -preset slow -an output.mkv
 But the result has random snow obscuring the image.  It works fine if I
 omit st() and replace the 2 ld()'s with clip()'s but that takes longer to
 run.
 I am using ffmpeg version "2024-04-25-git-cae0f2bc55-full_build-
 www.gyan.dev" and it happens in older versions too.
 I suspect this is known behavior which has been described in other context
 as "stored variables not having global scope" and they don't transmit
 between color planes but here we have the same color plane and frame, just
 different streams that are already in the same scope in avfilter.  It sure
 would be beneficial if this worked.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10987>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list