- From: Jess Tate <jess@sci.utah.edu>
- To: Peter Johnston <p.johnston@griffith.edu.au>
- Cc: <scirun-users@sci.utah.edu>
- Subject: Re: [SCIRUN-USERS] Making movies in scirun
- Date: Fri, 13 Jun 2014 14:12:22 -0600
Hi Peter,
There are a few ways to make a movie with scirun. the simplest way is to use a movie capture software like iShowu (which is what I have used), but that of course requires often expensive software. The other ways also require some external software to stitch together a series of images, but there are some free versions such as ffmpeg that can do it.
The script method can work, though it is a little tricky to get it to work for making movies. The script options in the ReadMatrix module (and other Read modules) is there so that you can specify the file to read in the command line. Here is an example in bash scripting:
file=($(ls -1 *.mat))
[path to scirun]/scirun [network file] -E +FILE=$f -I [name of image to save out]
You would put 'FILE' in the input field of the script tab in ReadMatirx. The -I flag prints the image from the viewscenes that are open and the -E flag runs the network and closes when it is done each time. This can work, but the tricky part is that the scene and everything must be set up before you run the script and in can be tricky to set everything properly. You may also need to use the string manipulation modules in scirun to make the data load (and save) correctly. Another way to pass a filename into a newtwork through scripting is to set an environment variable such as: export FILE='filename'. then use InsertEnvironmentIntoBundle then GetStringsFromBundle and pass the filename as a string input into the ReadMatrix module.
The other way to save out a series of images to stitch together images into a movie is to use the 'Record Movie' option in the viewscene viewer window (under the file menu). The advantage of this method is that it will take an image every time the image changes so that you can make a movie of the mesh moving in space, turning off surfaces, changing the values, or other manipulations that you want. For this method it is best to save your potential data as a single matrix, where each column or row represents the potential map at a single time point. If the data is save as one matrix, you can use GetColumnOrRowFromMatrix to step through each of the time steps and display it. this module will loop through every time step if you want, just make sure that you set the step delay for the module to something high enough that all the modules can execute to avoid overwhelming the system, so that you can show the potential field changing overtime and move the mesh. This feature can be a bit tricky to use as it can easily print images you don't need and in the wrong place, but with care it is quite useful.
This is the ffmpeg call that I sometimes use to stitch the images into a movie:
ffmpeg -r 12 -i filename.%04d.png -sameq -r 12 -f mov filename.mov
cheers,
Jess
Hi All,
I just noticed on the "readmatrix" module that there is an option for a script. When I click on the script tab the instruction says to "initialise filename with environment variable:" Could someone please explain what that means? It is not mentioned on the wiki documentation page for readmatrix.
My question really relates to reading in multiple (about 1000) data files (simply containing potentials) to display on the one mesh (as read by a readfield module) in order to make a movie. Will the script option on readmatrix help with this or is there some better way of doing it? This of course raises the question of how to turn this into a movie. Any advice would be appreciated on that topic as well.
Thanks very much,
Peter.
-------------------------------------------------------------------------
Assoc. Prof. Peter Johnston
Associate Professor in Applied Mathematics Phone (07) 3735 7748
School of Biomolecular and Physical Science Fax (07) 3735 7773
Griffith University
Nathan
Queensland 4111
AUSTRALIA
Archive powered by MHonArc 2.6.18.