Login  Register

Re: SOLVED : how to encode an.avi readable by ImageJ

Posted by Michael Schmid on Feb 18, 2010; 9:27am
URL: http://imagej.273.s1.nabble.com/how-to-encode-an-avi-readable-by-ImageJ-tp3689341p3689344.html

Hi Yann,

up to now I got no other mail saying that video files without Huffman  
tables  would be a problem, so I think it is not worthwhile adding  
this to ImageJ. After all, one of the big advantages of ImageJ is its  
small size, which makes it start very quickly. Thus, and also to keep  
the code readable, there is some consensus in the ImageJ community  
not to add code that would be rarely used.

When converting to Quicktime, make sure that there are no bad  
compression artifacts! To avoid compression artifacts, usually it  
would be preferable to  convert it into an uncompressed or mildly  
compressed format like YUY2, but this creates very large files that  
may exceed the maximum size of AVI1 of 2GB (ImageJ can't read AVI2  
aka OpenDML, but if I remember correctly there was a post on this  
mailing list some time ago on a plugin capable of reading AVI2).

On Windows, you could also have a look at AviSynth - it has the  
possibility to read video files of quite a few formats. You cannot  
feed AviSync directly as an input into ImageJ, but you would again  
have to use VirtualDub for writing the converted file. In VirtualDub,  
instead of the .avi file you have to open the AviSynt Script (.avs);  
the .avs file opens the avi file. AviSynth can convert to e.g. RGB24  
or YUY2 format readable by ImageJ (use ConvertToRGB24 or  
ConvertToYUY2 in your AviSynth script).
Of course, this does not solve the problem of the 2 GB file size  
limit of AVI1 after conversion.


Michael
________________________________________________________________

On 18 Feb 2010, at 08:43, Yann BOURSIAC wrote:

> Hi all,
> I finally got my problem solved, but not exactly what I wanted.
>
> The procedure that works for me is to encode the video files into  
> a .mov file and using the quicktime plugin. The  file can then be  
> open with ImageJ, although it's taking quite a while for big files  
> on my computer.
>
> Yann
>
> Michael Schmid a écrit :
>> Hi Everyone,
>>
>> is the problem of "missing Huffman tables" a frequent one?
>>
>> If there are many reports about such problems it might be  
>> worthwhile to add code to fix this problem, but I don't know  
>> common JPEG-encoded .AVI files (aka M-JPEG encoded) without  
>> Huffman tables are. In principle, such a fix would be possible (it  
>> would not help to read MPEG-encoded files, however; MPEG is a  
>> rather complex encoding).
>>
>> For those interested in details: (M-)JPEG encoded video files do  
>> not need to supply Huffman tables in the individual frames, but  
>> many (M-)JPEG-encoded video files include them nonetheless.  
>> Currently ImageJ can only decode those (M-)JPEG-encoded video  
>> files that include Huffman tables.
>>
>>
>> Michael
>> ________________________________________________________________
>>
>> On 5 Feb 2010, at 17:23, Yann BOURSIAC wrote:
>>
>>> Hi all,
>>>
>>> ImageJ has the possibility to open .avi files. However, when I  
>>> try, I get the error message "cannot open video files missing  
>>> Huffman tables".
>>> So my question is: how can I encode my files (coming from a DVD  
>>> recorder) into an avi that will be readable by ImageJ?
>>> I tried some codecs from VLC or virtualdub but never succeeded.
>>>
>>> Alternatively, the final aim is to measure the diameter of a  
>>> round cell along time. Our setup include a microscope camera  
>>> linked to a DVD recorder. I would like to use an equivalent of  
>>> the ruler tool from ImageJ. Do you know any possibility or any  
>>> other alternative?
>>>
>>> Thank You
>>>
>>> Yann
>>