Installing FFMPEG and FFPLAY on Windows

To install FFMPEG and FFPLAY on Windows (XP through 7) follow these steps:

1) download FFMPEG, get the 64-bit “shared” version.
2) unzip the folders inside to c:\ffmpeg
3) set your PATH to include c:\ffmpeg\bin

You can now use the powerful FFMPEG from the Windows Command Prompt.

Note: if you don’t already have 7zip installed on Windows, download 7zip

Playing Motion JPEG 2000 (.mj2) videos from Matlab

MATLAB can create and read lossy and lossless Motion JPEG 2000 videos on Windows and Linux. You can play back Motion JPEG 2000 files on Linux with “ffplay” as follows:

In Terminal, type
ffplay movie.mj2
where of course “movie.mj2″ is the .mj2 Motion JPEG 2000 video to be played.

from the Command Prompt, type c:\ffmpeg\bin\ffplay movie.mj2
(assuming you downloaded ffmpeg to c:\ffmpeg)

Rotate180CCW-checkerboard.mj2 (51kB)
is a sample Motion JPEG 2000 .mj2 video of a rotating greyscale checkerboard you can use to test your Motion JPEG 2000 player.

Note, if you get an errow about missing CODECs, you will need to update your ffmpeg to a version that included libopenjpeg. Thankfully for Ubuntu users, there is a PPA with the most recenter FFMPEG with MJ2 support:
sudo apt-add-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg

Then it should play for you. I have tested with FFMPEG version 0.10.7

MATLAB Linux AVI playback “only uncompressed AVI movies can be read on UNIX” error

MATLAB on Linux claims to only playback uncompressed AVI files on “UNIX” systems.

However, MATLAB on Linux can’t even play all uncompressed AVI filed depending on your particular system configuration with gstreamer. The solution thus far, with MATLAB 2012a, seems to be using Motion JPEG in AVI videos.

Here’s a tentative solution for playing back video on Linux systems with MATLAB 2012a, that is, MATLAB “should” be able to playback “out.avi”

ffmpeg -i input.avi -vcodec mjpeg -qscale 1 out.avi

If you get an error about not having ffmpeg installed, on Ubuntu type in Terminal:

sudo apt-get install ffmpeg

Here is a video I transcoded the first second of using the above settings

Star collapse video from

(here is the actual command I used to truncate the video to one second and to heavily compress to reduce download size)
ffmpeg -i input.avi -vcodec mjpeg -t 1 -qscale 11 out.avi
(The sample AVI file is used under GNU LGPL from )