Combining different videos with different frame rates in a single movie

Dear all,

I have a series of movies all acquired at different frame rates which I would like to combine side-by-side and play simultaneously in a single movie. The point of my exercise is to show the impact of sampling rate in my analysis, and hopefully helping my message come across through a side-by-side comparison.

In my videos I have the same underlying scene, which was acquired at high frame rate. By removing every other frame, I obtained a series of lower frame rate movies about the same scene. Since all movies now have effectively different frames, I am looking into ways of combining them in ImageJ, but in order to do that all videos need to have the same number of frames. Wondering if an interpolation step here would be required.

Currently I’ve exported them all to AVI and am thinking of using Shotcut to make a standard video edition. Do you guys have an suggestions for ImageJ?

Many thanks to everyone.

Best,
R.

Hello there nhjpires!,
Instead of removing every other frame, just blank them out. The effect should be the same.
Bob

Hi there smithrobertj,

Thanks for chipping in. For my purpose I don’t think I can blank out the “extra” frames. If anything, I think, I should freeze some frames, otherwise the movie will turn black for most frames. I am working at fairly low FPS, 64 is my maximum, and from there I go 32, 16, 8, 4, 2. I would like to be able to play them all, side-by-side, while respecting their individual frame rate so that the scene begins playing at the same time in all movies, and finishes at the same time in all movies too.

Any further ideas?

Best,
R.

Hello again,

O.K. now I better understand what it is you are trying to do. Very interesting, I’d like to see that myself but that’s going to take some thinking on. I’ll try to help if I can and good Luck.

Bob

If you removed every other frame, then the new subsampled sequence has half the frames and last for half the time.
If I understand correctly what you want, you could copy frame 1 into frame 2, frame 3 into frame 4, and so on. That way your sequence has the same number of frames as the original, but half the information (as every other frame is repeated).

1 Like

Cheers Gabriel!

Alright, so indeed it seems I have to freeze a frame across several frame positions, i was hoping this could be done is a more automatic way but I guess I will have to write a script for that…

Please leave a message if you have any more suggestions…

Best and thanks again Gabriel.

R.

Hi @rhjpires,

If I didn’t get this wrong, the lower frame rate videos are just (time) downsampled versions of the original
high-frame rate video:

By removing every other frame, I obtained a series of lower frame rate movies about the same scene

If so, a simple approach in the lines of @gabriel’s suggestion would be the following (not very efficient in terms of RAM):

  • Take the original video as a stack. If desired, remove last frame when the number of frames is odd.
  • Use the “Scale” comand (ctrl+e) to downsample in z (Z scale: 0.5, no interpolation, no average when downsizing)
  • Uses Scale again, to upsample in z (Z scale=2; no interpolation).
  • Delete the intermediate version

Now you have a downsampled version that can run alongside the original. You can even combine them side by side into a single stack.

As an example, using the sample MRI stack as a (prentended) video:

// Side-by-side downsampled video example

run("MRI Stack (528K)");

run("Scale...", "x=1.0 y=1.0 z=.5 width=186 height=226 depth=13 interpolation=None process create title=temp");
run("Scale...", "x=1.0 y=1.0 z=2 width=186 height=226 depth=26 interpolation=None process create title=downsampled");


selectWindow("temp");
close();
run("Combine...", "stack1=mri-stack.tif stack2=downsampled");

Cheers!

Nico

3 Likes

Hey @NicoDF,

Many thanks for the suggestion.
It does seem like a very interesting alternative.
I will give it a try and let you guys know if anything unusual comes up.

Best,
R.

Hi, in your case, Joyoshare Video Joiner can help you out. This tool features two merging modes. The high-speed mode is to combine multiple same videos into one without quality loss. And the customizable mode is to merge different videos without any hassle. It supports various output formats. You can save the merged video in any desired format.