Video recording does not work properly


I am trying to record video of my simulation but it does not record properly. I am using Python API and I connect to Simulink using TCP/IP. The connection is made and it works but the screen is black and you cannot see anything. You can see a little of the coordinate system at the top left corner but rest of the screen where recording is done, is black. When you click stop recording and finish, then a non playable corrupt file is being generated.

If you stop the connection from Simulink side so then the simulation screen appears and the video starts recording (as the seconds counter starts). But thats of no use, because its not connected. Does anyone have this problem?
I am writing it here because the support form response is too slow and I need immediate help with some things (apart from this). Thank you.

Does the screen go black when you run the simulation without recording video?

Did you try recording with a simulation mode of Real Time?

Are you doing any camera movements during simulation?

Does the screen go black when you run the simulation without recording video?

Did you try recording with a simulation mode of Real Time?
YES same result, black screen

Are you doing any camera movements during simulation?
YES and NO, no effect in both cases



In Simulink, is the simulation running the same time as the simulation in VC? If yes, then what update rate are using and is it bi-directional?

Have you tested with running Simulink in step-through mode?

Is the state of connection dependent on if simulation is running? For example, are you establishing the connection in OnRun() event?

Sorry for the questions. My first guess would be that the there is an issue with the rendering service and compression done for video while the simulation is running.

If you do not want to waste time, use external tool to record the video until the support ticket is resolved.

In Simulink the time T is faster than the SimTime of the Simulation
The Simulation simtime is something like in 0.0001234
and when the connection to Simulink stops, then the timer on top continues faster by completing 1st second and counting faster furtherly

Step through mode ???

Yes its under OnRun() event

The problem is the whole simulation takes like 20 minutes
and if I use the external screengrabber
It becomes bigger than 4gb in like 3 minutes
So it is also not practical

The simulation is too slow probably because of the several ray cast sensors used

Sorry, my friend, I cannot help you.

Step through is available in Simulink. Sorry, I’ve never used Simulink; more familiar with stepping in LabView to troubleshoot issues.

Establishing a socket connection during the simulation in a Python Script might be something others are more familiar with. It might be as simple as adding some delay() statements in the script.

If your screengrabber is doing that then what are your settings: 4K at 60fps? I record QHD at 30fps with Camtasia recorder and only ever get into 1GB territory when the video is over 40min. And if you need to record parts of the simulation, the Warm Up simulation setting is useful to quickly get to the needed state.

If you want, let us see the log file or snippet from them that explains what happens when you start the simulation and the viewport goes dark.

C:\Users%username%\AppData\Local\Visual Components\Visual Components Premium 4.1\Logs

OK thanks for the help :slight_smile:
I got the proper settings for external screen grabber.
Step through I misunderstood for something else.
I will look into the logfile myself now.

The basic problem I am facing is the slow simulation speed due to the several raycast sensors used.
I solved the video making process by using an external grabber.

How do you connect to simulink?