Page 1 of 1

enabling video recording from a child script or command line

Posted: 03 Jul 2014, 17:29
by narco
I am trying to automate running of multiple simulation through command line and wish to record the output as video for viewing later on. Please guide on how to achieve this ?
1) Can the video recording be enabled through command line or a child script?
2) Also, is it possible to record the video output in headless mode ?

Re: enabling video recording from a child script or command

Posted: 04 Jul 2014, 11:42
by coppelia
Hello,

you can start the video recorder programmatically (or at least enable it) with simSetBooleanParameter(sim_boolparam_video_recording_triggered,1). However, you have some restrictions:
  • you cannot be in headless mode.
  • the simulation should NOT be running when calling above function. When you start simulation, recording will begin.
  • the recording will automatically stop if simulation ends.
What that means is that you cannot call above function from the main script or from a child script, because simulation would in that case already be running. But you can call above function from an add-on, or from a plugin.

Cheers

Re: enabling video recording from a child script or command

Posted: 03 Aug 2014, 02:31
by narco
Hi Coppelia,
I tried the mentioned command " simSetBooleanParameter(sim_boolparam_video_recording_triggered,1)"
in vrepAddOnScript_XXX.lua and ensured it runs on simulation start through "-axxx" command line option but it doesn't work.
Infact the video recording is enabled only for the next simulation run.

Following is the add on script code:
if(execMode == 0) then
simSetBooleanParameter(sim_boolparam_video_recording_triggered,1)
end

Could you suggest where am I mistaken or an alternative.

Observations:
The sim_boolparam_video_recording_triggered variable can only be set once Simulation state is STOP (sim_simulation_stopped)
and can't be set in sim_simulation_advancing_firstafterstop. But when the Add-On script is executed the state is "Advacning_firstafterstop", so the add-on script approach doesn't work. (I could be wrong.)


Thank you.
coppelia wrote:Hello,

you can start the video recorder programmatically (or at least enable it) with simSetBooleanParameter(sim_boolparam_video_recording_triggered,1). However, you have some restrictions:
  • you cannot be in headless mode.
  • the simulation should NOT be running when calling above function. When you start simulation, recording will begin.
  • the recording will automatically stop if simulation ends.
What that means is that you cannot call above function from the main script or from a child script, because simulation would in that case already be running. But you can call above function from an add-on, or from a plugin.

Cheers

Re: enabling video recording from a child script or command

Posted: 03 Aug 2014, 19:29
by coppelia
This means that your simulation is already running. How do you start the simulation? In your case, do not start simulation via the command line, but let your add-on script start the simulation with simStartSimulation (but before that, set the flag for video recording).

Cheers

Re: enabling video recording from a child script or command

Posted: 29 Oct 2015, 00:38
by tor
Hi All:

Has anyone eventually written a working add-on or plugin for this?
If so, could you please share it here?
I do appreciate it.

Thank you.

Re: enabling video recording from a child script or command line

Posted: 02 Mar 2018, 21:01
by Justus
I'm also looking for a way to start the video recorder by script, after a set amount of time after the simulation has started.
Can't get it to work using the method above, maybe somebody has a solution?

Re: enabling video recording from a child script or command line

Posted: 05 Mar 2018, 07:17
by coppelia
Unfortunately there is no solution for that currently...

Cheers