hydra-synth / hydra

Livecoding networked visuals in the browser
https://hydra.ojack.xyz
GNU Affero General Public License v3.0
2.21k stars 269 forks source link

Loopback: using hydra like a fake webcam #83

Open rektide opened 4 years ago

rektide commented 4 years ago

Hello! Hello hello!

Is there any way to make Hydra look like a webcam on a computer? Hydra is such cool tech, & it's such a great tool to be able to play with media over. It'd be wonderful if it could be "fed" back in to other programs running on the computer, such that I could use Hydra to output to my video conferencing system, or to my streaming system.

This would probably be operating system dependent. I happen to be on Linux. I feel like there's probably some gstreamer pipeline I could launch from the command line that could make this happen, but it's not my domain. I'll try to report back to this thread with what I find. It'd be lovely if others had resources or ideas or knew how to make Hydra "loopback" like this.

rektide commented 4 years ago

Just ran into this tweet, on a new Snapchat "snapcamera" feature that so functions like an effect-applying loopback device.

Snapchat filters for EVERY video conferencing app on your computer via virtual camera!

https://mobile.twitter.com/seidtgeist/status/1240338210984808450

Loopback ftw!

yhancik commented 4 years ago

On Windows, there's a Virtual Camera plugin for OBS that works rather well (honestly better than most virtual cameras I've tried in the past)

Webcamoid is the only multiplatform solution I know, but on Windows I found it extremely unstable.

ojack commented 4 years ago

Hi, I would love this, but haven't found a way. I couldn't get webcamoid to work on my computer (Linux). Snap camera looks great but doesn't run on LInux?

yhancik commented 4 years ago

The only other loopback solution I'm aware of is https://github.com/umlaeute/v4l2loopback .. but it only creates virtual devices, so you'd have to handle the capture (or any other way to stream to that device) yourself. Apparently you can use GStreamer for that https://github.com/umlaeute/v4l2loopback/wiki/GStreamer (never tried though)

rektide commented 4 years ago

specifically the Desktop Capture As Producer section has the gst-launch to try. when creating a v4l2loopback device, you'll get a new /dev/videoX device (or 4). adjust the last pipeline element device= parameter to point to that new device:

gst-launch-1.0 -v ximagesrc startx=1 starty=1 endx=320 endy=240 \
  ! videoconvert \
  ! "video/x-raw,format=YUY2" \
  ! v4l2sink device=/dev/video1