Color banding and codecs


#1

I am using Shotcut to compile video clips from thousands of JPG images. Shotcut does a great job, except I have color banding in the resulting clips where there is atmosphere or water. Anyone have a suggested solution? Someone else has suggested that I use a codec called XVid. Can I add this codec to Shotcut? If so, how?


#2

this reddit thread might help https://www.reddit.com/r/ffmpeg/comments/9ia4o2/issues_with_color_banding_on_dark_soft_gradients/


#3

Are you seeing the banding in the preview, or in the export?

If in the export, what codec and codec parameters are you using? Typically, the banding can be reduced by increasing the bitrate (or quality depending on the mode you use).


#4

I am using ibx264. I think this is the default codec in Shotcut, and also is recommended by You Tube. All of my individual images look fine. The banding shows up when I use Shotcut to compile and video clip and export it. The codec parameters are quality 60%, GOP 125, B frames 3, codec threads 0, rate control quality based VBR, format MP4. I don’t see where to increase bitrate in Shotcut. Thanks.


#5

Thanks. I have taken a quick look. I will have to take a closer look, and try to decipher the discussion, since I am no whiz at this stuff.


#6

According to the reddit thread, in Export you should:

  • in Codec tab, change Quality to 75%
  • in Other tab, change preset= to slower
  • in Other tab, add x264opts=aq-strength=1.9 on its own line
  • optionally, in Other tab, add tune=grain on its own line

#7

Thanks a lot for the tip. I have tried this, and it does significantly reduce the banding…not completely, but maybe to an acceptable level. Shotcut was recommended to me by a computer-whiz friend. Great product.


#8

Here are some more options to try (requires version 18.08 or newer) in the Other tab:
mlt_image_format=rgb24

and one of:
pix_fmt=yuvj420p
pix_fmt=yuv420p10le

yuvj420p uses a greater range of the 8-bit values used in each color component of the pixels.
yuv420p10le uses 10 bits per color component. This may not work on all players and hardware decoders, but even if uploading to a service such as YouTube that will always transcode, it might survive the process better.


#9

Thanks. I will give those a try. I appreciate the help. The other idea I had was to record in PNG rather than JPG. It might solve the color banding problem, but recording in PNG is very sloooooow. It takes me 30-40 minutes to record enough PNGs for a 2-minute video, and it is more difficult because the recording process proceeds in super slow motion.


#10

what do you use to get png?


#11

I am making videos using Space Engine. I can record what I am doing using a built-in feature of Space Engine, and it will save images sequentially at whatever frames per second that I want. I am using 30 frames per second. So that’s thousands of frames for a 2 or 3 minute video clip. The individual images all look clean…no color banding. I can also designate the format, whether it is JPG or PNG. As I understand it, PNG is lossless, so I might be able to avoid the color banding problem using PNG, but the process is very tedious. My computer whiz friend suggests that I use a RAM drive which would speed it up, so I am going to look into that.