7 ms·
The scrcpy project is already great for this: https://github.com/Genymobile/scrcpy https://github.com/Genymobile/scrcpy Here's a little script for streaming th
by amar-laksh 3y ago
The scrcpy project is already great for this:
https://github.com/Genymobile/scrcpy https://github.com/Genymobile/scrcpy
Here's a little script for streaming through your camera on obs:
get-adb-devices-list() {
adb devices | grep -v "List of devices attached" | grep -v "daemon" | grep -v "^$" | grep -c .
}
echo "device count: $(get-adb-devices-list)"
while [ "$(get-adb-devices-list)" -eq 0 ]; do
echo "Waiting for the device..."
sleep 0.5
done
IP_ADDRESS=$(sudo adb shell ip addr show wlan0 | grep "192.168.." | awk -F ' ' '{print $2}' | cut -d '/' -f1)
connect-adb-tcp () {
sleep 1
echo "Connect to the device...$IP_ADDRESS" && \
adb tcpip 5555 && \
sudo adb connect "$IP_ADDRESS"
}
connect-adb-tcp && \
v4l2-ctl --list-devices && \
scrcpy -e --v4l2-sink=/dev/video0 --lock-video-orientation=1 -n -N &> ./log & obs
- chenxiaolong 3y agoscrcpy is awesome! Native support for streaming the camera directly (vs. streaming a screen capture of the camera app) is coming soon: https://github.com/Genymobile/scrcpy/pull/4213 https://github.com/Genymobile/scrcpy/pull/4213 For folks willing to build from source, I have an additional commit on top of the PR (linked in the comments) that enables support for Android's constrained high speed capture mode, allowing 120fps/240fps camera streaming. Not the most useful for meetings, but enables things like capturing high frame rate mixed reality VR footage. As far as I'm aware, there's no other Android webcam app, proprietary or open source, that can do anything above 60fps.
- imjonse 3y agoDo you know if there are any devices where the high FPS mode can be used not only for capture but also for the image analysis use case?
- chenxiaolong 3y agoI don't think this is possible, at least not directly. My understanding is that there's a special optimized path for CameraConstrainedHighSpeedCaptureSession recording to MediaCodec surfaces backed by a hardware encoder. If you capture to a different type of surface, the frame rate will likely drop to 60 or lower (assuming it's even allowed--I have not tested). I'm not too familiar with image analysis, but if it's acceptable to work on lossy frames and to take a small hit to latency, you could record to a MediaCodec hardware encoder and then immediately send the output to another MediaCodec instance to decode it.
- 1vuio0pswjnm7 3y agoWill scrcpy work on Alpine Linux.
- p4bl0 3y agoIs there a way to do the reverse, i.e., seeing the computer screen on an Android device? Specifically I would love a way to use my Android device as a remote controller for PDF presentation. For now I can do this with KDE Connect but the remote controller is blind, I have no way to see the current slide on the Android device, much less to use it to annotate the slides in live. Does that exist?
- stavros 3y agoVNC client?
- parasti 3y agoThis is a bit out of left field, but if you're a web developer you can use Browsersync to control a web page across multiple browsers (even on different devices). So really you "just" need a good PDF viewer on that web page.
- Baader-Meinhof 3y agoChrome Remote Desktop has worked for me in the past. Not very ergonomic on the phone, though.
- shultays 3y agoThey updated it like a couple months ago I think. It is a bit better now
- prmoustache 3y agoUse a vnc client on your android device and setup a virtual monitor on your desktop that is really a vnc server. I know how to do that with Sway and swayvnc on wayland, as well as with xorg. https://superuser.com/questions/1434779/using-a-tablet-as-a-second-monitor-with-wayland https://superuser.com/questions/1434779/using-a-tablet-as-a-... https://www.reddit.com/r/swaywm/comments/k1zl41/thank_you_devs_free_ipad_repurposed_as_a_second/ https://www.reddit.com/r/swaywm/comments/k1zl41/thank_you_de... This is particularly helpful to people using asahi linux and wanting to connect an external monitor. That can be done with something as simple as a raspberry pi. EDIT: apparently this project help achieving the same thing on different OS but using webRTC and a browser: https://github.com/pavlobu/deskreen https://github.com/pavlobu/deskreen
- kwanbix 3y agoI love how nerdy we are here. Imagine telling my wife: Here's a little script for streaming through your camera on obs: get-adb-devices-list() { adb devices | grep -v "List of devices attached" | grep -v "daemon" | grep -v "^$" | grep -c . }.... :)))))
- mathfailure 3y agoUnfortunately, I've become a MacOS (ARM) user recently and start to notice such small misfortunes here and there like your solution being not applicable to MacOS.
- franga2000 3y agoLooks like you have quite the adb arsenal there, so maybe you have any suggestions for the two things missing from mine: 1. setting a static ADB/TCP port or automatically sending it to the PC (Android now changes it every time) 2. enabling ADB/TCP on mobile hotspot (Android complains "Please connect to WiFi") Other than those two things, between scrcpy, KDE Connect and Waydroid, the Linux-Android integration is basically perfect and makes even the Applers jealous.
- sanroot99 3y agoYou have to do adb tcpip for wireless adb once in a usb mode per boot, I actually just use port forwarding of all pc port to localhost using ssh, I have a bash script using nmap to find ip