How to read 10-bit RGB values from HDR video? I had a HDR video and the format is ProRes. The colour bit depth of ProRes is 10-bit. I would like to extract the 10-bit RGB values from the HDR video.

As per this link, I have first converted the 10-bit HDR video to a number of 16-bit TIFF images. However, when I use some program like python to read back the RGB values from the TIFF image, some of the 16-bit RGB values are larger than 1024 (=2^10). It looks to me the 10-bit RGB value has been expanded to 16-bit and store the expanded value in the TIFF image but I am not sure if that is the case. How can I obtain the original 10-bit RGB values from the 16-bit RGB values stored in the TIFF image?
The ProRes input will have YUV encoding, not RGB. If you need a raw dump, save as rawvideo.

ffmpeg -i in.mov -f rawvideo raw.yuv


Note that bit depths which aren't multiples of 8 are still stored in data layouts which are, with padding. So, if ProRes is yuv422p10le in limited / studio range, the 10-bit luma value for a white pixel will be 940 or 1110101100 but will be stored as 16 bits in the file: 1110110000000011 where the order is little-endian.

You can however save as RGB 10-bit (with padding),

ffmpeg -i in.mov -pix_fmt gbrp10be -f rawvideo raw.rgb


where the green plane is stored first, then blue, then red. The above is for big-endian so the byte order isn't reversed.