V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
silverdog
V2EX  ›  WebRTC

android google 原生 webrtc setVideoProcessor 如何消费 VideoFrame

  •  
  •   silverdog · 2021-04-02 17:27:28 +08:00 · 1366 次点击
    这是一个创建于 1359 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如何解决着急!!!!!!!

    // 调用第三方美颜算法( mMHBeautyManager.render ) 返回新的 textureId
    // textureId 生成 VideoFrame
    // s.onFrame()


    // 报错
    11-24 16:01:59.673: E/org.webrtc.Logging(25509): MediaCodecVideoEncoder: encodeTexture failed
    11-24 16:01:59.673: E/org.webrtc.Logging(25509): MediaCodecVideoEncoder: java.lang.RuntimeException: glUseProgram: GLES20 error: 1282
    11-24 16:01:59.676: E/org.webrtc.Logging(25509): MediaCodecVideoEncoder: java.lang.RuntimeException: glUseProgram: GLES20 error: 1282
    11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlUtil.checkNoGLES2Error(GlUtil.java:29)
    11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlShader.useProgram(GlShader.java:110)
    11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlRectDrawer.prepareShader(GlRectDrawer.java:195)
    11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.GlRectDrawer.drawOes(GlRectDrawer.java:118)
    11-24 16:01:59.676: E/org.webrtc.Logging(25509): at org.webrtc.MediaCodecVideoEncoder.encodeTexture(MediaCodecVideoEncoder.java:592)



    // 关键代码如下
    val buffer = p0.buffer as TextureBuffer
    val textureId = mMHBeautyManager.render(
    buffer.textureId,
    buffer.width,
    buffer.height,1,1
    )
    val textureBufferImpl= TextureBufferImpl(
    buffer.width,
    buffer.height,
    buffer.type,
    textureId,
    buffer.transformMatrix,
    surfaceTextureHelper?.handler,
    yuvConverter,
    null
    )

    val new = VideoFrame(textureBufferImpl, 270, System.nanoTime())
    s.onFrame(new)
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2549 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 04:23 · PVG 12:23 · LAX 20:23 · JFK 23:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.