Export AIS_Animation to video file

Hello everyone,

I am creating animations in a MFC based application using opencascade. Is there any way to export it to a video file like MP4 ?

Thanks,
Prajwal

gkv311 n's picture

The code of vanimation command in src/ViewerTest/ViewerTest_ViewerCommands.cxx might be useful to see how Image_VideoRecorder class could be used (considering that OCCT was built with FFmpeg dependency enabled).

Prajwal Shelar's picture

Thanks, I'll try it.

rahulmulik9's picture

When exporting videos at 4K 60 FPS or 4K 30 FPS, the first 8–9 frames are high quality, but after that, the quality drops, and frames become pixelated. The maximum stable frame rate I achieve is 6 FPS, causing the video to appear choppy.
Attached zip file for reference.
Referance :
src/ViewerTest/ViewerTest_ViewerCommands.cxx

Attachments: 
gkv311 n's picture

rahulmulik9 wrote:

When exporting videos at 4K 60 FPS or 4K 30 FPS, the first 8–9 frames are high quality, but after that, the quality drops, and frames become pixelated. The maximum stable frame rate I achieve is 6 FPS, causing the video to appear choppy.

Mpeg4 codec doesn't suit well for 4K resolution (at least with default parameters - probably they should be adjusted somehow to improve quality).

I may propose using another codec like mjpeg (and reconvert result video file using external tools), or vp9 (with .mkv container), or h264 (but for the latter you need using FFmpeg built with this codec enabled):

pload MODELING VISUALIZATION
box b 100 200 300
vinit View1
vbackground -gradient SKYBLUE GRAY
vrotate 0 0.1 0
vdisplay -dispMode 1 b
vaspects b -faceBoundaryDraw 1
vfit
vzoom 0.5
vanimation anim -clear
vanimation anim/b -objectTrsf b -loc1 0 0 0 -loc2 100 0 0 -start 0 -duration 3
#vanimation anim -play 0.0
vanimation anim -record box.avi 3840 1440 -vcodec mjpeg