Play Motion JPEG 2000 (.mj2) lossless video

Related: Python Matplotlib lossless video creation


Matlab can create lossless videos from image or plot/figure series from Matlab by EITHER:

Play .mj2

After installing FFmpeg, play lossless Motion JPEG 2000 videos:

ffplay movie.mj2

Example

This example saves lossless MJPEG2000 .mj2 video plots from Matlab.

v = VideoWriter('test.mj2','Motion JPEG 2000');
v.LosslessCompression = true; 
v.FrameRate=5;
open(v)
f=figure; 

pause(0.2) % let plot wake up
for i=1:.05:3;
    line(0:.01:1,(0:.01:1).^i) % just an example
    im = getframe(f);
    writeVideo(v,im)
end
close(v)

Notes

Motion JPEG 2000 is currently the only lossless compressed format available from Matlab.

Categories:

Updated:

Leave a Comment