-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support writing to video loopback: Libavdevice and set muxer #43
Conversation
Allows output to devices, including the video4linux2 virtual loopback.
Two things of note to reviewers:
|
Allows forcing yuv420p, needed for screensharing with zoom
Thanks for adding this, seems a useful thing to have 👍 |
I tried using this with OBS and while the framerate hit in-game was mostly livable, the output recording was beyond the point of choppy (effectively PowerPoint mode). In X11 OBS records pretty fluidly. Not sure if this is something even addressable in this PR, but figured I'd bring it up. I can put together a clean recording (lots of background noise in my test recording) for demo purposes if desired. Update: compared against wlrobs - sway's CPU usage goes to 100% with wlrobs (unlike with wf-recorder), but the output recording is basically equally as smooth as what I see during gameplay on my actual monitor. |
@klardotsh I guess that piping through a file and then OBS picking that up can introduce significant delays. I would consider this a problem only if such choppy recording happens when using only wf-recorder to directly write to a file. |
@ammen99 For giggles I went ahead and tested this branch/fork with recording straight to an MP4 file and it seems to be smooth, so indeed it's something with OBS's recordings. OBS's preview pane seems to render smoothly with this branch's V4L2 loopback device, so I'm assuming screensharing (ex. over Zoom/Hangouts/etc.) would be smooth too, and it's just OBS save-to-disk (and likely Twitch streaming, though I haven't tested that yet) that's broken. tl;dr nevermind! |
I've rebased this patch on master, and by turning off "use buffering" in the v4l2 source in obs, I have a silky smooth stream! Could this be pushed for a merge? My rebase is here: https://github.com/RX14/wf-recorder/commits/jej/loopback-support I edited the |
@RX14 thats great, thanks. Can you open a new PR? |
Ended up finding https://hg.sr.ht/~scoopta/wlrobs, but, sure I'll open a PR of my branch. |
This shows up as semi-reasonable quality for me on my end but the person viewing my "webcam" gets garbage, probably sub-320p-type quality. Is there a method using |
What
--muxer
option for setting output format when it can not be guessed from the filename--pixel-format
option needed to setyuv420p
so video loopback output is compatible with zoomcodec->pix_fmts
does not list any supported formats.Why
Allows wf-recorder to write out to various devices, and in particular the video4linux2 loopback. This can be picked up as a virtual webcam in screen-sharing applications like zoom, or can be displayed within a window with programs like
GUvcView
.Usage
libavdevice-dev
andv4l2loopback
. On my system the latter was packaged asv4l2loobpack-utils
andv4l2loopback-dkms
.modprobe v4l2loopback
v4l2-ctl --list-devices
to confirm the "Dummy video device" is present, andv4l2-ctl --device=/dev/video2 --info
to get further infowf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video2
to start screen output. For zoom addpixel-format=yuv420p
.guvcview --device=/dev/video2 --gui=none
. You can alsoffplay /dev/video2
.