The present invention discloses a method for Android to implement a video recording screen pushing with a camera, which includes the following steps: A, using TextureView to display the content collected by the current camera and displaying it on the screen; B, using the service to control the life cycle of the camera suspension window; C, the use of VirtualDisplay to obtain the screen and the camera. Image metadata such as the head suspension window; D, using MediaCodec to encapsulate the image metadata obtained by VirtualDisplay to generate video data stream; the invention solves the problem that the teacher uses Android to push the stream when the teacher uses the direct sowing of the direct sowing of the education class, and lets the students see the teacher's skills. The sound and picture of the teacher can also see the teacher's operation on the mobile phone, which enriches the extensibility of the teacher's software using Android to push the flow in the course of teaching. One
【技术实现步骤摘要】
一种Android实现带摄像头采集的录屏推流的解决方法
本专利技术涉及一种图像采集技术,具体是一种Android实现带摄像头采集的录屏推流的解决方法。
技术介绍
目前市场上的同类产品的做法:在直播过程中,通过Android的摄像头和麦克风采集老师的画面和声音,并将其推送到服务器,供学生观看。其特点是:能够将当前教师的画面和声音采集后推送到到服务器,供学生端观看,学生端能够通过老师的讲解学习到相关的内容。其缺点是:直播的内容很容易受到限制,仅仅采集了教师的画面和声音,并没有向学生展示一些额外的内容,这样会让学生觉得直播过于生硬,导致学习的效果不佳。
技术实现思路
本专利技术的目的在于提供一种Android实现带摄像头采集的录屏推流的解决方法,以解决上述
技术介绍
中提出的问题。为实现上述目的,本专利技术提供如下技术方案:一种Android实现带摄像头采集的录屏推流的解决方法,包含以下步骤:A、使用TextureView展示当前摄像头采集的内容并展示到屏幕上;B、使用服务来控制摄像头悬浮窗的展示生命周期;C、使用VirtualDisplay获取屏幕和摄像头悬浮窗的图像元数据;D、使用MediaCodec将VirtualDisplay获取的图像元数据封装生成视频数据流;E、使用AudioRecord和MediaCodec采集音频元数据并封装生成音频数据流;F、使用RTMP协议将生成的音视频流推送到服务器。作为本专利技术的进一步技术方案:所述步骤A具体是:使用TextureView将Camera采集的数据,通过Camera.setPreviewTexture(surfac ...
【技术保护点】
1.一种Android实现带摄像头采集的录屏推流的解决方法,其特征在于,包含以下步
【技术特征摘要】
1.一种Android实现带摄像头采集的录屏推流的解决方法,其特征在于,包含以下步骤:使用TextureView展示当前摄像头采集的内容并展示到屏幕上;使用服务来控制摄像头悬浮窗的展示生命周期;使用VirtualDisplay获取屏幕和摄像头悬浮窗的图像元数据;使用MediaCodec将VirtualDisplay获取的图像元数据封装生成视频数据流;使用AudioRecord和MediaCodec采集音频元数据并封装生成音频数据流;使用RTMP协议将生成的音视频流推送到服务器。2.根据权利要求1所述的一种Android实现带摄像头采集的录屏推流的解决方法,其特征在于,所述步骤A具体是:使用TextureView将Camera采集的数据,通过Camera.setPreviewTexture(surface)方法展示出来,并通过WindowManager.LayoutPara...
【专利技术属性】
技术研发人员:任辉,
申请(专利权)人:创盛视联数码科技北京有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。