简体   繁体   English

如何在Android中运行视频捕获图像?

[英]how do I capture image from running video in android ?

I have a code that records video from camera. 我有一个代码来记录来自相机的视频。 I want to use the camera in 2 ways 1. for video recording 2. image capture & transfer to remote android phone. 我希望以2种方式使用相机1.用于视频录制2.图像捕获和转移到远程Android手机。 I can not use 1 camera for 2 purposes so I have decided to use camera picture callback functions during video recording but that is not working. 我不能将1个摄像头用于2个目的,所以我决定在视频录制过程中使用摄像头图像回调功能,但这不起作用。

Is there any way to get image frames from running video ? 有没有办法从运行视频中获取图像帧?

If you are using SurfaceView or SurfaceTexture you can use preview callback instead of the picture callback. 如果您使用的是SurfaceView或SurfaceTexture,则可以使用预览回调而不是图片回调。 It will take you to onPreviewFrame where you can access the individual frames. 它将带您进入onPreviewFrame,您可以在其中访问各个帧。 look at: 看着:

see: http://developer.android.com/reference/android/hardware/Camera.PreviewCallback.html 请参阅: http//developer.android.com/reference/android/hardware/Camera.PreviewCallback.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM