MATLAB: How to log image frames to disk with a 12-bit camera

Image Acquisition Toolbox

I am trying to log an avi file on disk using the following commands:
logfile = avifile('hello.avi)
logfile.Colormap = gray(256);
but I receive the following errors:
??? Error using ==> avifile.set>setColormap
Colormap must no more than 256 entries.
Error in ==> avifile.set at 43
obj = feval(paramSetFcns{match},obj,values{i});
Error in ==> avifile.subsasgn at 14
obj = set(obj,param,value);

Best Answer

This enhancement has been incorporated in Release 2011a (R2011a). For previous product releases, read below for any possible workarounds:
The ability to log 12-bit video feeds from the Image Acquisition Toolbox to an AVI file on disk is not possible.
The workaround is to log the frames to memory and then write to disk using IMWRITE.