DEV Community

Discussion on: RTMP/RTMPS relay with stunnel

Collapse
 
ancienttom profile image
Thomas J. Strike Jr. • Edited

This doesn't work for me. It neither works from a ffmpeg command line string or from your direction with nginx. You use rtmps in ffmpeg which causes librtmp to stall out in my ffmpeg build. I've read that librtmp uses openssl to encode with and it is not enabled on my ffmpeg build. It appears with all the Googling I've done that OpenSSL is not a library that librtmp uses but rather a running service. I can't find anywhere that explains enough to get ffmpeg working with rtmps and OpenSSL.

Why do you need to use stunnel and nginx in the first place if you can stream to Facebook using an rtmps encoded stream from within ffmpeg. Shouldn't ffmpeg be able to stream directly to Facebook if librtmp was working properly?

I came here in desperation for a work around to get a rtmps stream working to Facebook in the light that I cannot get a ssl/tls connection going with ffmpeg. If you have any knowledge on how to make ffmpeg output a rtmps stream or how the librtmp library works and how to get it to do what it is supposed to when using a rtmps call, I would really appreciate the help.

You know how you know that you've exhausted all searching for information that you need? It's when you keep Googling using different key phrases and each time, all the links on Google come up purple.

Collapse
 
podfish profile image
Steven ɥsᴉɟpod Ketelsen 🎙️🐟🥚

Are you building ffmpeg from source or using a package manager? what distribution/OS?

Collapse
 
ancienttom profile image
Thomas J. Strike Jr. • Edited

Working with a Debian OS fork. I got it sorted out about a week ago with the fine fellows on the ffmpeg Freenode IRC channel. It turns out that I was fighting a bug in ffmpeg that when it came to encryption wasn't doing it right and was propagated to every source they had. That's why when I tried using it with nginx on my Centos server and my Ubuntu desk top, I ended up with the same failure to connect to Facebook. I am now using a version of ffmpeg that I compiled myself from the latest updates on github (with the encryption fixed). I compiled it using the internally supplied rtmp handler and added in gnutls. It now works like a champ.

I haven't taken the use of stunnel in this application seriously. It was just an act of desperation of trying the stunnel work around to get something working. The right tool for the right job would be ffmpeg.

Thread Thread
 
podfish profile image
Steven ɥsᴉɟpod Ketelsen 🎙️🐟🥚

I'm using ubuntu server and didn't have any issues whatsoever. the ffmpeg bug must have been introduced later.

For me it's convenient to embed the ffmpeg command in the rtmp section of the nginx config because i'm streaming from a network device and using nginx to push to multiple ingestors (fb live, periscope, yt) and will eventually be presenting a variable rate HTTP Live Stream and an icecast mp3 stream on my site.

Thread Thread
 
ancienttom profile image
Thomas J. Strike Jr.

Yes, from what I understand is that the bug is fairly recent and now living in all the OS repositories. If you are not pushing rtmps, encrypted, then you would not notice it.