【发布时间】:2019-07-13 18:04:42
【问题描述】:
我正在尝试实现屏幕录像机。我关注了grafika。只需将 Surface 从 encoder.getInputSurface() 提供给 VirtualDisplay 就可以了。现在我的任务是对屏幕的某个部分进行编码。所以,我试图使用 SurfaceTexture 修改编码器的输入 Surface(我认为这是正确的方法)。但我无法使用创建的表面来记录屏幕,当我将此表面传递给 VirtualDisplay 时,我没有得到任何回调。
我也尝试使用 TextureMovieEncoder(来自 grafika)进行录制,但可能我不知道正确的方法。
我试图通过以下有用的链接来理解。 How does an output surface of a Decoder is passed to an input surface of an Encoder?
和
Android: Is it possible to create a SurfaceTexture without a SurfaceView?
我确信 grafika 是一个很棒的教程,但我卡住了。
请提出解决方案或其他可行的方法。我现在被困了好几天。
【问题讨论】:
标签: android opengl-es grafika android-mediacodec