Is H265 encoding via 01_video_encode really lossless?

Hi! I am attempting to losslessly encode/decode Y444 video using 00_video_decode and 00_video_encode. I’ve been told its only supported for H265, however, whenever I try to generate a Y444 video, encode it, and then decode it, the original and decoded videos differ. I’ve posted my command line below, but am I missing anything – Are the tools actually byte-by-byte lossless? Any help would be much appreciated!

gst-launch-1.0 videotestsrc num-buffers=30 ! ‘video/x-raw, width=(int)1920, height=(int)1080, format=(string)Y444’ ! filesink location=~/origfile.yuv
./01_video_encode/video_encode ~/origfile.yuv 1920 1080 H265 ~/compfile.h265 --elossless
./00_video_decode/video_decode H265 --disable-rendering -o ~/decompfile.yuv ~/compfile.h265
diff ~/origfile.yuv ~/decompfile.yuv

Please check whether decompfile.yuv is in YUV444. It may be converted to YUV420.

1 Like

Thank you, according to the help message, decoding doesn’t actually support Y444 despite the encoder supporting it. I’ve used NV24 instead for both input and output and they match.

NV24 and YUV444 are identical in data bytes, but data layout is different. YUV444 has 3 planes and NV24 has 2 planes. The decoded YUV data is in NV24 and if you convert it to YUV444, the data is identical.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.