Closed galenlynch closed 3 years ago
This seems to be fixed by some of the changes that I made to #279, which looks better for both yuv420p and also yuv444p. In that PR I have allowed VideoIO to encode in more than just yuv420p.
Here is the behavior of VideoIO in #279:
Reference (target) frame:
VideoIO output with yuv444p encoding:
VideoIO output with yuv420p encoding:
If you compare this to the VideoIO output in the post above, you'll find the colors are much improved.
I was following up on #283 and noticed that there is something wrong about how VideoIO takes a RGB image and converts it into a YUV420 image. I have noticed that the colors in my own videos look terribly washed out, and chalked it up to chroma downsampling. However, comparing the output of VideoIO to a similarly downsampled video produced by the ffmpeg binary suggests there are other errors in how color is being converted.
Here is a (torture) test 100x100
RGB{N0f8}
image that I used for both VideoIO and ffmpeg, saved as a PNG with FileIO:(Note that it looks a bit blurry because I resized it in the html of this post)
Here is the same frame after encoding into h264 (
crf=0
), yuv444p pixel format, with the ffmpeg binary:I think this is nearly pixel perfect.
Here is the frame with yuv420p pixel format, also ffmpeg binary:
chroma downsampling has taken its toll, but the hues are still there.
Here is the frame with yuv420p pixel format, but encoded with VideoIO (
crf=0
, master):There seems to be something wrong with the chroma particularly near the edges, e.g. the top edge. Perhaps we are using a different chroma sub-sampling strategy.
Once again, for comparison, here is the original: