VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. I'm attempting to combine several pngs and a .gif that are 40px in size and then upscale that to 800px. However, it ends up with dithering dots. These should not occur because we are not adding any additional colors to the frames by upscaling.

    Here's my FFMPEG command:

    ffmpeg -i assets/background.png -i assets/Brown_Boy_Jacket.png -i assets/Wet_Hair.png -i assets/Bouncing_Floppy_Green.gif -i assets/Cigarette.png -filter_complex "[0][1]overlay=format=auto[i1];[i1][2]overlay=format=auto[i2];[i2][3]overlay=format=auto[i3];[i3][4]overlay=format=auto,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse=dither=bayer: bayer_scale=5,scale=800:-1:flags=neighbor " -loop 0 output/mygiffile.gif

    Example if dithered .gif:
    Image
    [Attachment 70591 - Click to enlarge]


    When I upscale to a .png there is no dithering:
    Image
    [Attachment 70590 - Click to enlarge]
    Quote Quote  
  2. Did you try
    Code:
    paletteuse=dither=none
    ?

    Right now you have bayer dither specified
    Code:
    paletteuse=dither=bayer
    https://ffmpeg.org/ffmpeg-filters.html#paletteuse
    Quote Quote  
  3. Just tried it and there is still some noise in the gif: Image
    [Attachment 70596 - Click to enlarge]
    . Thanks for the suggestions though
    Quote Quote  
  4. -sws_dither 0 should disable dithering if it's being applied during the scaling or pixel format conversion step

    You might have to insert it in the filter chain or under flags

    Code:
    scale=800:-1:flags=neighbor
    Code:
    scale=800:-1:flags=neighbor:sws_dither=0
    Quote Quote  
  5. This still has dithering,

    ffmpeg -i assets/background.png -i assets/Brown_Boy_Jacket.png -i assets/Wet_Hair.png -i assets/Bouncing_Floppy_Green.gif -i assets/Cigarette.png -filter_complex "[0][1]overlay=format=auto[i1];[i1][2]overlay=format=auto[i2];[i2][3]overlay=format=auto[i3];[i3][4]overlay=format=auto,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse=dither=none, scale=800:-1:flags=neighborws_dither=0 " -loop 0 output/mygiffile.gif

    Image
    [Attachment 70600 - Click to enlarge]


    Is there something wrong with this structure where the dithering is getting applied before we apply the dither=none and sws_dither=0 parms? I still get confused by the flow of these [s0],[s1], [p] labels and what is actually happening.

    split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse=dither=none,
    Quote Quote  
  6. Originally Posted by Mugunga View Post
    Is there something wrong with this structure where the dithering is getting applied before we apply the dither=none and sws_dither=0 parms? I still get confused by the flow of these [s0],[s1], [p] labels and what is actually happening.

    split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse=dither=none,



    Probably dither is being applied at an earlier step. Maybe something with your format=auto , some hidden conversions to pal8 dithering . You might have to flag those too. Because Bouncing_Floppy_Green.gif is already a gif (pal8) , that overlay step might be applying dithering. eg. If you overlay a RGB24 png and RGB24 png, the "auto" format would be RGB24 and it would not dither

    I don't think overlay format has flags to control the conversion. And "auto" is often a recipe for disaster . Maybe if convert the gif to an APNG first, then use that as input
    https://ffmpeg.org/ffmpeg-filters.html#overlay-1

    s0 and s1 are the same output node (just duplicated) in order to use palletegen and palleteuse in the same commandline

    p is the output node of palletegen, and fed into palletuse as input
    Quote Quote  
  7. You may add to scale additional flags 'accurate_rnd:bitexact' also seem ffmpeg may call silently automatic pixel format conversion... (perhaps libswscale prefer YCbCr color space) this is biggest problem in ffmpeg workflow - i would explicitly request RGB pixel format - alternatively you may give a chance to 'zscale' - it may behave more predictable than 'scale' .
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!