Saving a movie with low quality loss

fiji

#1

Hi all,

I have been attempting to save my movies using the input-output plugin. What I currently want to do is save my movies from imagej without losing much quality. Then I want to run these movies through a MATLAB script that both rotates all the frames and adds a scalebar and time to each frame.

My issue is I do not know much about the different video formats, and I have found online resources difficult to understand. For example, when I save my image with the container format .avi and the codec as H.264, I find that I am losing a significant number of frames. Another case is when I save my movie with container format .avi and the codec as MPEG4; Everything is fine except running it through my MATLAB script results in a movie only showing the bottom left portion of each frame.

I realize the second example may be more of a MATLAB issue so feel free to ignore it if it is outside the scope of this forum. Could anyone provide some advice as to what settings to use when saving my movies? Or perhaps there are ways within ImageJ for me to accomplish my image rotation and adding a scalebar and time, so that I do not have to worry about how MATLAB will handle the movies.

Thank you in advance for any help!


#2

Hello,

You certainly can achieve what you are aiming for in Fiji alone. If you are ever wondering what functionality is available the search bar in Fiji is your best friend. Playing around a bit I found the following.

  1. Rotating an Image: This could be accomplished using a number of commands available under Image > Transform. There are commands for rotating by 90 degrees, flipping, and rotating by an arbitrary amount. These all seem to apply to the entire time series or stack nicely.
  2. Adding a Scalebar: There is a command for this as well. It is located under Analyze > Tools > Scale bar… and can be applied to all time points by ensuring the “Label all slices” checkbox is ticked.
  3. Adding a Time Stamp: I found this one just a couple weeks ago! Image › Stacks › Time Stamper will get you the time stamped onto each frame of a video.
  4. Exporting the Video: Uncompressed AVI is supported as an export if that meets and may meet your requirements.

Of course, you will likely want to make this into a macro or script for applying to multiple datasets. The easiest way to do that is with the macro recorder, the online guide and macro function documentation. You can also use one of the many supported scripting languages to accomplish this.

I hope this is helpful!

Cheers,
Andy

:microscope: :computer: :coffee: