Is it possible to write 16 bit monochrome images to an avi video file?

asked 2019-06-27 09:23:03 -0600

mdresser gravatar image

I am getting 16bit monochrome data from a FLIR GigE camera and want to save all 16 bits to a video file for future processing. (Actually it is 12 bit data but stored in 16 bit words (16UC1)).

I am able to convert the images to 8UC1 monochrome or 8UC3 BGR and create a video file using the 'FFV1' codec and the appropriate isColor flag. ('FFV1' codec is included with ffmpeg and is supposedly lossless)

If I try to write the 16UC1 image to the video writer it crashes with the message:

OpenCV(3.4.2) Error: Assertion failed (image.depth() == 0) in cv::`anonymous-namespace'::CvVideoWriter_FFMPEG_proxy::write, file c:\build\3_4_winpack-build-win64-vc15\opencv\modules\videoio\src\cap_ffmpeg.cpp, line 296

Are there codecs that work with more than 8 bit data, or ways to pass 16 bit data to standard codecs?

I'm running out of ideas...


edit retag flag offensive close merge delete


sir,did you solve this problem?

sophia gravatar imagesophia ( 2020-04-23 21:57:05 -0600 )edit