I take a linear gradient input in the range [0, 255], where each next pixel is greater than the previous one by 1 rgb value.
Then I convert it to lossless video, input - rgba(pc), output - yuv444p(tv, progressive):
ffmpeg -y -i %01d.png -c:v hevc_nvenc -pix_fmt yuv444p -tune lossless out.mov
And back to the image, input - yuv444p(tv, progressive), output - rgb24(pc, gbr/unknown/unknown, progressive):
ffmpeg -i "out.mov" "img/out-%03d.png"
The result is not lossless, almost every pixel differs from the original by -2...+2:
The same thing happens with other encoders, for example: ffmpeg -y -i %01d.png -crf 0 out.mov. Perhaps it is caused by the limited range of tv, how to set it to full? -dst_range 1 -color_range 2 doesn't seem to be working. Maybe there is something else?




