From 3ec5e9137954eb069faaee419f7d82207f3f9be5 Mon Sep 17 00:00:00 2001 From: hipersayanX Date: Thu, 27 May 2021 21:47:45 -0300 Subject: [PATCH] Updated Usage and examples (markdown) --- Usage-and-examples.md | 78 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/Usage-and-examples.md b/Usage-and-examples.md index b2beb4d..4604728 100644 --- a/Usage-and-examples.md +++ b/Usage-and-examples.md @@ -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).