Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android中从视频视图准确捕获图像_Android_Android Videoview_Video Capture - Fatal编程技术网

如何在android中从视频视图准确捕获图像

如何在android中从视频视图准确捕获图像,android,android-videoview,video-capture,Android,Android Videoview,Video Capture,我正在制作一个应用程序,使用以下代码捕获视频: Bitmap bmframe =mediaMetadataRetriever.getFrameAtTime(currentPosition*1000); 但是捕捉不准确。它在当前位置之前捕捉几微秒。如果有任何帮助,我们将不胜感激。提前感谢。:试试这个 将下面的内容放入一个方法中 yourvideoView.setDrawingCacheEnabled(true); yourvideoView.buildDrawingCache(); Bitmap

我正在制作一个应用程序,使用以下代码捕获视频:

Bitmap bmframe =mediaMetadataRetriever.getFrameAtTime(currentPosition*1000);
但是捕捉不准确。它在当前位置之前捕捉几微秒。如果有任何帮助,我们将不胜感激。提前感谢。:

试试这个

将下面的内容放入一个方法中

yourvideoView.setDrawingCacheEnabled(true);
yourvideoView.buildDrawingCache();
Bitmap bm = yourvideoView.getDrawingCache();
// save the bitmap or do what ever

在您需要的时间后,使用处理程序调用该方法,或根据需要单击按钮拍摄图像

,但没有绘制CacheEnabled的工作。我只需要准确地捕获帧。这是为了捕获视频视图的屏幕截图,我想这有一个问题,您需要在其中指定layertype请看,让我们看看您有什么解决方案吗?我也有同样的问题