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

安卓主板无法同时打开两个摄像头预览 #75

Open
zj565061763 opened this issue Dec 13, 2017 · 3 comments
Open

安卓主板无法同时打开两个摄像头预览 #75

zj565061763 opened this issue Dec 13, 2017 · 3 comments

Comments

@zj565061763
Copy link

zj565061763 commented Dec 13, 2017

用的sdk版本:
compile 'com.ksyun.media:libksylive-java:2.4.2'
compile 'com.ksyun.media:libksylive-armv7a:2.4.2'

创建两个KSYStreamer对象mPusher1和mPusher2,并且分别设置了GLSurfaceView。
mPusher1.setCameraFacing(CameraCapture.FACING_FRONT),mPusher2.setCameraFacing(CameraCapture.FACING_BACK),
然后mPusher1.startCameraPreview()的时候显示第1个预览画面
再调用mPusher2.startCameraPreview()的时候显示第2个预览画面,但是第1个预览画面卡住了。

我直接用安卓原生的方法可以同时开启两个摄像头预览。

@buliaoyin
Copy link
Contributor

这种场景我们还未测试,后续我们看下。

你那边有错误log输出么?

@zj565061763
Copy link
Author

zj565061763 commented Dec 14, 2017

@buliaoyin 这种场景是必现的,你们可以用安卓主板试试,这是我操作时候的日志:
12-14 09:05:35.447 14046-14046/com.fanwe.wwserver D/CameraCapture: start
12-14 09:05:35.447 14046-14065/com.fanwe.wwserver V/CameraHolder: open camera 0
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 640x480
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 352x288
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 320x240
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 176x144
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 160x120
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: 5000-30000
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver E/CameraManager: Camera set parameters failed
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver E/CameraCapture: setPreviewFps with fixed value failed, retry
12-14 09:05:35.477 14046-14065/com.fanwe.wwserver D/CameraUtil: 5000-30000
12-14 09:05:35.487 14046-14065/com.fanwe.wwserver D/CameraCapture: try to preview with: 640x480 30.0fps
12-14 09:05:35.497 14046-14065/com.fanwe.wwserver D/CameraCapture: Preview with:
640x480 5.0-30.0fps
FocusMode: fixed
VideoStabilization: true
Antibanding: 50hz
12-14 09:05:35.497 14046-14065/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed 153K, 14% free 2222K/2572K, paused 6ms, total 6ms
12-14 09:05:35.497 14046-14065/com.fanwe.wwserver I/dalvikvm-heap: Grow heap (frag case) to 2.633MB for 460816-byte allocation
12-14 09:05:35.507 14046-14055/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed <1K, 12% free 2672K/3024K, paused 7ms, total 7ms
12-14 09:05:35.677 14046-14046/com.fanwe.wwserver D/CameraCapture: Camera preview started
12-14 09:05:35.677 14046-14046/com.fanwe.wwserver D/KSYStreamer: CameraCapture ready
12-14 09:05:35.767 14046-14071/com.fanwe.wwserver D/FboManager: Create and lock a new fbo: 2 1296x360 total:1
12-14 09:05:35.777 14046-14065/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed 3K, 12% free 2675K/3024K, paused 9ms, total 9ms
12-14 09:05:35.777 14046-14065/com.fanwe.wwserver I/dalvikvm-heap: Grow heap (frag case) to 3.076MB for 460816-byte allocation
12-14 09:05:35.787 14046-14065/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed <1K, 11% free 3125K/3476K, paused 7ms, total 7ms
12-14 09:05:35.787 14046-14071/com.fanwe.wwserver D/FboManager: Create and lock a new fbo: 3 1296x360 total:2
12-14 09:05:35.787 14046-14071/com.fanwe.wwserver D/FboManager: Create and lock a new fbo: 4 1296x360 total:3
12-14 09:05:40.787 14046-14071/com.fanwe.wwserver D/CameraCapture: preview fps: 20.34
12-14 09:05:45.847 14046-14071/com.fanwe.wwserver D/CameraCapture: preview fps: 8.11
12-14 09:05:47.237 14046-14046/com.fanwe.wwserver D/CameraCapture: start
12-14 09:05:47.257 14046-14075/com.fanwe.wwserver V/CameraHolder: open camera 1
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 640x480
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 352x288
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 320x240
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 176x144
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 160x120
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 544x288
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 432x240
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 320x176
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 640x360
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 800x480
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: ==== Camera Support: 1024x768
12-14 09:05:47.277 14046-14075/com.fanwe.wwserver D/CameraUtil: 5000-30000
12-14 09:05:47.287 14046-14075/com.fanwe.wwserver E/CameraManager: Camera set parameters failed
12-14 09:05:47.287 14046-14075/com.fanwe.wwserver E/CameraCapture: setPreviewFps with fixed value failed, retry
12-14 09:05:47.287 14046-14075/com.fanwe.wwserver D/CameraUtil: 5000-30000
12-14 09:05:47.287 14046-14075/com.fanwe.wwserver D/CameraCapture: try to preview with: 1024x768 30.0fps
12-14 09:05:47.297 14046-14075/com.fanwe.wwserver D/CameraCapture: Preview with:
1024x768 5.0-30.0fps
FocusMode: fixed
VideoStabilization: true
Antibanding: 50hz
12-14 09:05:47.297 14046-14075/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed 406K, 13% free 3140K/3580K, paused 7ms, total 7ms
12-14 09:05:47.307 14046-14075/com.fanwe.wwserver I/dalvikvm-heap: Grow heap (frag case) to 4.215MB for 1179664-byte allocation
12-14 09:05:47.347 14046-14046/com.fanwe.wwserver D/CameraCapture: Camera preview started
12-14 09:05:47.347 14046-14046/com.fanwe.wwserver D/KSYStreamer: CameraCapture ready
12-14 09:05:48.017 14046-14085/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed 0K, 10% free 4292K/4736K, paused 7ms, total 7ms
12-14 09:05:48.027 14046-14075/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed <1K, 10% free 4292K/4736K, paused 7ms, total 7ms
12-14 09:05:48.027 14046-14075/com.fanwe.wwserver I/dalvikvm-heap: Grow heap (frag case) to 5.340MB for 1179664-byte allocation
12-14 09:05:48.037 14046-14085/com.fanwe.wwserver D/dalvikvm: GC_FOR_ALLOC freed 0K, 8% free 5444K/5892K, paused 6ms, total 6ms
12-14 09:05:48.037 14046-14085/com.fanwe.wwserver D/FboManager: Create and lock a new fbo: 2 1296x360 total:1
12-14 09:05:48.047 14046-14085/com.fanwe.wwserver D/FboManager: Create and lock a new fbo: 3 1296x360 total:2
12-14 09:05:48.047 14046-14085/com.fanwe.wwserver D/FboManager: Create and lock a new fbo: 4 1296x360 total:3
12-14 09:05:53.057 14046-14085/com.fanwe.wwserver D/CameraCapture: preview fps: 20.70
12-14 09:05:58.107 14046-14085/com.fanwe.wwserver D/CameraCapture: preview fps: 20.00
12-14 09:06:03.157 14046-14085/com.fanwe.wwserver D/CameraCapture: preview fps: 19.99
12-14 09:06:08.207 14046-14085/com.fanwe.wwserver D/CameraCapture: preview fps: 20.01

@buliaoyin
Copy link
Contributor

我们验证了下,SDK目前为了健壮性的考虑,暂不支持同时开启多个camera,后续我们会考虑改进这块的逻辑,保证健壮性的前提下支持多camera输出。

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