Open rektide opened 9 months ago
When I start the second scrcpy, the first instance dies as so, closing the window, and then the new scrcpy window starts up with the desired video camera (as normal, without trouble)
Yes, it is the (physical, I guess) limitation on the Android device. As soon as we start a new camera capture, ne old one get disconnected.
There's probably nothing scrcpy can do.
The devices in these combinations can be concurrently configured by the same client camera application. Using these camera devices concurrently by two different applications is not guaranteed to be supported, however.
For concurrent operation, in chronological order :
- Applications must first close any open cameras that have sessions configured, using [CameraDevice#close](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#close()).
- All camera devices intended to be operated concurrently, must be opened using openCamera(String, StateCallback, Handler), before configuring sessions on any of the camera devices.
My phone natively supports simultaneous shooting with multiple cameras (two rear cameras and one front camera). Additionally, in the DSU Loader system, it's possible to mirror two cameras simultaneously in Scrcpy. However, it's unfortunate that DSU Loader cannot recognize the wide-angle camera on my phone.
So, is this a software limitation of the phone's system? Can it be bypassed with root access or a Magisk module?
Is your feature request related to a problem? Please describe. My phone has 4 different cameras. I'd love to be able to use >1 at a time. It'd be nice to be able to capture, for example, myself, and the thing I'm looking at the same time. Another use case, I've started making videos of some of my bicycle rides. It'd be great if I could have both a wide angle shot and a tight shot rolling at once, from the wide angle and zoom back cameras.
Describe the solution you'd like Ideally I could run multiple copies of
scrcpy
with different--camera-id
's specified and get multiple different cameras streaming at once into different windows.Describe alternatives you've considered One alternative that likely would be acceptable for me is to stream multiple cameras as multiple different windows via a single instance of
scrcpy
. A user might be able to specify multiple different streaming things, separated by--
or some such. This is not-optimal for me, as I can't turn cameras on and off on the fly; both cameras need to be configured ahead of time and stay on. But it would be better than what I have now.One thought I had but wasn't able to follow up on is maybe it's possible to create multiple different multiple serial links to my phone and that maybe that might help. I don't know
adb
very well nor it's technical limitations, but I poked around for a bit & I don't think I got anywhere in terms of setting up multiple connections. One thing I tried here was seeing if I could use -P port to maybe launch multiple adb servers at once and have them each pair. I was able to pair from each server, but they both listed the same serial id, and I'm not sure if this was helping at all. I couldn't find any way to point scrcpy at different adb ports, and don't know if that makes sense/is a thing.Nightmare scary mode (to me)_might be trying to make one
scrcpy
somehow blit multiple cameras or screens together in some way. That seems like it would be hard to configure well.Additional context I am using adb-over-wifi serial to talk to a Samsung S22, with Android 13. Right now I'm on a Windows 11 box. (I should try again once I get this beefy desktop machine's dual boot running again!)
I'm trying to run scrcpy twice, as so:
When I start the second scrcpy, the first instance dies as so, closing the window, and then the new scrcpy window starts up with the desired video camera (as normal, without trouble):
One additional bit of context, I can run either the front or back camera while also capturing the screen. Ex of that invocation:
I've also played with various settings some, to no effect. I've tried running one stream with
--audio-source=mic
and one with--audio-source=output
. I've tried with one--no-audio
and the other a source. I've tried using some other resolutions (640x480). I've tried--video-codec=h264
and each of the 4 different--video-encoder
options shown for h264 in--list-encoders
(full list:OMX.google.h264.encoder c2.qti.avc.encoder OMX.qcom.video.encoder.avc c2.android.avc.encoder
). One thing that I thought was promising was to specify a--port=28183:28199
non-default port for the second camera, but that didn't help. So far none of these have made a difference that I've seen.