fzwoch / obs-teleport

An OBS Studio plugin for an open NDI-like replacement. Pretty simple, straight forward. No NDI compatibility in any form.
GNU General Public License v2.0
438 stars 16 forks source link

Dedicated cli app for sending usb webcam/capture card without OBS overhead. #29

Closed BuyMyMojo closed 2 years ago

BuyMyMojo commented 2 years ago

This could be useful for simple sending of video without needing to have OBS running on the source hardware. There is an issue of Windows, Linux and Mac using different frameworks for their usb devices so it might require separate versions for each which isn't that nice.

Linux video lib: https://github.com/blackjack/webcam Windows API Example: https://github.com/SaturnsVoid/Windows-API-Capture-Webcam Weird cross platform lib that uses electron: https://github.com/vee2xx/camtron

Outside of the last cross platform one I don't know of any libs that would work on mac

fzwoch commented 2 years ago

Yeah, I think this exceeds the scope of this project by far. Everyone can join up and make a dedicated application for this specific use case, I'm pretty sure it won't be me.

fzwoch commented 2 years ago

Some thoughts. If I had to do it, I would consider using it via the help of GStreamer. It offers various camera sources methods for different platforms and allows capturing in JPEG format already if the camera supports it. Since the Teleport protocol is quite simple one would only have to inject a little header before each frame.

The media pipeline could look a bit like this:

v4l2src ! image/jpeg,width=1920,height=1080,framerate=30/1 ! appsink

appsrc ! tcpserversink

Here the application would hook into the appsink, gets the jpeg buffer and adds the required header and pushes the new buffer into the second pipeline's appsrc. This will end up in the tcpserversink which would act as an access point for the OBS source plugin.

You'd still need to cover the multicast announcement so the service will appear in the OBS source list.

fzwoch commented 2 years ago

Then again, just use GStreamer RTSP server library to provide an RTSP feed from the camera and use OBS's media source..

fzwoch commented 2 years ago

https://gist.github.com/fzwoch/701599167e3b71bd48885ba423b4b24d