Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Typically: "How do I... ", "How can I... " questions
Post Reply
RobAtLab
Posts: 92
Joined: 10 Jan 2018, 17:49

Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Post by RobAtLab »

Is it possible to tick the "Launch at next simulation start" video recorder option, close V-REP then open that file again and have it strart recording. Especially in circumstances where one saves the file, but then launches future sims using the command line:
./vrep.sh -g100 ~/V-REP_PRO_EDU_V3_5_0_Linux/scenes/Make_a_vid_of_this.ttt -s600000 -q

I've tried and it has failed, but I'm not sure if there is another way. I have tried both in cirumctances where one saves a file where the tickbox has been ticked, then closes v-rep, then reopens v-rep with ./vrep.sh, opens the relevant .tt file in v-=rep and hits play (no recording happens). Ands I've tried in circumstances where afetr dsaving the file with that option ticked one closes v-rep, then opens it in such a way as to immediately run that file, using a command line commaned like the one above (again no recording occurs). Is there another way which would work? Could I have a script running on an object which turns on video recording during the init function?

My hope here is to be able to take videos of a bunch of bulk simulations which will be triggered from the command line (with no GUI interaction except before they were saved), so once they've all run I can watch them back and see what took place as well as logging information out to text files as I am already doing.

Is there a way to do this?
Thank You

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Post by coppelia »

Hello,

I think this is not possible. A probably better way would be to record the animation via the GLTF plugin.

Cheers

RobAtLab
Posts: 92
Joined: 10 Jan 2018, 17:49

Re: Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Post by RobAtLab »

Is there an example of this plugin being used that I can look at, also is installation necessary, in which case where can it be downloaded from and where are installation instructions. Thank you

P.S. I've just read up a bit on GLTF, it descriebs itslef as the "jpeg of 3D", sounds a bit excessive and for the length of simulations, and amount of physical detail in mine, I fear the file sizes would be enormous. I'm just after getting plain 2D video from a static vantage point throughout the whole run of the sim.

fferri
Posts: 1217
Joined: 09 Sep 2013, 19:28

Re: Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Post by fferri »

Do not look at the API of the GLTF plugin.

What you normally need is the GLTF export add-ons (included in the GLTF plugin):
  • an add-on function to export a static GLTF scene (no animation)
  • an add-on script, that when enabled will record the next simulation and export it as a GLTF file with animation tracks
On the contrary, such format requires way less storage than video: the mesh data is stored only once per object, and for every object only 6 values per simulation frame (~24 bytes) are required to describe the pose.

Installation instructions are the usual cmake + make install steps

RobAtLab
Posts: 92
Joined: 10 Jan 2018, 17:49

Re: Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Post by RobAtLab »

How would I then get a video representation of that GLTF data which I could share? Are there examples to be found of the procedure you discuss?

P.S. this is only in the latest version of coppeliaSim? I assume it will still be able to run simulations made in V-REP3.5 just fine?

I am still surprised that video recording can't be staretd from script. It is so easy to do from the GUI, you'd think there would be a way to set it to run automatically when a simulation is started after closing and re-opening v-rep.

fferri
Posts: 1217
Joined: 09 Sep 2013, 19:28

Re: Programmatic access to video recoring functions? And saving a file so it records video when next opened?

Post by fferri »

RobAtLab wrote: 19 Oct 2020, 18:42 How would I then get a video representation of that GLTF data which I could share?
GLTF is an open format.
It can be imported into many applications (e.g. Blender). There are also many web players (this, this...). So you can think of sharing the .gltf file itself.
RobAtLab wrote: 19 Oct 2020, 18:42 P.S. this is only in the latest version of coppeliaSim? I assume it will still be able to run simulations made in V-REP3.5 just fine?
The plugin requires a recent version of CoppeliaSim.
I guess 3.5 is too old.

Post Reply