从 GLSurfaceView 录制视频和音频并将其导出为 .mp4 [英] Record video and audio from a GLSurfaceView and export it to .mp4

查看:115
本文介绍了从 GLSurfaceView 录制视频和音频并将其导出为 .mp4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 OpenGL 的新手.我想从 GLSurfaceView 录制视频和音频并将其导出为 .mp4(或其他格式).我有一个实现 Renderer

I am a newbie in OpenGL. I want to record video and audio from a GLSurfaceView and export it to .mp4 (or other formats). I have a GlsurfaceView that implement Renderer

我尝试过在 bigflake.com 中使用 fadden 示例,例如 EncodeAndMuxTest.java , 或 RecordFBOActivity.javagoogle/grafika 但没有成功,因为我不不知道如何实施.

I've tried using fadden examples's in bigflake.com like EncodeAndMuxTest.java ,or RecordFBOActivity.java in google/grafika but without success because I don't know how to implement it.

是否有记录 GLSurfaceView 的示例或操作方法"?

Is there any example or "How-to" for recording a GLSurfaceView?

推荐答案

您可以尝试使用 INDE Media for Mobile:https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials GLCapturer 类,它允许在几行代码中进行 opengl 捕获,示例在这里:

You can try to use INDE Media for Mobile: https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials GLCapturer class, it allows to make opengl capturing in a few lines of code, samples are here:

https://github.com/INDExOS/media-for-mobile/blob/master/samples/src/main/java/org/m4m/samples/GameRenderer.java

synchronized (videoCapture) {
    if (videoCapture.beginCaptureFrame()) {
        ...

        renderScene();

        videoCapture.endCaptureFrame();
    }
}

这篇关于从 GLSurfaceView 录制视频和音频并将其导出为 .mp4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆