What I'm doing:
- get the image by file picker;
- draw it on canvas in a loop using requestAnimationFrame;
- record canvas by canvas.captureStream(30) + MediaRecorder.
The problem is that the keyframes of the recorded video (every 2 seconds) have worse quality than regular frames of the same video. So it flickers for a split second every 2 seconds of the video.
_mediaRecorder = new MediaRecorder(canvasMediStream, {
mimeType: 'video/webm;codecs:h264',
videoKeyFrameIntervalDuration: 2000
});
Video file: https://drive.google.com/file/d/146coILTmdTdPTfPCDmDN8SnD5BtX5GCA/view?usp=sharing

