特别是,这是我想要的设置:Android 设备上的内置摄像头正在录制实时视频。该视频正在保存到缓冲区,其中保存了几秒钟的视频。当缓冲区已满时,缓冲区中最旧的帧将添加到磁盘上的视频文件中,以便为来自摄像机的新帧腾出空间。然后,缓冲区中的数据可用于在视频中短暂向后跳跃。
我想我们应该使用 mediaRecorder (和 mediaPlayer?) 与 Surface 来获取视频,分别使用 addCallbackBuffer 创建缓冲区,然后使用 setPreviewCallbackWithBuffer 从缓冲区显示视频。我不完全确定从那里该去哪里,或者这是否完全是错误的道路;我在这方面有点新手。
In particular, this is the setup I want: The built-in camera on an Android device is recording live video. This video is being saved to a buffer, which holds a few seconds of video. When the buffer is full, the oldest frames from the buffer are added to a video file on disk to make room for the new frames coming from the camera. The data in the buffer could then be used to skip backwards briefly in the video.
I was thinking we'd use mediaRecorder (and mediaPlayer?) with a Surface to obtain the video, respectively, use addCallbackBuffer to create the buffer, and then use setPreviewCallbackWithBuffer to display the video from the buffer. I'm not entirely sure where to go from there or if that is the wrong track altogether; I am somewhat of a novice at this.
发布评论
评论(1)
MediaRecord 已经为您进行缓冲和文件写入。
如果您确实需要控制细节,请关注:http://code.google.com/p/android-video-conference/source/browse/trunk/trunk/Android/upStream/src/my/video/stream/Stream.java
MediaRecord is already doing buffering and file writing for you.
If you do need control the details, have an eye on : http://code.google.com/p/android-video-conference/source/browse/trunk/trunk/Android/upStream/src/my/video/stream/Stream.java