android av sync机制,Android MediaPlayer sync with animation like iOS AVPlayer and AVSynchronized layer...

My aim is to overlay certain images on top of a video in order to censor pornographic material. The problem is that the videos are not hosted by me. My iOS/Android apps just take the videos from different servers and while showing them have to overlay images to censor any sensitive material. Lets assume, I somehow magically get some meta data from my own server which tells me what I need to censor.

In iOS, I achieved this goal by using an AVPlayer to run the video and an animation of an image that appears over any part of the video that needs to be censored. The animation is synced with the AVPlayer using an AVSynchronized layer which automatically syncs each frame of the video with the associated frame of the animation.

Now, I need to do the same in Android. I've made a transform animation for transforming the overlay image that hides the censored content. I poll the MediaPlayer constantly for the current duration and and using the fps, approximate the current frame and try to sync the animation with the video.

The problem with this is that there is a lot of jitter in the whole thing. If the animation somehow lags behind the video even for a couple of frames, the content I need to censor is shown which beats the whole point of doing this.

In short, I need to sync each frame of animation with the videos frame with the same index. Is there something similar to AVSynchronized layer I can use to achieve this?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值