Issue:
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.
Troubleshooting Done:
Tested different resolutions and frame rates.
Verified GPU and CPU usage during export.
Ensured sufficient SSD write speed.
Questions:
Is there a way to optimize Image_VideoRecorder for higher FPS and better quality?
Can I enable hardware acceleration (NVENC) in Open CASCADE for better encoding performance?
Are there recommended settings to reduce pixelation while maintaining 4K output?
Would lowering BufferType to Graphic3d_BT_RGB help improve performance?
Discussion
6 archived replies
Posts are displayed in their archived order.
01Commenter-1
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):
Thank you
The problem was solved when I use codec "mjpeg "
03Author
Sometimes, the file size is too large.
Is there a way to adjust the video quality to reduce the file size?
04Commenter-1
Sometimes, the file size is too large.
Is there a way to adjust the video quality to reduce the file size?
mjpeg means 'motion jpeg', and JPEG is not that good at providing high compression ratios for videos. It does have a parameter defining quality / compression ratio qmin/qmax, but Image_VideoRecorder::openVideoCodec() doesn't allow changing it, and reducing JPEG quality is probably not very useful.
Consider playing with other codecs like VP9 which suit better for video and not still images.
I guess using NVENC should be also possible through FFmpeg, but this may require tuning OCCT.
05Author
Whenever I use other formats like VP9, H.264, or H.265, the application crashes at
writeVideoFrame(). Standard_Boolean PushFrame()
{
return writeVideoFrame(Standard_False);
}
The PushFrame() method is called from: aRecorder->PushFrame();
where aRecorder is an instance of Image_VideoRecorder.
The only setting that works for me is: aRecParams.Format = "matroska";
aRecParams.VideoCodec = "mjpeg";
06Author
Whenever I use other formats like VP9, H.264, or H.265, the application crashes at writeVideoFrame().
Standard_Boolean PushFrame()
{
return writeVideoFrame(Standard_False);
}
The PushFrame() method is called from:
aRecorder->PushFrame();
where aRecorder is an instance of Image_VideoRecorder.
The only setting that works for me is:
aRecParams.Format = "matroska";
aRecParams.VideoCodec = "mjpeg";