add uint8 frame to vision.videofilewriter object using the step function

1 view (last 30 days)
The frame seems to be added to the object as singe-precision instead of uint8, which creates videos that are too huge. We cannot use the compression option as that works for windows only. The vision.videofilereader has an option to output uint8 frames. Is there a similar option in vision.videofilewriter?
We are using vision.* because the plain videoreader does not support audio.

Answers (1)

Dima Lisin
Dima Lisin on 23 Jul 2014
You can pass uint8 frames into vision.VideoFileWriter. However, I think the frames are always stored as uint8 on disk, and reason your videos are huge is the lack of compression. By the way, you should be able to use the Motion JPEG 2000 format on Linux, by setting the FileFormat property to 'MJ2000'.
Note that after you call the step() method for the first time, you must pass in the frame of the same size and the same data type in all the subsequent calls. So if the first time you call step() the frame is single, then you cannot call step() again with a uint8 frame, unless you release() the object.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!