Generating Ultra High-Res Diagrams and Extracting Single and Multiple Frames from Animations

Extracting Single Frames

Let’s suppose you want to import a scale diagram you created with Virtual CRASH into your report or your slide presentation. In this case, you of course want to render your scene either in direct light or skylight mode. If you’re not familiar with what “rendering” means, see Chapter 5 of the User’s Guide. Let’s now suppose you have a small screen size – perhaps you’re using your laptop. In such a case, you’ll notice when you render and export your image, the image size will be determined by your display.

When you zoom in on your image, you will probably see some pixelization, which is typically undesirable if you’re trying to embed your image into a report or slide presentation.

One tactic to counteract this issue is to use the animation renderer, as if you are creating a video of your crash sequence. Set “use time range” min and max settings equal to the moment in time for which you wish to export your diagram. Set your size to the desired image size. Here we’re using 4K. Set the supersamples parameter to 64x for best quality. Finally, set the codec to Full Frames. Press “create” and wait for the avi file to finish. The avi file will have one single frame.

Next, download ffmpeg. The free application ffmpeg is discussed in this Blog post. If you haven’t read this post already, go ahead and read it before proceeding.

Next, go to the folder containing your avi file and ffmpeg. Type:

ffmpeg -i myFileName.avi myFileName_out.png

That’s it. Now you should have a high resolution png file of your scene.

Now, when we zoom in, we see much better image quality:

Extracting Single Frames

Let’s now suppose you have a nicely rendered video sequence from which you want to extract all the frames. Simply type:

ffmpeg -i myAnimationFile.avi myFrames-%03d.png

Now you’ll see all the frames dumped into the folder.