Ask Your Question

Is it possible for opencv to save 16 bits single channel video?

asked 2020-04-23 22:10:05 -0600

sophia gravatar image

I would like to save a series of 16 bits depth images to a video. I used VideoWriter but it only save video in 8 bits 3 channels. And I also check this linklink text, I don't know if it sopport 16 bits and single channel video write, or what can I do to save 16 bits single channel depth images as a video in C++? Can anyone help me ? Thanks for advanced.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-04-24 02:00:18 -0600

berak gravatar image

updated 2020-04-24 05:37:51 -0600

you can write grayscale images by setting the last argument to VideoWriter to false, but it won't support 16bit images.

until you find a better idea, try to save a sequence of single 16bit images using imread() / imwrite()


if you have numbered 16bit images, like a0001.png, a0002.png, a0003.png you can use:

cap = VideoCapture("a0001.png") # start with 1st img number

and still retrieve 16bit images !

edit flag offensive delete link more


Thanks a lot . It seems I need to find an another way to skip this problem.

sophia gravatar imagesophia ( 2020-04-24 05:11:47 -0600 )edit

@sophia. Does this help 16-bit channel?

supra56 gravatar imagesupra56 ( 2020-04-29 04:03:03 -0600 )edit

Question Tools

1 follower


Asked: 2020-04-23 22:10:05 -0600

Seen: 2,307 times

Last updated: Apr 24 '20