Coder Social home page Coder Social logo

Comments (9)

jinlong0813 avatar jinlong0813 commented on May 16, 2024 1

@xiaoqunSun KEY_I_FRAME_INTERVAL设置成0,用什么方式强制获取I帧,是MediaCodec.PARAMETER_KEY_REQUEST_SYNC_FRAME吗?

from anyrtc-rtmp-opensource.

liuxinpeister avatar liuxinpeister commented on May 16, 2024 1

我也碰到这个问题,最后找到的问题原因是colorformat不正确,在Android6.0上,如果使用的是硬编码器,我的是qcom的编码器,需要使用YUV420SP的colorformat,才能正常出关键帧,使用YUV420P不行。机型:小米4。

from anyrtc-rtmp-opensource.

DyncEric avatar DyncEric commented on May 16, 2024

这个问题我们正在努力复现,多谢

from anyrtc-rtmp-opensource.

DyncEric avatar DyncEric commented on May 16, 2024

这个问题目前来看没有特别好的解决办法,可以暂时规避掉,MediaCodec编码器如果可以定时如3s输出关键帧,则可以注释掉这行代码。

from anyrtc-rtmp-opensource.

jinlong0813 avatar jinlong0813 commented on May 16, 2024

目前确认是所有Android 6.0上都有这个问题。 按你说的,注释掉这句代码,Android 6.0上就只有一开始有个I帧,后面一直没有I帧了,全是P帧, MediaFormat.KEY_I_FRAME_INTERVAL设置不生效。Android 4、Android 5版本上这个设置都是生效的。 所以现在Android 6.0上要么只有第一个I帧,后面全是P帧, 要么全是I帧没有P帧, 这都不正常啊。

from anyrtc-rtmp-opensource.

mtdxc avatar mtdxc commented on May 16, 2024

可以用软件方式强制让它生成关键帧么……

from anyrtc-rtmp-opensource.

jinlong0813 avatar jinlong0813 commented on May 16, 2024

@DyncEric @mtdxc 知道怎么破吗,这个问题还比较严重啊

from anyrtc-rtmp-opensource.

xiaoqunSun avatar xiaoqunSun commented on May 16, 2024

印象中webrtc的编码函数是可以设置生成关键帧的。
我给的建议是降 MediaFormat.KEY_I_FRAME_INTERVAL设成0,
然后自己数帧,每过几帧就强制编码器生成关键帧
也就是说自己实现KEY_I_FRAME_INTERVAL逻辑

from anyrtc-rtmp-opensource.

mtdxc avatar mtdxc commented on May 16, 2024

V_H264Encoder::RequestKeyFrame

from anyrtc-rtmp-opensource.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.