I have an mp4 video file with these characteristics:
-Encoder: Lavf58.29.100
I want to extract each frame as an image, with the following requirements:
one image file is one frame (i.e., account for variable framerates to work in all cases),
the image file has to be lossless TIFF.
I use Linux and would prefer Python to do this, but I can also use FFmpeg.
However, I have seen some other posts here, but they are either not-replied to or just need JPG format. I have read the imwrite documentation (OpenCV) and saw that it is actually possible to export as TIFF (even with different bit-depths), but I can't see an example of using that. I also do not know how to confirm if the exported TIFF is actually without compression.
The reason I need each frame as a lossless image file is that I need the images for further analysis in research, and I don't want to lose any information at this stage (the sequence of images is the starting 'raw material' of my analysis pipeline).
cv2.imwrite(name, frame, [cv2.IMWRITE_JPEG_QUALITY, 100])