Real time video

Requests or suggestions for new features
Post Reply
geerten
Posts: 77
Joined: 14 Feb 2013, 13:57

Real time video

Post by geerten »

Hi,

I would like the videos that are recorded to be in real time. I have problems figuring out how to get this right. Because with the dt for the simulation I influence the amount of frames that is rendered. However, the amount of frames can also be influenced. I would like a video that is in real time, and than set the amount of fps I want. So if a video is recorded, the dt for the simulation is calculated based on the frames per second for the video.

Thanks.

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

Re: Real time video

Post by coppelia »

Hello,

I am not sure which "real-time" you mean:

1) Record a video that will visualize a simulation in real-time (i.e. if simulation time is x seconds, then video time is x seconds)

2) Record a video that will visualize the exact same thing that the user sees (i.e. user sees the robot perform a task in 2 seconds, then the video shows the task performed in 2 seconds)

The two above items are different.

Item 1) is quite easy, and is by default enabled: simulation time step is 50ms, and the video records 20 fps. After each simulation step, one frame is displayed and recorded (when default settings are kept). This is independent whether the "real-time simulation mode" is enable or not.

Item 2) is much more difficult to synchronize, since we cannot foresee how long one simulation step will take (e.g. when many objects are close by, simulation time takes longer). In V-REP, the recorder runs in the same thread as the simulation or visualizer, so it is almost impossible. The option you have here is to use an external recording tool (e.g. Camstudio)

Cheers

geerten
Posts: 77
Joined: 14 Feb 2013, 13:57

Re: Real time video

Post by geerten »

Hello,

Thanks for your response. I am talking about the first option of real time. But when I change the simulation time step, I have to manually calculate the amount of fps I need for the video (with a max of 30 fps). It would be handy if this would be an option to automatically calculate the fps based on the simulation time step that was set (and than not be able to change the speed of the simulation during simulation!).

In my opinion it's just a little thing, but makes life also a little easier :)

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

Re: Real time video

Post by coppelia »

Hello again,

Yes, indeed, that wouold be useful. We'll try to add this for next release (V3.0.2). But we'll still keep the option for the user to click the "accelerate"/"slowdown" simulation toolbar button.

Cheers

geerten
Posts: 77
Joined: 14 Feb 2013, 13:57

Re: Real time video

Post by geerten »

Ok. Thanks!

jppb

Re: Real time video

Post by jppb »

Hi I have a related question but I'm hoping might have a solution because of some caveats in my situation. I am driving a simulation by stepping through a matrix of positions and setting a JACO arm to those positions directly. I know that each row of the matrix corresponds to a 20ms timestep. I am hardly "simulating" at all, really just replaying actions. I am manually waiting 20ms in a child script before moving on to the next matrix row, and VREP accomplishes this pace without significant problems. However, if I start recording this with the built-in video recorder VREP has a bit of trouble making the timestep and the resulting video's time scaling is completely off, even if I set a frame rate consistent with my timestep. However, if I record the whole desktop using third-party software the timing issue go away but the quality is not optimal. Is there any way to programmatically generate a frame at every timestep? Or for that matter, is there any other solutions to this problem that spring to mind? I don't even really care what the scene looks like during the simulation, as long as it results in a new frame and new posture being achieved every 20ms in the resulting video.
Thanks,
jppb

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

Re: Real time video

Post by coppelia »

Hello,

maybe the best is to play with the simulation settings, mainly with items time step and simulation passes per frame (ppf). In your child script you do not need to wait real 20ms, you can simply pretend that each displayed frame is 20ms later, giving you a video frame rate of 50 fps.

Cheers

Post Reply