I am creating an application for creating gif animations.
To create a gif, the user first works with VideoView, which turns the video.
During viewing, the user selects a segment of video that must be converted into a gif.
When the segment is selected, I launch the GIFA preview mode, which is to simply rewind the video alternately to the frames that the gif will consist of
Below is a simplified piece of the mode implementation code (there is no sense to insert the code completely, the problem is not in it, it is correct).
int interval = 1000 / fps; Observable.interval(interval, TimeUnit.MILLISECONDS) .subscribe(t -> video.seekTo(computeCurrentFrameTime())
This allows you to play videos with a specific frame rate so that it looks just like a gif, which will result. But only while the video is short. When I apply this mode for video lengths, for example, per hour, video playback becomes much lower frame rates than I require. In other words - freezes.
How to make it so that it does not hang?