VideoView和步进播放(逐帧)
我想用视频视图逐帧播放。 我有这个:
mVideoView.seekTo(mVideoView.getCurrentPosition()+1);
但在此之后我看不到该帧,直到我单击播放...我不想那样,我只想看到下一帧。
另外 - 我可以对前一帧做同样的事情吗?
提前致谢。
I would like to play frame by frame with the videoview.
I have this:
mVideoView.seekTo(mVideoView.getCurrentPosition()+1);
But after this I do not see the frame until I click play... I do not want that, I just want to see the next frame.
Also - can I do the same for previous frame?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
暂停时它不会进行搜索。但是,如果您使用 SurfaceView 和 MediaPlayer,则始终可以在查找后立即暂停,因为 VideoView 没有 onSeekComplete 回调。
这将寻找并显示一些东西。不幸的是,您会发现这不允许您逐帧播放。
It will not seek while paused. But you can always pause right after seeking, if you use a SurfaceView and a MediaPlayer because VideoView doesn't have the onSeekComplete callback.
This will seek and display something. Unfortunately you will find that this does not allow you to play frame by frame.
您可以使用 MediaMetadataRetriever 选择您想要的框架,然后将其获取为使用 MediaMetadataRetriever.getFrameAtTime(long timeUs) 的位图。它比使用 MediaPlayer 效果要好得多。
我希望它有用。
You can use MediaMetadataRetriever to select the frame you want and next get it as a BitMap using MediaMetadataRetriever.getFrameAtTime(long timeUs). It will work much better than using a MediaPlayer.
I hope it is useful.