In order to test a lossless recording system, I have to verify that the input video is exactly the same than the output video. As a test source I have generated an ffmpeg's testsrc pattern, which is really nice by the way. It makes such pictures, for those who don't know: https://i.sstatic.net/0laHY.jpg
When I play this video with MPC-HC and I make print screen, I could see that the Reg, Green and Blue color bars are not as expected:
Player | Red (R, G, B) | Green (R, G, B) | Blue (R, G, B) |
MPH-HC (Gamma 2.20) | (255, 17, 0) | ( 0, 216, 0) | ( 0, 6, 255) |
MPH-HC (Gamma 2.35) | (255, 13, 0) | ( 0, 213, 0) | ( 0, 4, 255) |
MPH-HC (Gamma 2.40) | (255, 12, 0) | ( 0, 213, 0) | ( 0, 4, 255) |
ffplay | (235, 15, 14) | ( 14, 237, 14) | ( 16, 15, 239) |
ffmpeg -> .bmp | (255, 0, 0) | ( 0, 255, 0) | ( 0, 0, 255) |
Note: To get the (R, G, B) value I did a print screen and paste into MS Paint. Then I use the color picker tool.
I can explain the ffplay value, it's due to TV levels [16..235] instead of PC level [0..255]. After having googled how to configure ffplay so as to output PC levels I didn't find any possibilities.
I can explain the variation of the color bars when I use different value of gamma in MPC-HC. As a software developer I have modified MPC-HC source code to play with other values of gamma. I couldn't find a value of gamma that doesn't alter the color. A lower value will increase the quantity of Green in the Red and Blue color bars. A higher value will decrease the quantity of Green in the Red and Blue color bars, but it will also decrease the quantity of green in the Green bar! So my conclusion is that it doesn't come from the gamma correction.
I've generated a 3840 x 2160 video, so the color are in BT.709 space. When I play with MPC-HC I confirm the BT.709 is used.
Does anyone have an idea where it may come from?
ffplay -f lavfi -i testsrc -vf scale=dst_range=1
ffmpeg -f lavfi -i testsrc=duration=60:size=38400x2160:rate=60 testsrc.mp4
ffmpeg -f lavfi -i testsrc=duration=60:size=3840x2160:rate=60 -crf 0 -c:v libx264rgb testsrc.mp4
ffmpeg -f lavfi -i testsrc=duration=60:size=3840x2160:rate=60 -crf 0 -c:v libx264rgb -vf scale=dst_range=1 testsrc.mp4
it works perfectly! Thanks a lot @Mulvya for your great support. By the way, Is always -crf 0 doing lossless like -qp 0 does?