gstreamer create virtual device on OSX

5k Views Asked by At

I would like to create a virtual camera device using gstreamer on OSX

I am able to create it on *nix systems using

 gst-launch-1.0 -v videotestsrc pattern=snow ! video/x-raw,width=1280,height=720 ! v4l2sink device=/dev/video1

On osx I get a erroneous pipeline v4l2

I would like to be able to pipe the output into applications such as skype etc.,

Any pointers in this direction ? Should I use syphon?

2

There are 2 best solutions below

1
On BEST ANSWER

The way to go is to use CoreMediaIO framework. You can create a virtual device using the framework and feed in any stream using a wrapper. Some pointers for wrappers can be seen here.

4
On

This gstreamer command:

./gst-launch-1.0 -v videotestsrc pattern=snow ! video/x-raw,width=1280,height=720 ! osxvideosink

Works on OSX Sierra if you install Gstreamer on OSX from the following packages which will install in the /Library/Frameworks/Gstreamer.framework/ folder. Execute commands from the Commands subfolder.

https://gstreamer.freedesktop.org/data/pkg/osx/1.12.0/

This link has a standard package, a development package and a dmg with lots of smaller distribution packages. To pipe output you will need to choose an appropriate sink - either appsink, and write it yourself, or one of the many other sink types in Gstreamer. Hope that gets you started!