← Back to team overview

yade-users team mailing list archive

Re: Video recording in preprocessor files

 

Hello Viet Tran,
if you actually have an .xml file with your simulation, the best thing to do is to use python scripting, to load the simulation and add what you need to make videos.

For example, if you launch ./YADE-0.50.1 from the terminal, you can type from the Yade prompt:
Yade [1]: O.load('yoursimulation.xml') #to load your simulation
Yade [2]: O.engines = O.engines + [qt.SnapshotEngine(iterPeriod=100,fileBase='./video-',label='snapshooter')] #to add the snapshot engine. This will save snapshots in .png format every 'iterPeriod' iterations (100 in this case).

Then push F10 to open the Controller and the 3DView, push the Play button and run as many iterations you need.
Stop the simulation when it is ok and again in the yade prompt type:

Yade [3]: utils.makeVideo('./*.png', 'video.avi', renameNotOverwrite=True, fps=6, kbps=6000, bps=None) #to create the video from the .png files

In general I recommend you to use python scripting to generate your simulations as long as you don't need to personalize the mechanics of your simulation with your own contact law for example!

HTH, Emanuele





On 08/26/2011 06:29 AM, Viet Tran wrote:

Hello,

I know it may not be a good question, but can someone help me with video recording? I'm using YADE-0.50.1 and I have written my own codes with a Preprocessor file and run the simulation by the created .xml file. I learn that we can create the videos of our simulations in Python, but I think we can also do it by writting some lines of code in the preprocessor file (ex: in the Triaxial test.cpp), my problem is that I do not know how to do it :((

I'm very appreciated if you can give me some guidance.

Thanks

Viet Tran


_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

--
Emanuele Catalano
Doctorant - Laboratoire Sol, Solides, Structures et Risques
Institut polytechnique de Grenoble

Tel : 04 56 52 86 49


Follow ups

References