Virtual Webcam (Linux): Difference between revisions
Jump to navigation
Jump to search
Line 43: | Line 43: | ||
* …(use the wizard)… | * …(use the wizard)… | ||
These capture can be pretty large, so transcoding might be ca good idea: | These capture can be pretty large, so transcoding<ref>https://trac.ffmpeg.org/wiki/Encode/H.264</ref> might be ca good idea: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
ffmpeg -i Capture\ 2023-09-07_01_8min.avi -c:v libx264 -preset slow -crf 30 -c:a copy output.mkv | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Where CRF is the quality (0==lossless, 51==useless). | |||
= Footer = | = Footer = |
Revision as of 10:00, 7 September 2023
Why?
To have fun, stream a movie to your buddies using a VC or just attend a meeting while streaming a previous recorded video showing me as attentive as possible. I'm such a nice subordinate…
HowTo
Installation
# zypper install v4l2loopback-utils v4l2loopback-autoload v4l2loopback-kmp-default
Creating a devices
The kernel module does that per default:
# v4l2-ctl --list-devices
OBS Virtual Camera (platform:v4l2loopback-000):
/dev/video0
Integrated Camera: Integrated C (usb-0000:06:00.4-3):
/dev/video1
/dev/video2
/dev/video3
/dev/video4
/dev/media0
/dev/media1
#
Streaming
ffmpeg -re -i VIDEO_TO_SHOW.m4v -vf format=yuv420p -f v4l2 /dev/video0
Loop it:
-stream_loop -1
Testing the stream
Using VLC
Capture from a video camera
Media→ Open Capture Device…
- Select your camera
- Choose
Stream instead of Play (Button)
- …(use the wizard)…
These capture can be pretty large, so transcoding[1] might be ca good idea:
ffmpeg -i Capture\ 2023-09-07_01_8min.avi -c:v libx264 -preset slow -crf 30 -c:a copy output.mkv
Where CRF is the quality (0==lossless, 51==useless).