ofxVideoPipe - addon for reading from a video pipe/FIFO created by FFMPEG

I couldn’t find a good way to stream RTMP in OpenFrameworks, so I wrote one. It should work with any kind of input that FFMPEG supports, and also with any software that can write a stream of PPM images to a named pipe.

Detailed instructions on usage are in the README.


(Sorry if this is a duplicate post. I tried posting a few days ago but it got marked as spam and still hasn’t shown up in the forum, so I’m trying again.)

Here’s a screenshot:


@heisters thanks for this addon. working nicely, but i’m getting major latency with this - about 7 seconds - have you had that issue or seen a work around that? thanks a lot,

more specifically:basically I am running " ffmpeg -i “tcp:// playpath=foo.sdp” -an -f image2pipe -vcodec ppm -r 25 -y bin/data/fifo.ppm" on command line and running the app . it works like your screenshot above. I’m streaming video via TCP directly from Parrot AR drone on that IP and port 5555. using ffplay (ffplay tcp:://" in command line) I can stream the video no problem, no delay, in an ffplay window/ app. but i want to run the video in a OF app in real time so thought your library would be perfect, but i dont understand why there is such latency ?

thanks again!

I haven’t done any latency measurements, but I’m not too surprised. For a video frame to get into OF, it needs to be downloaded, transcoded to PPM, pushed into the pipe, read out, and then decoded by ofxVideoPipe’s not-very-optimized code. ofxVideoPipe is really aimed at non-realtime streams that have a format without any better options for decoding.

Are you running your app in release mode? Debug symbols would probably slow it down a lot.

If your drone does MJPEG, you might have better luck using that with something like ofxIpVideoGrabber. That would skip most of the steps ofxVideoPipe needs, and I believe it uses some pretty well optimized JPEG decoding. I’ve gotten ~200ms latency on 1080p video streams with another MJPEG library.