Sync Android MediaPlayer with animations like IOS AVPlayer and AVSynchronized layer

My goal is to overlay certain images on top of the video in order to censor pornographic material. The problem is that the videos are not organized by me. My iOS / Android apps simply shoot videos from different servers and show them that they need to overlay images to censor any sensitive material. Suppose I somehow magically receive some metadata from my own server, which tells me that I need to censor.

In iOS, I achieved this goal by using AVPlayer to launch video and animate the image that appears over any part of the video that needs to be censored. The animation is synchronized with AVPlayer using the AVSynchronized layer, which automatically synchronizes each frame of the video with the corresponding animation frame.

Now I need to do the same in Android. I created a transform animation to transform an overlay image that hides censored content. I constantly examine MediaPlayer for the current duration and, using fps, get closer to the current frame and try to synchronize the animation with the video.

The problem is that there is a lot of trembling in everything. If the animation somehow lags behind the video even for several frames, the content that I need for censorship is displayed, which surpasses all this.

In short, I need to synchronize each frame of the animation with the frame of the video with the same index. Is there something like AVSynchronized layer that I can use to achieve this?

+7
android animation media-player avplayer
source share

No one has answered this question yet.

See related questions:

421
Android: expand / collapse animation
307
Android background color change animation
34
Multiple videos from AVPlayer
17
Android: animated user views
7
How to add an animated / simple image as a top layer to a video and export it as a single video in Android?
3
Black screen while playing video in Android
0
Interactive animation on Android
0
AVVideocomposition AVPlayerItem video layer position
0
Android frame-by-frame animation
0
Video with Android browser for playback in a media player

All Articles