Dear all,
using the scicv toolbox for avi creation I stumbled over a rather confusing bug.
The bug is most likely not directly based on Scilab , but rather depends on openCV.
However, since it took me a while to figure this out, I rather share some info:
Setup:
- step 1: use xs2png() to export a number of graphics to a number of images
- step 2: use VideoWriter_write() to add all images into a single avi
Within step 1 the figure size is initiated for the 1st graph with:
f.figure_size = [FIG_WIDTH FIG_HEIGHT];
Later graphs just update the figure content, but the figure itself is not re-created.
So theoretically all images saved with xs2png have the same pixel-size.
In praxis it turned out, that the figure size did change due to remotly accessing the operating PC, which brings me to the issue with VideoWriter_write:
VideoWriter_write will not raise an error / notification etc. if the image that is going to be added
does not fit the specified avi pixel resolution.
In fact the avi is created, but maybe contains only some frames..which happend to have the correct
pixel size.
It took me quite some time to figure this out, checking and rechecking my scilab code, which at first perfectly worked well but out of the sudden did not anymore.
So as mentioned…this seems to be an issue in openCV…see here:
The issue might be known in the openCV community, but as a scilab user I do not read openCV forums to start code debugging. The issue seems also to be still unsolved in openCV…see here.
https://github.com/opencv/opencv/issues/19670
As a work around I now have a function to check all images onto the pixel size before adding them up into an avi.
As regards to Scilab, I wonder if a short statement in the VideoWriter_write () help page could be implemented to give users a guideline / hint about the subject.
Best Regards,
Philipp