如何在活动中同时捕获**视频和照片**
我想同时拍摄视频和照片。
我有两个按钮。
当用户点击一个时,它必须拍摄视频
另一个按钮则必须停止录制视频并拍照。
现在我正在尝试录音机和相机,但它工作不正常,
另请注意不能同时进行,我想一个接一个地进行反之亦然..
对此有什么好主意吗?
I want to take video and photo at same time.
I have two buttons.
When user click on one it have to take video and
Another button then it have to stop recording video and take photo.
Now I am trying recorder and camera but its not working fine ,
Also note not both in same time i want to do one after another vice versa ..
What is a good idea for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您录制视频,则可以在按下按钮时计算与按下按钮的时间相对应的视频帧,然后将该帧从视频文件中拉出并将其用作图像。我从来没有在安卓上做过,但应该是可以的。
编辑:看看相机中的previewcallback():
http:// developer.android.com/reference/android/hardware/Camera.PreviewCallback.html
If your recording video then, you could when the button is pressed, calculate the frame of the video that corresponds to the time the button was pressed then just pull that frame out of the video file and use that as your image. I've never done it on android, but it should be possible.
EDIT: have a look at the previewcallback() in camera:
http://developer.android.com/reference/android/hardware/Camera.PreviewCallback.html
不要认为这是可能的。相机和录音机无法一起工作,因为它们都会阻止相机,并且不允许其他应用程序的录音机和相机(以及彼此)同时使用相机。
Don't think it's possible. Camera and recorder will not work together because they both block camera and don't allow other apps' recorders and cameras (and each other) to use camera at the same time.