Importing avi files

I am trying to import an AVI file into fiji. The default is to import a 4fps, although my AVI file has 20FPS. How could I change that default?

Click the little play arrow while pressing Ctrl or Alt, or with the right mouse button. It will pop a dialog titled “Animation Options.” Alternately, you can find it under Image :arrow_forward: Stacks :arrow_forward: Animation :arrow_forward: Animation Options…

1 Like

I tried that, but it only changes the way in which imagej runs the stack and not the way in which it reads the avi file. You can change the animation option only after your read the file, and at that point it won’t read any more images into the stack.

Ah, I see. So your concern is not actually with the FPS of the movie (which is really cosmetic metadata), but actually with the number of frames which are being read?

In that case, it may be a problem with ImageJ’s AVI support.

Is your AVI file more than 2 GB in size?

Did you try importing using the File :arrow_forward: Import :arrow_forward: Bio-Formats command instead of File :arrow_forward: Open…?

Most of my files are above 2GB, but I tried to use smaller files and I got the same problem. Using the import bio-formats failed to open my stack.

Any other ideas?
Thanks

Are you using the latest version of ImageJ (1.50g)? It has improved AVI support, especially for files larger than 2GB.

I didn’t (I had 1.49), but I have just updated it to 1.50g, and I still have the same problem.
To give some more details: when using the import avi, the software thinks that there are 141546 frames (which is 80FPS, and more than the 24FPS i thought there is in the file).
However, when I ask to look at them all it opens a stack of only 5740 images.

With smaller files (16 MG) I get the same problem. It recognize 699 images, but opens only a stack of only 29.

@uriho Can you post the problematic 16 MB file somewhere? It would be helpful for analyzing the issue.

Sure

Thanks!

1 Like

Thanks! Sorry to say that I am going on vacation for the next week, but hopefully someone here has time to take a look at it. Or if not, I’ll investigate when I can.

I’ve downloaded your avi-test sequence and in fact the ImageJ default avi-reader tells us that the sequence consists of 699 frames. However, I’m pretty sure that the sequence contains only 29 frames,* i.e. there might be a problem with the metadata of your avi.

  • The reason is that your avi-test sequence uses motiion JPEG compression. A single JPEG compressed RGB-frame of the sequence is about 580kB in size. With the avi-test sequence measuring 16.9MB this gives 29 frames.

HTH

Herbie

When I used File :arrow_forward: Import :arrow_forward: Bio-Formats to open the same image you posted, it did open 699 frames with 3 channels each. (As an aside: since this movie appears largely static, it is difficult to determine whether Bio-Formats read all the frames correctly… but it seems plausible.)

The problem with only 29 frames being opened seems to be specific to the File :arrow_forward: Import :arrow_forward: AVI… command (which is also called by File :arrow_forward: Open…).

Good day Curtis,

I can confirm your finding but:

When extracting a single TIFF-frame from the File > Import > AVI import I get a 12MB RGB-image with dimensions 2048x1536 (appears to be the correct aspect ratio).

When extracting a single TIFF-plane from the File > Import > Bio-Formats import I get a 1.5MB 8bit-image with dimensions 2048x768 (appears to be the wrong aspect ratio).

Somehow strange

Herbie

Indeed.

Unfortunate—it seems that every import scheme has some issue. Multiple different bugs here.

@uriho As a workaround, you could convert your video using e.g. QuickTime Player or VLC or VirtualDub before importing it. Not ideal, I know, but might avoid these problems.

As a workaround, you could convert your video using e.g. QuickTime Player

When converted by QuickTime Player to the QuickTime “.mov”-format, the sequence opens correctly with 699 RGB-frames of dimensions 2048x1536. ImageJ indicates that the total sequence size is 8.2GB. Of course, the 32bit version of ImageJ is required to open the QuickTime movie.

HTH

Herbie

If you enable the FFMPEG update site, you can use File :arrow_forward: Import :arrow_forward: Movie (FFMPEG)… to read in the converted MOV file. It reads all 699 frames at 2048x1536, although some frames have some odd black stripes. That same FFMPEG plugin can also read AVIs, but it suffers from the same problem of reading only 29 frames.

Curtis,

just to make it clear:
My replies were meant for the original poster, because it’s not me who has problems with avi-movies and ImageJ.

But, since posting his test movie, the original poster didn’t comment on the issue anymore.

Happy holidays

Herbie

Understood, Herbie. I was replying back as I learned more information and tried different things, to create a public record of what might work to address the shortcomings in ImageJ here. In an ideal world, I would fix the bug(s) here, and/or offer a comprehensive video import solution (e.g., complete the half-finished scifio-javacv project), but unfortunately, that is unlikely in the short term. So I just wanted to document, of the currently available solutions I know about, whether and how each one behaves with this dataset.

1 Like

Dear Herbie and Curtis,
Thanks for all the help! I guess the metadata “confuses” image J. I think that the original file really had 4.1 fps.

In case you are wondering, the file was generated by the Leica LAS microscopes software.