GStreamer video capture using USB web camera on macOS

Viewed 2954

I'm working on developing gstreamer app on macOS. I succeeded to get video captures of MacBook's inside camera.

$ gst-launch-1.0 autovideosrc ! osxvideosink

However, I don't know how to get video captures from attached USB camera. I looked at properties of autovideosrc element and wrappercamerabinsrc element, but couldn't find the proper one to specify the devices while I can specify device property to v4l2src.

How can I get video stream from USB camera using gstreamer on macOS?

Any help would be appreciated!

2 Answers

Finally I found how to do it.

$ gst-launch-1.0 avfvideosrc device-index=1 ! osxvideosink

Thanks @MarkSetchell

osxvideosink didn't work for me. I used autovideosink instead.

gst-launch-1.0 avfvideosrc device-index=1 ! autovideosink
  • Also, I found device-index=0 didn't work. My external webcam was device-index=1, and my built-in laptop webcam was device-index=2.
Related