Get the size of each compressed mj2 frame

1 view (last 30 days)
Michael
Michael on 22 Dec 2014
Edited: Geoff Hayes on 22 Dec 2014
I used the VideoReader Class to read a Motion JPEG2000 mj2 file and was able to play it using the example in the documentation. But what I need is the size of each compressed frame in bytes. The object created from VideoReader is decompressed.
obj = VideoReader('j2kvid.mj2');
vidWidth = cr10Obj.Width;
vidHeight = cr10Obj.Height;
mov = struct('cdata',zeros(vidWidth,vidHeight,3,'uint8'),'colormap',[]);
k = 1;
while hasFrame(obj)
mov(k).cdata = readFrame(obj);
k = k+1;
end
I just want an array with each element being the size of each compressed frame. Anyone one have an idea how I can do this?
Mike

Answers (0)

Community Treasure Hunt

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

Start Hunting!