Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoEncoderCore.java 针对视频采集的encodedData(ByteBuffer)是什么颜色格式? #113

Open
brianlin48 opened this issue Jan 9, 2021 · 0 comments

Comments

@brianlin48
Copy link

您好,
有个功能需求:采集视频的ByteBuffer,将其数据传给直播平台(CDN)。

参考了您的代码,已实现采集视频后存成.mp4。不过,再存档的同时传一份相同数据给CDN,CDN只接受I420、NV21、RGBA三种颜色格式,现在上传了视频帧显示为绿屏或花屏,看起来是颜色格式不符造成的。目前需要搞清楚“encodedData”是什么的颜色格式。
代码的疑问处:VideoEncoderCore.java 192行
mMuxer.writeSampleData(mTrackIndex, encodedData, mBufferInfo);

查找了一些资料,有关“COLOR_FormatSurface”:
format.setInteger(MediaFormat.KEY_COLOR_FORMAT,
MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
说明这个是不明的颜色格式,如果是不明颜色格式,可以有什么方法可以验证。

二个问题:

  1. 请问“encodedData”的数据可以提供给CDN使用吗?
  2. 请问如何找出“encodedData”是什么的颜色格式呢?
  3. 请问有什么方法可以验证“encodedData”的数据呢?(例如:FFPlayer。。。)
    以上,谢谢!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant