[FFmpeg-trac] #8463(avfilter:new): Screen blending regression

FFmpeg trac at avcodec.org
Tue Jan 7 18:39:31 EET 2020


#8463: Screen blending regression
-------------------------------------+-------------------------------------
             Reporter:  antmarot     |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avfilter
              Version:  git-master   |               Resolution:
             Keywords:  blend        |               Blocked By:
  regression                         |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Comment (by pdr0):

 The blend operation in RGB is ok. The problem is inaccurate RGB => YUV
 conversion

 If you test output RGB24, the output is "green" or the expected 0,128,0

 {{{
 ffmpeg -filter_complex "color=green:size=hd720,format=rgba[a];
 color=black:size=hd720,format=rgba[b]; [a][b]
 blend=all_mode=screen,format=rgb24" -vframes 1 rgb24.png -y
 }}}



 To increase accuracy of RGB<=>YUV conversions, either use swsflags with
 -vf scale, or zscale, with appropriate matrix (709 for HD is convention)


 eg. swsflags
 {{{
 ffmpeg -filter_complex "color=green:size=hd720,format=rgba[a];
 color=black:size=hd720,format=rgba[b]; [a][b]
 blend=all_mode=screen,scale=out_color_matrix=bt709:flags=bicubic+accurate_rnd+full_chroma_int+full_chroma_inp,format=yuv420p"
 -t 1 test_swsflags.mp4 -y
 }}}


 eg. zscale
 {{{
 ffmpeg -filter_complex "color=green:size=hd720,format=rgba[a];
 color=black:size=hd720,format=rgba[b]; [a][b]
 blend=all_mode=screen,zscale=matrix=709,format=yuv420p" -t 1
 test_zscale.mp4 -y
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/8463#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list