PixelSorting icon indicating copy to clipboard operation
PixelSorting copied to clipboard

Extra frames added

Open Papacci20 opened this issue 3 years ago • 2 comments

When you select a video to be sorted the software adds extra frames to it.

On a video of 25 seconds and 22 decimals, the resulting output added 1,78 seconds to it.

Now the problem can be easily fixed with any modern video software that recalibrates the speed of a clip to match a specific time but it is quite annoying as of right now.

Here I'll provide the clip I used in case you want to test it by yourself.

Papacci20 avatar Dec 05 '21 16:12 Papacci20

I think the issue is due to frames per second being rounded when initializing the cv::VideoWriter.

So there should be the same number of frames in the input and output video files, it's just that they are being played slightly slower or faster depending on how it rounded the provided fps in the output video file.

I found this potential fix on StackOverflow and will try this out: https://stackoverflow.com/questions/49654051/python-opencv-videowriter-fps-rounding

Thanks for reporting this.

DavidMcLaughlin208 avatar Dec 06 '21 06:12 DavidMcLaughlin208

It seems that this is caused by the underlying libraries used by OpenCV depending on the platform. So I have found this issue does not occur in MacOS but does in Windows. And I haven't been able to find a solution in Windows yet.

DavidMcLaughlin208 avatar Jan 13 '22 18:01 DavidMcLaughlin208