Updated Usage and examples (markdown)

This commit is contained in:
hipersayanX 2021-05-27 21:47:45 -03:00
parent 9ebc312b81
commit 3ec5e91379

View file

@ -1,11 +1,85 @@
**In-progress**
# Listening to events
You can keep reading the global virtual camera events like device add, removal, and default picture changes with:
```
AkVCamManager listen-events
```
To stop listening to events, press Ctrl-C to stop the manager.
# Virtual camera clients
You can list all programs using the virtual camera with:
```
AkVCamManager clients
```
It will return a list of PIDs and the path of the executable using it.
# Examples
## Streaming
The manager can read the raw video frames stream from the standard input as:
```
frame_producer_program | AkVCamManager stream AkVCamVideoDevice0 INPUT_FORMAT WIDTH HEIGHT
```
## Streaming with FFmpeg
You can stream to the virtual camera with:
```
ffmpeg -i video.webm -pix_fmt rgb24 -f rawvideo - | AkVCamManager stream AkVCamVideoDevice0 RGB24 480 360
```
The input format must be one of the supported ones, you can list them with:
```
AkVCamManager supported-formats --input
```
Since the manager will send the frames as fast as FFmpeg decode them, you can regulate the stream passing the **--fps** flag to set the input stream frame rate.
```
ffmpeg -i video.webm -pix_fmt rgb24 -f rawvideo - | AkVCamManager stream --fps 30 AkVCamVideoDevice0 RGB24 480 360
```
## Capturing
Any capture program will work just fine, here is an example with ffplay:
**Mac**
First at all you must list all AVFoundation devices:
```
ffmpeg -f avfoundation -list_devices true -i dummy
```
Then, once you in which DEVICE_INDEX is located your virtual camera, you can ply it with:
```
ffplay -f avfoundation -i DEVICE_INDEX -framerate 30
```
If you have any question, read the [FFmpeg's wiki](https://trac.ffmpeg.org/wiki/Capture/Webcam#AVFoundation).
**Windows**
First at all you must list all DirectShow devices:
```
ffmpeg -f dshow -list_devices true -i dummy
```
Then, play the virtual camera by it's name:
```
ffplay -f dshow -i video="Virtual Camera"
```
If you have any question, read the [FFmpeg's wiki](https://trac.ffmpeg.org/wiki/DirectShow).