<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><font size="2"><span style="font-size:10pt;">Hi all,<br>
<br>
I'm now working with a Leica stereomicroscope which produces AVI recordings (using the "Movie" functionality). These recordings cannot be read by the Bio-Formats (I've uploaded a sample recording using your QA platform), and, as a matter of fact, cannot be
read by many readers properly.<br>
<br>
Anyhow, I decided to convert it into a more standard AVI using FFMPEG using the following command:<br>
ffmpeg -y -i M-flow1.avi -qscale:v 1 -c:v mjpeg M-flow1_1.avi<br>
<br>
Which gives also the following information on the two video streams:<br>
Input #0, avi, from 'M-flow1.avi':<br>
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, <br>
bt470bg/unknown/unknown), 544x408, 8203 kb/s, 100 fps, 100 tbr, 100 tbn, <br>
100 tbc<br>
Output #0, avi, to 'M-flow1_1.avi':<br>
ISFT : Lavf56.25.101<br>
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc), <br>
544x408, q=2-31, 200 kb/s, 100 fps, 100 tbn, 100 tbc<br>
<br>
Now for the more interesting part. Turns out this file can be read nicely using the ImageJ plugin, however when I try to convert it into OME-TIFF using the command-line tools :<br>
./bfconvert -separate M-flow1_1.avi M-flow1_1.ome.tiff<br>
<br>
It crashes (String index out of bound). Turns out, 2 out of 3 frames are completely empty (i.e. not key frames I guess), which causes an issue in l. 438 of bioformats/components/formats-bsd/src/loci/formats/in/AVIReader.java :
<br>
String(plane, 6, 4, Constants.ENCODING).equals("AVI1") as plane is empty.<br>
<br>
After looking around a bit, I have noticed two things:<br>
1. If the test for M-JPEG is carried-over between frames, the empty <br>
frame will then cause another bug later on in the FileStitcher<br>
2. The conversion seems to work completely fine if the 0-length frame is skipped in l. 777 of AVIReader.java :<br>
if (size > 0 || bmpCompression != 0) {<br>
i.e. effectively removing the bmpCompression part of the test.<br>
<br>
However, I'm pretty sure that this test was there for a reason, and I clearly do not understand enough of JPEG compression to have a better insight on this topic.<br>
<br>
I'm working on a Mac OS X 10.10.2 with the latest Bio-Formats from the GitHub repository (from Tue Apr 21 09:49:45 2015 -0500) and the FFMPEG 2.6 build with Apple LLVM version 6.0.<br>
<br>
If you are interested, I can provide you with the aforementioned files.<br>
<br>
Cheers,<br>
Simon Blanchoud<br>
<br>
PS: this is not extremely important for me as I now convert instead the AVI to a sequence of TIFF files directly using FFMPEG, and then stitch them back together into an OME-TIFF using Bio-Formats. But I thought you might be interested in that wee bug !</span></font></div>
</body>
</html>