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

推流实际的分辨率 #87

Open
mghxz252 opened this issue Mar 3, 2018 · 6 comments
Open

推流实际的分辨率 #87

mghxz252 opened this issue Mar 3, 2018 · 6 comments

Comments

@mghxz252
Copy link

mghxz252 commented Mar 3, 2018

如果设置的预览和推流的分辨率,手机不支持的话,SDK会自动设置一个分辨率, 我怎么样可以获取SDK设置好的这个分辨率。。

@buliaoyin
Copy link
Contributor

SDK内部只会对设置的预览和推流分辨率进行8像素对齐的处理(硬编模式下推流分辨率进行16像素对齐),不存在不支持的情况。

要获取对齐后的分辨率,在推流开始后通过mStreamer.getPreviewWidth/Height(), mStreamer.getTargetWidth/Height()获取即可。

@mghxz252
Copy link
Author

mghxz252 commented Mar 6, 2018

比如我推流和预览设置为480*272的分辨率。SDK的输出日志会显示03-06 09:22:00.960 25021-25062/com.papatang.argame D/CameraCapture: try to preview with: 480x320 15.0fps
03-06 09:22:01.000 25021-25062/com.papatang.argame D/CameraCapture: Preview with:
480x320 15.0-15.0fps
FocusMode: fixed
VideoStabilization: true
Antibanding: auto

@mghxz252
Copy link
Author

mghxz252 commented Mar 6, 2018

这个时候,怎么获取上面日志里的分辨率????

@buliaoyin
Copy link
Contributor

上述日志中的分辨率只是系统camera采集所使用的分辨率,预览和推流会根据所设分辨率进行裁剪和缩放。

要获取上述分辨率,可以调用mStreamer.getCameraCapture().getTargetPreviewSize();
参考: http://ksvc.github.io/KSYStreamer_Android/docs/reference/com/ksyun/media/streamer/capture/CameraCapture.html#getTargetPreviewSize()

其他API接口也可以参照上述链接中的API文档。

@mghxz252
Copy link
Author

mghxz252 commented Mar 6, 2018

谢谢,还有个问题,我使用ImgTexFilter 来做贴图,但是在16:9的手机屏幕里,贴图会拉伸,是不是ImgTexFiter里的参数没设置好,如果是的话,该怎么设置?

1 similar comment
@mghxz252
Copy link
Author

mghxz252 commented Mar 6, 2018

谢谢,还有个问题,我使用ImgTexFilter 来做贴图,但是在16:9的手机屏幕里,贴图会拉伸,是不是ImgTexFiter里的参数没设置好,如果是的话,该怎么设置?

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

2 participants