简体   繁体   English

使用适用于Android的webrtc,如何在视频通话中保存图片?

[英]Using webrtc for android,how to save a image in the video call?

I don't know how to get the video frame , so I can't save the image. 我不知道如何获取视频帧,因此无法保存图像。

Give me some tips. 给我一些提示。 Thanks a lot. 非常感谢。

As canvas and rest of the facilities are unavailable in Android we can dodge this situation by taking screenshots and introducing animation in our app's UI. 由于画布和其他功能在Android中不可用,因此可以通过截屏并在应用程序的UI中引入动画来避免这种情况。 screenshot image can be stored at configured location and resused it later for exchanging it to other party 屏幕截图图像可以存储在配置的位置,并在以后重新使用以与他人交换

Edit: One can take reference from AppRTC to capture surfaceview() 编辑:可以从AppRTC引用以捕获surfaceview()

https://codereview.webrtc.org/1257043004/ https://codereview.webrtc.org/1257043004/

GLSurfaceView () should not work as webrtc library has the hold of camera and screen. GLSurfaceView()不能使用,因为webrtc库具有摄影机和屏幕。 One has to build extended class to get Videorenderer and get the snap of frame , Once done one can display the frame using customized api displayFrame() mentioned by cferran in opentok android examples. 必须构建一个扩展类来获取Videorenderer并获取框架的快照,完成后,就可以使用cferran在opentok android示例中提到的自定义api displayFrame()来显示框架。

You can also use OpenTok library but that is chargeable when compared to webRTC. 您还可以使用OpenTok库,但是与webRTC相比,该库是收费的。

If you are interested in using a third party library here is an example on how to implement this use case: https://github.com/opentok/opentok-android-sdk-samples/tree/master/Live-Photo-Capture 如果您对使用第三方库感兴趣,请参见以下示例,了解如何实现此用例: https : //github.com/opentok/opentok-android-sdk-samples/tree/master/Live-Photo-Capture

If you prefer to use directly WebRTC, here you can find generic information about how to build WebRTC on Android: https://webrtc.org/native-code/android/ 如果您更喜欢直接使用WebRTC,则可以在此处找到有关如何在Android上构建WebRTC的一般信息: https : //webrtc.org/native-code/android/

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

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