Streaming OF application output to a web browser

Hi friends,
I am playing with the idea of sending the output of an OF application over the network, so that it could be played by a web browser. The output could be some processed input from webcam, or anything else of course.

Searching in the forum only led me to this thread Live video streaming to the web from OF but it seems they were just experimenting and the results were not so great.

Of course an OF-only solution would be the optimum, but even using external tools (VLC? FFMPEG? Something via Syphon/Spout?) would make for a good start.

Did anybody have some success with this, or may be a working solution ready?

The preferred platform for this project is Windows, if this matters… the idea is to read an NDI stream, apply some kind of processing and then stream it (in my case over LAN, but could be over the Internet as well) to a browser.

Thanks for helping, any suggestion is welcome :slight_smile:

ofxHTTP has a lot of capabilities in this regard. Video, arbitrary data, server side events, web sockets, jsonrpc, etc.

Thank you, the addon is mighty to say the least! I’ll give it a try for sure.

It looks like the “example_basic_server_mjpeg_video” example is worth studying. Are there any docs for the API or the info is to be found browsing the source? The master branch readme mentions API docs are available but there is no link pointing to them

I just fixed the link … unfortunately there isn’t a ton of additional documentation apart from the api and the examples. Feel free to ask if you have questions as there are quite a few users.

1 Like

Just a small contribution. I’m looking for send an OF video output as a Webcam but i don’t find a good way for the moment.

On Mac, i can only use a software like CamTwist, and transform my Syphon Output as a Webcam input, but the performance are middle…

I just used a Matrox Maevex 5150 Encoder for a project. It takes an HDMI input and converts it to a plain, openframeworks-usable RTSP h.264 stream.

It’s not super cheap but works like a charm :slight_smile:

@vollstock is the device available as a webcam input or does it need some external SDK? What about HDMI audio?

This is not what the topic was originally about but it could help me solve aun unrelated problem :slight_smile:

It provides a standard rtsp stream at rtsp://<IP-ADDRESS>. No need for the SDK, just use VLC, or GStreamer. I am displaying the stream using ofGstVideoUtils like this

stream->setPipeline("rtspsrc latency=0 location="+url+" ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert", OF_PIXELS_RGB, true, 1920, 1080);

I have not testet audio but you can select HDMI as an audio source in the config utility.

Here is a screenshot:

I am using it to display a laptop signal inside an openframeworks app.

wow cool :slight_smile: I didn’t know about ofGstVideoUtils… looks like it can do a lot of interesting things!

Is there any documentation for it, besides browsing the source?

The Maevex 5150 is cool too, but, gosh, it is listed at 3500€ on Amazon… a little too expensive for me to experiment with!

well the openframeworks video docs

The snippet with setting a pipeline I got somewhere from the forum or github. Don’t remember where :neutral_face:

The pipeline itself has nothing to do with openframeworks, it’s GStreamer. So if you need to learn about those, here are the GStreamer docs

There is a bundle with an encoder and a decoder. You only need the encoder which is usually sold for around 900 €.