Converting AVI to grayscale PNG for easier analysis/viewing

An example of a large pixel-count AVI is the Dahlgren et al 2013 article on auroral bursts. This was taken with a 2560×2160 Andor Neo sCMOS camera and this video has 351 frames.

You can try this process to keep in a more widely-compatible MJPEG motion JPEG AVI format, or alternatively you can convert each frame to PNG and use Irfanview or your favorite image browser to flick back and forth between frames. The conversion occurs using ImageMagick (which itself calls ffmpeg in this case).


convert -verbose CMOSvideoshorter_halfspeed.avi -type Grayscale CMOSvideo_%03d.png

in this example, 351 PNGs will be created of about 1MB size each.

Cinepak videos in ImageJ

If someone has sent you an AVI file with Cinepak compression, you may find that ImageJ/FIJI and other contemporary software cannot read the AVI file.

There are two plugins that attempt to address this for ImageJ:

http://rsb.info.nih.gov/ij/plugins/jmf-player.html

http://rsb.info.nih.gov/ij/plugins/jmf.html

But I found neither of them to work for me on the particular AVI Cinepak video I was given.

Instead, I used FFMPEG to convert to a more modern widely-compatible Motion JPEG format by typing:
ffmpeg -i video1990s.avi -vcodec mjpeg -qscale 1 test.avi

If you need no loss, you can do uncompressed AVI, but note the output file size could be a factor of 10 larger than the Cinepak version:

ffmpeg -i video1990s.avi -vcodec rawvideo out.avi

You can compress to LOSSLESS FFV1 by typing:

ffmpeg -i video1990s.avi -vcodec ffv1 out.avi

You can also convert the AVI to a series of PNG images.

AIDA tools

For those interested in working with data from ASK/ALIS or just seeing how some interesting 3D tomography works, there is a Matlab toolbox at:

https://aniara.irf.se/svn/AIDA_tools/trunk/

or using Subversion, type at Terminal:
svn co "https://aniara.irf.se/svn/AIDA_tools/trunk" AIDA_tools

Installation:
1) cp ~/AIDA_tools/AIDA_startup.m ~/matlabTools/
(or wherever you keep your frequently used scripts)
2) edit this ~/matlabTools/AIDA_startup.m file and make the following changes:
Line 3: AIDA_root = fullfile(‘~’);

then look farther down in the AIDA_startup.m file and add these “min” functions:

% Its version dependent functions, currently M 6.xx and M 7.xx
path(path,fullfile(AIDA_matlabdir,’Starcal’,[‘M’,num2str(min(M_ver,7))]))

% Its version dependent functions, currently M 6.xx and M 7.xx
path(path,fullfile(AIDA_matlabdir,’Spectral_cal’,[‘M’,num2str(min(M_ver,7))]))

3) I comment out the “warning off” on line 17 of AIDA_startup.m, I like to know Matlab is complaining.

ImageMagick suggested compile options

These options were used to compile ImageMagick 6.7.9-3 and 6.8.0-4.

Before compiling, I urge you to ensure libjasper-dev is installed, so that you can manipulate JPEG2000 images. Try typing:
sudo apt-get install libjasper-dev libpng-dev

Then, type:

./configure --with-modules --with-gslib --with-wmf --with-perl --with-rsvg --with-gvc

Note: you can add HDRI http://www.imagemagick.org/script/high-dynamic-range.php
by adding this option above:
--enable-hdri

Note: To see if those options actually work, scroll back up about halfway through the console output to see if the compiler could find the modules you’re interested in. Otherwise, you won’t actually have the requested features.

Then do the usual
make
make install

Note: if you get an error like:

libMagickCore.so.6: cannot open shared object file: No such file or directory
when trying to run ImageMagick, try:

whereis libMagickCore.so.6
assuming you find it in /usr/local/lib, type:
sudo ldconfig /usr/local/lib