1
0
mirror of https://github.com/tiyn/wiki.git synced 2025-04-19 14:07:46 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
cf7502ed6a android: added scrcpy, linked ip webcam better 2023-11-12 00:03:58 +01:00
da179d81cb android: fix typo in droidcam 2023-11-11 23:51:16 +01:00
48307410ce android: added ip webcam and follow ups 2023-11-11 23:35:27 +01:00
e081dbb0a3 android: fix typo in droidcam 2023-11-11 23:13:46 +01:00
7 changed files with 121 additions and 6 deletions

View File

@ -8,12 +8,12 @@ It enables a [smartphone](/wiki/smart_devices.md) to be used as [webcam](/wiki/w
DroidCam needs to be set up on the phone aswell as on the computer to be used.
On [Android](/wiki/android.md) Gadgetbridge is available on the
On [Android](/wiki/android.md) DroidCam is available on the
[Google Play Store](/wiki/android.md#app-store) in a package called
[DroidCam Webcam](https://play.google.com/store/apps/details?id=com.dev47apps.droidcam).
On the computer setup files for both [Linux](/wiki/linux.md) and [Windows](/wiki/windows.md) can be
found on the [official Dev47Apps](https://www.dev47apps.com/).
found on the [official website](https://www.dev47apps.com/).
Alternatively most [Linux systems](/wiki/linux/package_manager.md) feature a package named
`droidcam`.

38
wiki/android/ip_webcam.md Normal file
View File

@ -0,0 +1,38 @@
# IP Webcam
[IP Webcam](https://play.google.com/store/apps/details?id=com.pas.webcam&hl=de&gl=US) is an App
developed and published by Pavel Khlebovich for [Android](/wiki/android.md) systems.
It enables a [smartphone](/wiki/smart_devices.md) to be used as [webcam](/wiki/webcams.md).
## Setup
On [Android](/wiki/android.md) IP Webcam is available on the
[Google Play Store](/wiki/android.md#app-store) in a package called
[IP Webcam](https://play.google.com/store/apps/details?id=com.pas.webcam&hl=de&gl=US).
## Usage
To initiate a connection between the [smartphone](/wiki/smart_devices.md) and the computer first
start the app on the smartphone.
Make sure to be connected to the same W-LAN as the computer or alternatively connect them with an
USB-cable.
After starting the application an IPv4 link be displayed.
This link can be pasted into a [browser](/wiki/web_browser.md).
There the video aswell as various settings will be available.
An example link will look like the following.
```txt
http://192.168.178.66:8080
```
Additionally it can be piped into [OBS](/wiki/obs.md) to edit it or into
[ffmpeg](/wiki/linux/ffmpeg.md) on [Linux](/wiki/linux.md) systems to create a virtual webcam
device as explained in the
[ffmpeg entry](/wiki/linux/ffmpeg.md#create-a-virtual-camera-using-an-ip-video-stream).
The link used for applications like this will be the previously displayed IPv4 link aswell as an
appended `/videofeed`.
An example link will look like the following.
```txt
http://192.168.178.66:8080/videofeed
```

20
wiki/android/scrcpy.md Normal file
View File

@ -0,0 +1,20 @@
# scrcpy
[scrcpy](https://scrcpy.org/) is an application that allows remote
mirroring of an [Android phones](/wiki/android.md) screen aswell as controlling it.
## Setup
scrcpy needs to be set up on the computer that displays the mirror of the smartphone used.
Setup files for [Windows](/wiki/windows.md) can be found on the
[official website](https://scrcpy.org/download/).
Alternatively most [Linux systems](/wiki/linux/package_manager.md) feature a package named
`scrcpy`.
## Usage
Connect the phone which is to be controlled with the computer via USB.
Make sure USB debugging is enabled in the phones setting.
Afterwards start up scrcpy.
It is possible that debugging has to be confirmed on the phone again after starting the application.

View File

@ -63,3 +63,20 @@ Note that the bitrate for videos is split amongst a bitrate for video and a
bitrate for audio.
The target bitrate has to be equal to or greater than the sum of both video
bitrate and audio bitrate.
### Create a Virtual Camera Using an IP Video Stream
The following section will create a virtual [webcam](/wiki/webcams.md) from an IP video stream like
the one provided by [IP Webcam](/wiki/android/ip_webcam.md) [Android](/wiki/android.md) app.
For this a free [V4L2](/wiki/linux/v4l2.md) video device will be needed.
To information on how to create it navigate to the V4L2 entry and its sections on
[permanent](/wiki/linux/v4l2.md#create-permanent-v4l2-devices) and
[temporary creation of V4L2 video devices](/wiki/linux/v4l2.md#create-temporary-v4l2-devices).
The following command will create a video device using the pixel format planar YUV 4:2:0.
In this example it is assumed that the IP link is `http://192.168.178.66:8080/videofeed` and the
V4L2 video device that is not used but exists is `/dev/video8`.
If any of those differs on a given system adjustments are needed.
```sh
ffmpeg -i http://192.168.178.66:8080/videofeed -f v4l2 -pix_fmt yuv420p /dev/video8
```

View File

@ -13,11 +13,21 @@ The following section is based on a
[v4l2loopback](https://github.com/umlaeute/v4l2loopback) is a utility to create
a virtual video device.
One use of it is in [OBS Virtual Camera](/wiki/obs.md#virtual-camera).
### Setup
To use v4l2loopback an according
package needs to be installed.
Some distributions have a package named `v4l2loopback-dkms` in the package
manager, making the manual installation process unnecessary.
Afterwards v4l2loopback can be manually started by running:
### Usage
This section focusses on various use-cases for the v4l2loopback software.
### Create Temporary V4L2 Devices
v4l2loopback can be manually started by running:
```sh
modprobe v4l2loopback card_label='V4L2 Loopback' video_nr=7 exclusive_caps=1
@ -28,6 +38,15 @@ modprobe v4l2loopback card_label='V4L2 Loopback' video_nr=7 exclusive_caps=1
This can be changed according to the needs.
It is important that the device is not already in use by another application.
To create more than one device more labels or numbers can be appended.
An example command with 2 V4L2 video devices will look like the following command.
```sh
modprobe v4l2loopback card_label='OBS Virtual Camera','IP Webcam' video_nr=7,8 exclusive_caps=1
```
### Create Permanent V4L2 Devices
For an automatic start at boot via [SystemD](./systemd.md) a service can be
created - as described in [the SystemD entry](./systemd.md#run-command-on-boot).
For v4l2loopback create the file `/etc/systemd/system/v4l2loopback.service`
@ -40,15 +59,15 @@ Description=V4L2 Loopback
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=/bin/modprobe v4l2loopback card_label='V4L2 Loopback' video_nr=7 exclusive_caps=1
ExecStart=/bin/modprobe v4l2loopback card_label='OBS Virtual Camera' video_nr=7 exclusive_caps=1
ExecStop=/bin/rmmod v4l2loopback
[Install]
WantedBy=default.target
```
Note the line starting with `ExecStart=/bin/` is the same line described above
to change the device path.
Note the line starting with `ExecStart=/bin/` is the same line described in the
[above section](#create-temporary-v4l2-devices).
Make sure to change it if needed.
Afterwards enable the service to start at every boot process by running:

View File

@ -20,3 +20,22 @@ They can include biomonitoring and other applications.
Smartwatches and bands are often connected to a smartphone.
On [Android phones](/wiki/android.md) [Gadgetbridge](/wiki/android/gadgetbridge.md) can be used as
an alternative to proprietary applications by the smart devices' vendor.
## Smartphones and Tablet Computers
Smartphones and Tablet computers are among the most used electronic devices.
They are often used to [communicate](/wiki/communication.md) or
[surfing the internet](/wiki/web_browser.md).
### Remote Control and Screen Mirroring
[Android](/wiki/android.md) based devices can use [scrcpy](/wiki/android/scrcpy.md) to mirror the
screen and allow controlling it by a [Windows](/wiki/windows.md) or [Linux](/wiki/linux.md) system.
### Usage as a Webcam
Smartphones and Tablet computers usually are equipped with a decent camera.
If a [Linux](/wiki/linux.md) or [Windows](/wiki/windows.md) system is missing a
[webcam](/wiki/webcams.md) which is only rarely used it can be useful to repurpose the smart device
as a webcam.
This can be done as explained in the [webcam entry](/wiki/webcams.md#using-a-smartphone-as-webcam).

View File

@ -27,3 +27,5 @@ A [smartphone](/wiki/smart_devices.md) and its camera aswell as flashlight can b
replacement for a webcam.
For [Android](/wiki/android.md) smartphones this can be easily achieved by using
[DroidCam](/wiki/android/droidcam.md).
An alternative to DroidCam with a with decidedly better resolution is
[IP Webcam](/wiki/android/ip_webcam.md).