I am making a web application that records the user's screen and capture the mouse position every x ms and send both the data to the python backend.
In the backend, it receives all the mouse position data and the recorded video after the user stops the recording. Now, in the backend, I want to generate a beautiful interpolated curved smooth path based on those mouse positions and draw a custom mouse on top of each frame of the recorded video. The interpolation should be smooth and curved based on the available mouse coordinates data and it should generate the full path.
For example, I have 5 mouse position data in a recording of 5 seconds, now I want to draw a custom mouse on top of each frame of the recorded video based on those 5 mouse position data, but I want to smooth result, the custom mouse should be drawn in a smooth and curved way from the point of the next data point.
The movement should be beautiful and smooth. I read about Bézier Curves and spline interpolation. Which one would be good for such a situation? Ideally, the line between the curves should be curved.
For example, I have a 5-second video, i.e. 5 sec * 30 (30 fps) = 150 frames
, and I only have data of 20 mouse positions, now it had to do a beautiful smooth curve based on those mouse positions in a curve way and generate positions between two data points so that at last I would have a total of 150 mouse positions that when drawn a custom mouse based on those position on top of frames forms a curve and smooth movements journey.