gstreamer streaming questions

Hi. This is aimed at Arturo really, or anyone else who has gstreamer experience.

I am using gstreamer on Windows (Codeblocks, OF 0061 for testing as these code posts are quite old), following these instructions

The fingers movie examples works as above.

I’m looking for a solution to stream pixels over the internet between two OF apps.

Arturo I got your ofxGstVideoRecorder from here

I can record my pixels to a mpg file, that works fine. I do see this in the console though, any thoughts on this critical error at the bottom?

  1. Arturo, is the link above the most up to date ofxGstVideoRecorder? Searching github, no files here

But this file looks slightly different, has much changed?

When I record a video the colours come out wrong, unless I make this change suggested here

  1. When I try udpStreamTo() or tcpStreamTo() in ofxGstVideoRecorder in the console I get this in a repeating loop

Any thoughts?

  1. If I want to just send out on network via tcp or udp, do I just setup gstreamerRecoder with either udpStreamTo / tcpStreamTo, or do I need to call setup too?


The reason I ask is that it would be weird to do setup and have a filename in if I am just sending on network. If I don’t call setup(), how does the receiving app know what format to expect (I mean, I wouldn’t have set a codec to encode before sending) i.e. when you receive you do…

// receiving h264 udp stream from gstreamer udp server like ofxGstVideoRecorder  
gst.setPipeline("udpsrc port=4444 caps=\"application/x-rtp, media=video, clock-rate=90000\" ! rtph264depay ! decodebin ! ffmpegcolorspace");  

  1. I tried a sender and receiver on the local network hoping that despite the console errors it might work, but alas on the receiver the pixels weren’t showing anything.

In the case of tcp, is there any way at either end of telling if I am connected? Or debugging in udp to see if any data is being received?

Many thanks in advance,

I haven’t updated ofxGstVideoRecorder in a long time. I know Damian was using it for the artvertiser but don’t know which modifications he did.

To send to a network socket, although it’s weird you need to use tcp/udpStreamTo and then setup, since the pipeline already has a sink it won’t use the file name. I did this as a proof of concept so the api is not very clean.

To test gstreamer the best is to use gst-launch from a console and then pass the same pipeline you will use from OF. Once you get it working with gst-launch try in OF if it doesn’t work then you know that the problem is in my code and not in the pipeline being used.

look for network pipeline gstreamer for more info but basically a gstreamer pipeline is a sequence of elements separated by ! so for example to read a file and show it in a window you’ll do

gst-launch filesrc location="" ! decodebin2 ! autovideosink  

which creates an element that reads a video file, passes it’s contents to a decoder which passes the decoded content to a videosink that creates a window to show the video.

In OF the gstUtils actually creates an appsink which allows to get the decoded pixels content from the last element in the pipeline to upload it to a texture.

For a network conection the idea is more or less the same but in the sender you’ll feed some content to the pipeline using appsrc (the oposite to appsink) and then encode it add some network payload and send it through some kind of network sink.

It took me a while till i managed to actually send video through the network, and i guess some things can have changed from version to version so you’ll need to try with different parameters and pipeline elements till it works

To use it with 007, you’ll need to substitute ofGstUtils with ofGstVideoUtils.

Anyway will try to make this code cleaner + 007 compatible and upload it to github when i have some time

Arturo, any luck porting this to OF 007 or getting together a working example?

Anyway will try to make this code cleaner + 007 compatible and upload it to github when i have some time

Would be great to have a solid, working example of streaming over the network using gstreamer… but after bouncing around the forums still no luck.

I have managed to send between 2 apps on the same machine using this code from the following post: However, I can’t manage to send across multiple machines on different networks. Do I need to set up a dedicated server for this? How do I resolve the IP addresses?

Thanks in advance,