FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Screenshots, videos and camera control

This page covers practical ways to capture visual output when running FhVis.

1) Capture screenshots from visualization

Add a camera-shot SimObject to your XML and run with FhVis:

<Lib LibName="base"
SimObject="CameraShot"
Name="Camera1"
Time="15"
FrameRate="6"
Filename="shot.jpg"/>

If no extension is provided, .jpg is used by default. You can also use formats such as .png or .tif.

2) Record image sequences and encode video

To export frames for video encoding:

<Lib LibName="base"
SimObject="CameraShot"
Name="Camera1"
Time="15"
Video="1"
Stop="100"
Filename="video1.tif"
FrameRate="24"
Refinement="1"/>

Then encode with ffmpeg:

ffmpeg -i img%d.png -r 30 -c:v libx264 -crf 20 video.avi

Tips:

  • Lower crf gives better quality and larger files.
  • For presentation software compatibility, you may need bitrate-based encoding:
ffmpeg -i img%d.png -r 30 -b:v 4096k video.avi

3) Script camera motion with CameraTrajectoryPlayer

You can define camera waypoints (time,x,y,z,roll,pitch,yaw):

<OBJECTS>
<Lib LibName="base"
SimObject="CameraTrajectoryPlayer"
Name="CTP1"
Type="SplinePosAngle"
NumNodes="3"/>
</OBJECTS>
<INTERCONNECTIONS>
<Connection
CTP1.Node1="5,0,0,0,0,0,0"
CTP1.Node2="15,-50,0,50,0.1,-0.1,0.2"
CTP1.Node3="30,-100,0,80,0.2,-0.1,0.2"/>
</INTERCONNECTIONS>
Note
Keep NumNodes synchronized with the number of NodeN entries.