# Import a jpeg file and a mov file and display them side by side

I am planning to use Mathematica for a presentation. In one of the slides I need to place a jpeg file side by side to a mov file.

Row[{ImageResize[Import["compressor.jpeg"], 1500], Import["kiwi.mov","Animation"]}]


There is a huge difference in size between the jpeg figure and the mov file. I could click on the jpeg file and change its size but the outcome is not nice (too big for showing in just one slide).

Is there a set of options (commands or a complete different solution) that I can use to have both jpeg and mov dimensions set to a specific size? I could not figure out how to change the size of the Animation frame. I can click and change the size of the movie itself but not the size of the frame.

Many thanks.

• The documentation mentions that Animate takes the same options as Manipulate; among those there is a ContentSize option that you could use to change the size of the contents of your Animate pane. – MarcoB May 23 '15 at 20:03
• @MarcoB. Many thanks but I am not sure how to set ContentSize within Import. Import takes only 2 parameters. – Ed Mendes May 23 '15 at 20:14

You could import each frame of your movie as a separate image, then use ListAnimate on this list to generate an animation on which you would then have full control.

I am going to generate a static image and a test movie to play with:

staticimage = Rasterize@Plot[Sin[x], {x, -Pi, Pi}, AspectRatio -> 1, ImageSize -> Medium];
Table[Rasterize@Plot[Sin[i x], {x, -Pi, Pi}, AspectRatio -> 1], {i, 1, 5, 0.5}];
Export["test.mov", %]


Now I use Import to obtain a list of frames from the test movie. You already know how to import the image you need, so I will just assume that the image has been stored in staticimage for the purposes of this toy example. I then set the dimensions of the ListAnimate output to those of the static image.

GraphicsRow[{
staticimage,
ListAnimate[
Import["test.mov", "ImageList"],
ImageSize -> ImageDimensions[staticimage]
]
}]


ListAnimate gives you a lot of control over the resulting animation: you can set the framerate, the duration, whether it will continue indefinitely, etc. It is worth your time to take a look at its documentation.

• Unfortunately it did not work with the mov file I have. ListAnimate works separately but not with the static image. – Ed Mendes May 23 '15 at 23:00
• @EdMendes what exactly went wrong? – MarcoB May 23 '15 at 23:01
• I can see the image and a box with a black strip on it. No animation though. The movie is there but it has not been resized so that is the reason I can only see a very tiny strip of it. – Ed Mendes May 23 '15 at 23:08
• @EdMendes Do you know the absolute sizes of the image and movie? I'd like to see if I can reproduce the problem on this end with the toy example I have already in place. – MarcoB May 23 '15 at 23:43
• Unfortunately not. Would Import with imageSize do? If so, sizes are: {1280, 960} for the picture and {588, 632} for the movie. Many thanks. – Ed Mendes May 24 '15 at 1:38