dthpham / sminterpolate

Make motion interpolated and fluid slow motion videos from the command line.
MIT License
1.39k stars 91 forks source link

Color shift due to 4:2:0 color subsampling #47

Open ajkq opened 7 years ago

ajkq commented 7 years ago

Version: 0.2.3

Butterflow encodes in 4:2:0, even if -lossless option is enabled. Strangely it does set the profile to high 4:4:4. This causes a noticeable color shift, eg. white becomes rgb(251/253/250).

This quick hack improves color accuracy:

--- render.py   2017-04-10 23:32:31.000000000 +0200
+++ render_new.py   2017-04-18 18:46:55.000000000 +0200
@@ -54,7 +54,7 @@

     def mk_render_pipe(self, dest):
         vf = []
-        vf.append('format=yuv420p')
+        vf.append('format=yuv444p')
         call = [
             settings['avutil'],
             '-loglevel', settings['av_loglevel'],

I hacked it further to encode in qtrle (rgb24), same as the source format and similar colorspace as butterflow seems to operate in internally (bgr24). There was still a slight color shift going on, but only noticeable on a color chart.

Is it possible to change the color subsampling to 4:4:4 in lossless mode?

Fire- commented 6 years ago

Also experiencing this on Windows, but as the windows version is compiled, I can't perform this kind of edit without fully rebuilding the project. Kind of frustrating, since it means I can't actually use butterflow as it destroys the output's colors.