3

Proposed Deprecation of FTL Protocol in OBS · Discussion #4021 · obsproject/obs-...

 2 years ago
source link: https://github.com/obsproject/obs-studio/discussions/4021
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Overview

As previously mentioned in #3816, #3834, and #4018, the OBS team has internally discussed deprecating FTL and eventually removing it from OBS. I'd like this discussion to serve as a means of communicating intent and setting expectations, helping us see if our expectations for timing are realistic, evaluate what alternatives the community would like to see put in place the most, and hear out what reasons we might want to reconsider the deprecation of FTL support.

Rationale

We would like to remove FTL support from OBS for the following reasons:

  • FTL was created by Mixer, who lead its development. With Mixer's demise, we consider FTL to be dead technology.
  • While the FTL SDK is open source, the original server components are not. There are a variety of reverse-engineered server implementations available, but they are fragmented. We would prefer to encourage service providers to use more widely-used standardized protocols instead.
  • FTL support in OBS has always been buggy and problematic, and would break in mysterious ways for many users. While we could invest development time into debugging these issues, the opportunity cost of maintaining FTL support is far greater now that the protocol's progenitor and primary consumer is now defunct.

Timetable

At present, our plans and timetable are as follows:

Date Action

March 1, 2021 Stop accepting new FTL services

March 1, 2021 Mark FTL functions as deprecated

Q4 2021 Release WebRTC support in OBS

Q3 2022 Remove FTL from OBS

We plan to deprecate FTL on March 1, 2021. Until March 1, 2021, we plan to continue to allow services to add entries using FTL ("output": "ftl_output",) to the plugins/rtmp-services/data/services.json file via the usual pull request process, though we highly discourage choosing FTL at this point. Starting March 1, 2021, we will no longer accept new additions for entries that use FTL to our services list.

To provide an alternative to current FTL users, we will begin work on implementing WebRTC support in OBS. This currently does not have a set delivery date, so for now we are using Q4 2021 as a rough target.

After 9 months of WebRTC support being available in OBS, we plan to remove FTL support (all code using FTL and all services entries for FTL ingests) from the OBS codebase, meaning the first major or minor OBS release that comes 9 months after WebRTC release will not support FTL.

This timeline gives services using FTL about 1 year to decide how to replace FTL and work towards that goal.

Alternatives to FTL

The primary advantage of FTL that advocates point to is its low latency (often less than a second screen-to-screen) compared to RTMP (often 2-3 seconds or more screen-to-screen).

Currently Supported by OBS

Currently, OBS supports the following output protocols:

  • RTMPS

Of these options, the protocol that most closely meets the needs of people wishing to stream at low latency is SRT, which is our current recommendation for services currently using FTL.

Under Consideration for OBS Support

  • WebRTC

WebRTC

WebRTC support is not currently in OBS. While support could be implemented, the main issue is that signaling methods between the broadcaster and the server are as varied as there are server implementations. Ideally, we could implement a pure WebRTC implementation and allow services to provide SDP signaling plugins that allow them to communicate with OBS using whatever system they want. All that said, none of this has progressed beyond the idea phase for official inclusion in OBS.

The primary downside to WebRTC is that implementation depends on the server that you are communicating with, such as Janus, Wowza, Millicast, Mediasoup, Evercast, etc.

There have recently been some efforts to create a standardized WebRTC signaling/ingest using HTTPS called WISH. While this project is not complete, it is something we are keeping our eye on for future developments.

More on WISH:

RIST is also not currently supported by OBS, and so far we have not received a great deal of demand for it. That said, the development of the protocol has been done in a much more open manner, and there are many users of the protocol in production. Furthermore, it is RTP/UDP-based, like FTL, so it could be a possible alternative for FTL users.

More on RIST:

Stakeholders

YouNow (@rsiv) currently uses FTL. Glimesh (@haydenmc) appears to have been planning to use FTL. @GRVYDEV maintains Project Lightspeed, which ingests FTL. @NCommander appears to have recently started an effort to standardize FTL development.

Replies

20 comments
61 replies
edited

on Jan 5, 2021

Maintainer

Author

What I want to know is what FTL offers the world that other protocols, such as WebRTC and RIST, do not? RIST is an open RTP/UDP standard, and WebRTC has widespread adoption and can solve a lot of the same problems. If those protocols had been supported by OBS before these FTL-based projects had been started, would they have still been started? What is the advantage of FTL over other protocols beyond the mere fact that OBS supports it?

It's worth noting that OBS is very likely going to begin working on adding generic WebRTC support, with the ability for services to create plugins that offer their signaling method of choice.

0 replies

While SRT is supported it does not seem that there is anything using it? I haven't gone all the way through SRT yet however I am struggling to even find adequate documentation that I could even base an implementation off of. Furthermore, I am not entirely sure how FTL negatively impacts OBS right now to justify its removal without the implementation of a suitable alternative (ex. WebRTC, RIST). What is desired, in my use case at least, is a straightforward protocol to deliver RTP packets and FTL provides that with a very easy implementation. I would also like to challenge your classification of FTL as a dead technology. In my opinion a dead technology is one which is no longer used or adopted, yet there are multiple services still using FTL including mine. There are also plans to standardize and continue the development of the FTL protocol and I feel that deprecating it without at least seeing what the future holds would be jumping the gun a bit.

2 replies
edited

dodgepong on Jan 6, 2021

Maintainer

Author

While SRT is supported it does not seem that there is anything using it? I haven't gone all the way through SRT yet however I am struggling to even find adequate documentation that I could even base an implementation off of.

This might be a reasonable place to start: https://github.com/obsproject/obs-studio/wiki/Streaming-With-SRT-Protocol

I would also invite @eric to share some of his experiencing using SRT in production settings.

Furthermore, I am not entirely sure how FTL negatively impacts OBS right now to justify its removal without the implementation of a suitable alternative (ex. WebRTC, RIST).

From the OP:

FTL support in OBS has always been buggy and problematic, and would break in mysterious ways for many users. While we could invest development time into debugging these issues, the opportunity cost of maintaining FTL support is far greater now that the protocol's progenitor and primary consumer is now defunct.

Essentially, it comes down to a support problem, which brings with it the weight of maintenance. People come into our support channels complaining about problems and we track down their problems to their use of FTL for one reason or another. We could spend time working on fixing OBS's issues with FTL, which could be time-consuming, but it's hard to justify doing that when so few people are using it anymore, especially with Mixer dying. It was developed to solve a Beam/Mixer problem, not an Internet problem, and as such it wasn't really developed with openness in mind (as evidenced by Mixer's refusal to release a server-side implementation). If we are going to spend time on a protocol in OBS, we would rather it be one that was open from the beginning, and actually has community and industry buy-in.

The only reason YouNow, Glimesh, etc. even bothered to base their services on FTL wasn't because it was a good protocol, but for two reasons: 1) it was supported by OBS, and 2) it wasn't RTMP. In my opinion, those aren't good enough reasons to pick a protocol. Standardization should also be a factor, or else every company out there would invent their own proprietary protocol and want to get it into OBS. I know, because other companies have tried to do that in OBS -- they propose some sort of non-standard janky protocol, and try to get OBS to support it for their own use. It has happened, and we've turned them down. If I'm being completely honest here (and this is my own opinion), I don't think we should have accepted the FTL output in OBS to begin with, and it was aggressive of Mixer to push it by fiat from the beginning.

The only reason FTL still exists at all is because still OBS supports it. It's a reverse chicken-and-egg problem.

If your issue is that there isn't currently a viable alternative to FTL in OBS for your purposes, then fine, that's a valid concern. We would be willing to talk about adjusting the timeline until a viable alternative is in place (most likely WebRTC). But I have yet to hear the merits of why FTL itself should continue to exist in light of other protocols that do the same thing but with more industry support and existing standardization. I'm all ears, though.

This might be a reasonable place to start: https://github.com/obsproject/obs-studio/wiki/Streaming-With-SRT-Protocol

It is not. SRT cannot compete with the low delay of FTL at all. And in addition to that, in order to deliver the video to a web browser, this requires both buffering and remuxing of the packet stream, which adds further delays.
Realistic delay for FTL (with h.264+Opus): time to encode a frame + network FIFO latency + ingest forwarding latency + time to decode first i-frame ~50-250ms
Realistic delay for SRT (with h.264+Opus, which you do not support, only AAC-LC works): time to encode a frame + A/V sync buffer delay + network LILO latency for i-frame + input buffer delay + remuxing delay + time to decode first p-frame ~700-900ms (optimistic)

[...] or else every company out there would invent their own proprietary protocol and want to get it into OBS. I know, because other companies have tried to do that in OBS -- they propose some sort of non-standard janky protocol, and try to get OBS to support it for their own use. It has happened, and we've turned them down.

I don't quite understand how adding protocols is a bad thing. At the very least, you should allow the addition of protocols through a plugin that gets installed separately, such that (at least on Windows) your signed and pre-built binaries can be used with any protocol and manually specified ingest server anyone could possibly want. Currently, that's not possible. Yes, someone can fork OBS and build their own binaries, but unless these binaries become well known, anti-cheat systems everywhere will block them from capturing video games (had been a big problem with FTL enabled builds of OBS before it got added to the official releases), require the purchasing (and proper use!) of expensive security certificates from an approved certification authority or just simply fail to run because modern security systems would block them ("[anti-virus] hasn't seen an executable with this file size and sha2 checksum before, for your safety, you may not run this"). This was the key motivation to even try to get it into OBS, rather than publishing and updating a fork, where whenever an update was released, BattlEye and EasyAntiCheat (the most popular solutions video game vendors were using at the time) would have it blocked, and people would roll back to the older version or never bother to update in the first place.

The only reason FTL still exists at all is because still OBS supports it. It's a reverse chicken-and-egg problem.

That OBS supports it is a bonus. FTL is proven technology. Beam/Mixer have been using it together with Janus for ~6 years (only about 2 of which it has been in OBS).

If your issue is that there isn't currently a viable alternative to FTL in OBS for your purposes, then fine, that's a valid concern.

There is no viable alternative, period. Even using the full WebRTC stack in OBS (current implementations do exist) doesn't offer as low of a delay as using FTL does (it's not a real concern to shave off those 50-100ms, whereas FTL's transport was designed for just that). When using FTL with a good ingest implementation (something that's not quite there, yet, either), getting the internal delays in OBS down would be the next logical step (they're still quite significant sometimes, even though they could be as low as 7-8ms with a GPU encoder these days).

Serious question: Do you take bribes, and if so, how much would it take for you to reconsider?

FTL is the only proven solution that offers a low delay by design, and also the solution that offers the lowest possible delay out of everything else out there. There is (currently) no other way to deliver low latency video like this to a web browser at all, and all the the different transport protocols that are left either inherently impose a significant video delay, require expensive transposition at the ingest (adds a delay!) or can't deal with synchronized video at all (requires a buffer to work, adds delays, and includes a retransmission mechanism that would add accumulative delay whenever an error occurs).

Out of the three reasons you stated, the first two are just plain wrong, and the third one, while understandable, usually comes down to one thing and one thing only: a bad internet connection (be that jitter, overprovisioned and congested routes to the ingest or other forms of packet loss)

2 replies
edited

dodgepong on Jan 6, 2021

Maintainer

Author

Out of the three reasons you stated, the first two are just plain wrong

Can you explain how the first two reasons are just plain wrong? From the OP:

  1. FTL was created by Mixer, who lead its development. With Mixer's demise, we consider FTL to be dead technology.

This is at the very least a matter of opinion, and our opinion is that it's dead. If you have a different opinion fine, but that doesn't mean the reason is "wrong". If you want to keep FTL around, then your job is to change our opinion. Convince us that FTL is not actually dead and is worth keeping around in context of other standards that had more standardized and open development with more industry buy-in.

  1. While the FTL SDK is open source, the original server components are not. There are a variety of reverse-engineered server implementations available, but they are fragmented. We would prefer to encourage service providers to use more widely-used standardized protocols instead.

Are you suggesting that Mixer actually did have an open source server component released publicly? Can you link it to me?

and the third one, while understandable, usually comes down to one thing and one thing only: a bad internet connection

Are you offering to take ownership of the FTL implementation in OBS's code base, then?

Are you offering to take ownership of the FTL implementation in OBS's code base, then?

This is actually something that we have been discussing and may be willing to do

  • Jay who's in the broadcast industry and with whom I did some tests with srt/obs when rewriting the srt output managed to have as low as 100-150 ms latency. You can talk to him on our obs discord server for details.
  • Latency is smaller in ftl than the alternatives (except webrtc ?). But srt or rist trade this off with better network resilience. IMHO lose a bit of latency against quality / stability is not a bad trade-off. Have in mind that many obs users have a bad internet so network congestion management is a big plus.
  • I'd very much like an answer to @dodgepong questions with a comparison to RIST and webrtc. What are the pros/cons of FTL when compared with RIST ? webrtc ? Take note that we're not advocating for any protocol but honestly are eager to learn more.
5 replies
  • Jay who's in the broadcast industry and with whom I did some tests with srt/obs when rewriting the srt output managed to have as low as 100-150 ms latency. You can talk to him on our obs discord server for details.

I am assuming here that this was also SRT to the client player, right?
I have not tried the Wowza Streaming Engine (costs money, there were free options). If someone has access to that and can test the delay with WebRTC delivery (which they now list is supported, it wasn't when I evaluated this last!) on a local network, please do get me some numbers about how many frames a 720p (16:9 aspect please!) 60fps video feed is behind the OBS preview and what the peak and mean A/V desync is like (there are standard tests for this, I don't think this needs explaining).
Nimble Streamer doesn't offer WebRTC output, leaving the only other browser delivery mechanisms to RTMP/HLS and RTSP (requires Flash, which isn't an option in just 6 days!). The former defeats the purpose of even using SRT and both require transcoding and/or remuxing and as such a frame buffer of up to several frames. Using SRT output (which doesn't work in a browser) gave between 80-300ms of delay on a local network. Using a remote network you easily pass the half a second mark, which is twice the delay of what you can get with FTL.
Edward Wu's SRT Live Server tested with similar results, not suitable for browser output, either.

  • Latency is smaller in ftl than the alternatives (except webrtc ?). But srt or rist trade this off with better network resilience. IMHO lose a bit of latency against quality / stability is not a bad trade-off. Have in mind that many obs users have a bad internet so network congestion management is a big plus.

FTL is not resilient on packet loss by design. Its goal is to offer the lowest latency possible. If you add a retransmission mechanism, you need to have a (rather large in this scenario) buffer both on the output and the ingest's input. If you lose a frame, you wait for the next one, because by the time you realize something's amiss, that frame that would need retransmission is already out of date. Instead, you communicate to the output that you'd like to have a keyframe as soon as possible and continue from there. This will cause the video to shortly freeze because a frame was lost, but keeps the delay low, which is what you want here (resilience to be as real-time as possible, rather than resilience to deliver every frame). FTL works over "bad connections" (temporarily congested), it doesn't work over "broken" connections (that is those which intentionally block or drop traffic) or connections with insufficient bandwidth to reliably deliver a keyframe whenever one is needed.

FTL is not resilient on packet loss by design. Its goal is to offer the lowest latency possible. If you add a retransmission mechanism, you need to have a (rather large in this scenario) buffer both on the output and the ingest's input. If you lose a frame, you wait for the next one, because by the time you realize something's amiss, that frame that would need retransmission is already out of date.

I believe your assumption of SRT's inner workings here is incorrect, as far as I'm aware SRT uses forward error correction instead of retransmission for low latency packet loss resilience. (Correct me if I'm wrong)

EDIT: pkviet informed me that RIST does FEC, and SRT does too, but only since the very latest release. SRT used to not support FEC. My point still stands, FEC is better than no resilience by design, and incurs no latency penalty.

FEC is better than no resilience by design, and incurs no latency penalty.

That depends on how it works. In typical failure situations, entire UDP packets (multiple of which would make up a h.264 frame) are lost. To account for this, a significant amount of bandwidth needs to be used for this error correction, and for the example of Reed-Solomon coding in order to recover a frame of which a packet was lost, at least as many more packets with the same size of the lost packets are required. In order to compute the correcting code, you also need an output buffer and compute the counter value over all packets of a frame. This means incurring a delay of at least one frame for both the output buffer and the input buffer (actual delay depends on the framerate as a result), and additionally, the delay of computing the correcting codes. It may be possible to immediately send off what is in the output buffer while the computation happens and then not send any error correction packets, if all packets were delivered error free, but this difficult (you'd need to be able to reliably do all of that in under 3ms) to get right and introduces about the same delay as retransmitting lost packets, possibly a worse one on the ingest, since error correcting computation is required in addition to transmitting extra packets. If packets can be delivered and repaired significantly faster than frames are generated this works out great, in resource constrained environments (typical situation where issues occur) not as much.
Of note, this is overly simplified and only looks at the video aspect of the transmission. You tend to also have audio and possibly other metadata (closed captions, titles, format switches, etc.) to deal with.

There's a lot to unpack here, and I am still digesting the issues brought up by the OBS team & the current situation of the industry, so I'm not quite ready to give my opinion yet.

I do have a question about the timeline though so we can make sure that we haven't wasted the last 6 months of complete volunteer development time on Glimesh :).

We plan to deprecate FTL on February 1, 2021. Until February 1, 2021, we plan to continue to allow services to add entries using FTL ("output": "ftl_output",) to the plugins/rtmp-services/data/services.json file via the usual pull request process, though we highly discourage choosing FTL at this point. Starting February 1, 2021, we will no longer accept new additions for entries that use FTL to our services list.

Glimesh is not quite launched yet, we are close but not close enough to call it yet. The very short February 1st timeline puts real stress on rushing through the remaining work on the project to try and ensure it get's a fighting chance. As I'm sure you know just how popular OBS is for streaming users, launching without first party support for it would be unfortunate. My questions are:

  • Do you require services to be available for users to stream to? Or could we add Glimesh before our launch?
  • If you do require the service to be available, how much flexibility exists around the 1st timeline? Could we have the PR submitted but only merge it when the service launches?
  • Do services.json updates go out frequently, or only with OBS releases? If so, could we merge it before the 1st to line it up with an OBS release?
  • Once we are live, would you allow new regions to be added to the existing services list if they are using FTL?
7 replies
edited

dodgepong on Jan 6, 2021

Maintainer

Author

Hey there! Part of the reason we opened this discussion was to see if the timetable was a reasonable one, so I'm happy to answer questions. I also have a few questions for you, if you don't mind.

Do you require services to be available for users to stream to? Or could we add Glimesh before our launch?

Generally we do check to see if a service is live before we merge a service PR, and we periodically check our services list to see if any existing services have silently died so that we can remove them. That said, there are some services listed that are not "open to the public", so that is not a disqualifier.

If you do require the service to be available, how much flexibility exists around the 1st timeline? Could we have the PR submitted but only merge it when the service launches?

Does your team have a date in mind that you were hoping to submit the PR? If we are going to move forward with FTL deprecation, we probably don't want to push it too far, but we might have some amount of flexibility still in that instance.

Do services.json updates go out frequently, or only with OBS releases? If so, could we merge it before the 1st to line it up with an OBS release?

Services updates are not tied to OBS releases and can be updated independently (and frequently are).

Once we are live, would you allow new regions to be added to the existing services list if they are using FTL?

Any now, my questions for you (which are all sort of variants of each other):

  • What made you decide to use FTL over other alternatives? What alternatives did you consider?
  • If OBS had not supported FTL when you started your project, what would you have done instead?
  • If OBS had supported all major protocols as well as FTL (i.e. all the protocols mentioned in the OP), what would you have chosen, and why?

Thank you for your response, I am of course happy to help explain my point of view here, in addition to @haydenmc's already posted feedback below.

Generally we do check to see if a service is live before we merge a service PR, and we periodically check our services list to see if any existing services have silently died so that we can remove them.

Does your team have a date in mind that you were hoping to submit the PR? If we are going to move forward with FTL deprecation, we probably don't want to push it too far, but we might have some amount of flexibility still in that instance.

Awesome, that seems like we can make something work before the deadline then. We're very close to solidifying our available regions, and once we have that ready we can submit our pull request to add Glimesh to the services list. I'm so very excited about our upcoming launch, and I really appreciate y'all being flexible. I don't see any reason we couldn't get our services changes done before the Feb 1st deadline.

What made you decide to use FTL over other alternatives? What alternatives did you consider?

For us, there were a couple of reasons that FTL was chosen, but it might be helpful to explain the impetus behind "sub second streaming" in the first place. For me, real time engagements are the absolute future, especially in a internet connected, post (or mid) covid world, connecting audiences in real time with video, text, and other interactions is a beautiful way to deal with our ever-disconnected lives. Low latency streaming is not required for all communities, some streamers focus on the game, others focus on their in-game party members, but for the streamers who focus on chat (their community) low latency is paramount. It delivers a level of engagement we're not used to outside of real life and promotes engaging situations where you can feel like a bunch of old friends hanging out. Game streamers, musicians, programmers, and all other types of streamers find the value associated with true sub-second latency and Glimesh is here to deliver that to them.

So when Mixer died, communities were left without a home or even a viable alternative that had the same focus on these real time engagements. We started work on an early alpha preview immediately, joining in real time websocketed chat, along with Oven Media Engine's low latency RTMP => WebRTC & WebSocket streaming setup. We had good results but there looked to be early support issues & scaling issues that meant that OME wasn't quite ready for us.

Shortly after @haydenmc joined and shared the same passion for real time engagements and having worked with FTL before, preached that it could be a solid base for us. When he was explaining it to me the focus was really on the simplicity & reliability of the protocol. As a programmer simplicity excites me, as a nerd carrying on cool technology invigorates me, and as a founder FTL meant that we could deliver our users exactly what they were missing post-Mixer.

If OBS had not supported FTL when you started your project, what would you have done instead

If OBS has not supported FTL, we would have looked for alternatives that OBS did support. Unfortunately, OBS does not have too many hardened protocols for low latency streaming so I feel that might have fell on the multiple-second-latency RTMP and we would have lost something paramount for our community.

If OBS had supported all major protocols as well as FTL, what would you have chosen, and why?

As a small company the balance is always time and functionality. We have to pick and choose to build the best product for our community. My decision criteria would be to find the technology that we are comfortable with, with the required features, that is simple, and has a proven track record of success for sites similar to ours.

I again want to thank you for your time and flexibility, next steps from my side are to get Glimesh added to the services list as soon as possible.

Awesome, that seems like we can make something work before the deadline then.

We'll be on the lookout for your submission!

the focus was really on the simplicity & reliability of the protocol

It's interesting to me that the reliability of the protocol was mentioned as a feature, because if there's one main takeaway I've had from this discussion so far, it's that FTL's dedication to low latency is a double-edged sword whose other edge is low reliability. From @NCommander's post:

The primary difference between WebRTC, RIST, and HST vs. FTL is that FTL is designed to lose packets and intentionally does not give any notion of reliable packet delivery

Indeed, this low reliability seems to be the thing that gave FTL its reputation among our crew of OBS support volunteers as "buggy", as many users' frame dropping problems would be solved by them switching to RTMP on the same network.

@NCommander described FTL as "proven" in terms of its performance. As someone on the service side putting FTL through its paces, what has been your experience while testing FTL in suboptimal network connections, as might be found among a general user populace?

I'd also like to suggest another possibility in terms of the timetable. What if, instead of removing FTL on January 1st, 2022, we committed to implementing WebRTC output that allowed people to create plugins for their SDP exchange method of choice (WISH/Janus/Mediasoup/etc.), and then removed FTL an appropriate number of months after that was released?

So, here's my response, written w/ input from those in the FTL dev group; apologize for the length but I wanted to cover all points here.

So, talking from a historical context, FTL's entire design goal was to get sub second (ideally 500ms or less, real world, we got to 200-250ms) from streamer to the browser under "good" to ideal Internet conditions without add-on software.

To that end, it was specifically designed to skip a muxing step, allow for easy implementation of a O(1) hard real time ingest (a naive FTL ingest can be implemented simply by modifying a few bits of each RTP packet in transit). The entire intent was to implement like Stadia or xCloud in browser, and it was overwhelmingly successful in that role. While Microsoft didn't push Beam/Mixer Plays, the FTL technology has a six year history of doing exactly what it was designed to do.

Creating a new streaming protocol was not done lightly at Mixer, and frankly, none of the alternatives promise to hit the real time concerns of "in browser" streaming that FTL can, and I'm not convinced that even in ideal situations they will.

The primary difference between WebRTC, RIST, and HST vs. FTL is that FTL is designed to lose packets and intentionally does not give any notion of reliable packet delivery. While there is a small retransmission buffer built into ftl-sdk (which was implemented after I stepped away from FTL), it's (as far as I can tell) primarily to smooth out H.264 issues. From the RIST specification, the re-transmission effect is much larger, and doesn't appear to have an upper bound on how far it can queue. The entire intent appears to re-implement TCP/IP reliability onto of RTP. While this will give good performance in good conditions and be manageable in bad, it creates a problem if you need to stay in realtime.

With FTL, it essentially YOLOs each packet (and this plays into the last mile, but I'll get to that). RIST on the other hand is specifically designed as reliable and has a large middleware level to allow resumption in case of stream interruption. While RIST is indeed built on RTP and SRTP, it doesn't specifically promise a latency goal. While it might be possible to get the same low latency performance over RIST, it's not a design goal of the protocol, and TBH, I'm less than fond of tossing out the "known to work" solution for one that is not proven.

RIST’s retransmission facilities are also not really designed for the notion of synchronization. The client can request transmission via block or specific packets, but not to a specific KF interval like can be done with H.264/FTL streaming. While retransmission is technically optional, it does exist in FTL today for a specific purpose. The original VP8/Opus FTL implementation actually didn’t have any re-transmission facilities, and could hit 200-250ms latency real world. I do intend to look at reviving this functionality.

In a RIST world, you send NAKs to get the packet retransmitted and you have a fairly large state machine on-top of that, which basically is TCP/IP implemented onto of UDP with RTP. Furthermore, RIST still doesn’t handle signaling of information like video metadata and similar which is a specific feature that Charon (FTL’s handshake) implements.

While RIST might be a replacement for FTL at some day, it doesn’t actually provide anything over the current implementation, and still requires additional infrastructure to be used. In short, actually adopting RIST doesn’t solve a problem.

This brings me to the topic of WISH/WHIP and WebRTC.

To be frank, I’m not certain why WISH or WHIP is being brought up; given that we have two separate specifications that try to solve WebRTC signaling, it’s pretty clear this isn’t a solved problem.

Before I dig into either, I do want to talk a bit about WebRTC’s own signaling mechanism: the Session Description Protocol (SDP). SDP underpins all WebRTC calls, and is also used in VOIP. It’s a nightmarishly complex handshake, with a very loosely defined standard. When I looked at doing FTL originally, I did actually look at the possibility of building the signaling information into SDP, and decided that the best solution was to run as fast as I can.

WISH and WHIP both appear to be extensions of SDP which means they inherit all the problems with SDP. While it is a slightly old article, this sums up the pain points pretty well: https://webrtchacks.com/webrtc-sdp-inaki-baz-castillo/. I highly recommend going through WebRTC Hack’s section about SDP before advocating any solution built around it.

I’ll start by talking about WISH first: the IETF specification is in the Internet-Draft stage, and still in the Proposed WG state: https://datatracker.ietf.org/wg/wish/about/. I’m not even certain there’s a reference implementation of the specification. Furthermore, WISH is a direct extension of the SDP protocol which means all the pain points are primarily there.

SDP has a fiendishly complex protocol negotiation because its essentially intended to make two VoIP phones from different manufacturers agree on some sorta standard to talk with each other. WebRTC not only uses this for talking to browsers, but adds a very complicated stack of ICE connectivity. Even though things like STUN have gone to the wayside, it’s pretty hard to say that this is a desirable thing.

In contrast, if you can make TCP and UDP connections from point to point, you can stream with FTL because its designed to go in one direction and only has an “accept/deny” state vs. offer/accept machinery. In effect, to adopt WISH into OBS would mean integrating a full WebRTC stack, signaling layer, and more to accomplish what FTL does with two RTP streams, a signaling protocol, and some basic invariants.

There’s also the notion that both RIST and WISH are either new, or still being drafted. While both have the advantage of being an open standard from the get-go, they have no field test history, and neither are trying to hit the original sub second latency goal of the original FTL protocol.

This brings me to SRT. Unlikely RIST or WISH, SRT is specifically designed as a low latency solution. However, SRT has two fundamental problems which make it unsuitable for use on “streamer->web browser pipeline”.

The first is that SRT is not wire compatible with RTP nor does it use the same encoding standard. Part of the trick of FTL is that the packet generated by OBS is in fact the same packet sent to the browser with the least amount of post-processing done in the middle. Based off the benchmarks I did at Beam, each time we mux, demux, or re-encode a packet, we pick up a significant lag since in most cases, you need to have a fully assembled keyframe set to re-encode from location to location.

FTL specifically bypasses that requirement by putting out something that WebRTC (with slight modifications) can digest directly. However, that’s not the only problem with SRT. SRT lacks a signaling mechanism.

FTL’s Charon protocol acts as a signal for its two RTP streams, and can send metadata, signals keep alive, and could be potentially extended if ever needed. SRT merely defines a wire protocol and doesn’t specify any inband signaling. In short, you’d still need something like FTL’s Charon protocol to use SRT, and unless browsers adopt native SRT support, you still won’t be able to hit the same latency benchmarks you can hit with FTL.

There’s also a final thing to consider. At the heart of this discussion, we’re talking about ripping out a proven technology for something that only exists on paper. While theoretically, you could build low latency livestreaming solutions on several of the technologies listed here, no one has actually done it, and proved it works in the real world. FTL has, and it did so for more than half a decade. There’s something to be said for a proven solution.

It is true that under Mixer, FTL wasn’t an open protocol, and the only implementation was Mixer itself. This was not the intent of FTL. FTL was intended as an open standard, and most of my reference notes were posted in the FTL-SDK. MSFT removed them, but they’re still in the git history.

Furthermore, multiple people have reimplemented the server side from scratch using those notes, and the “last mile” part is easily implemented using the Janus gateway which was the same software the first FTL implementations were built on. Furthermore, the FTL RTP streams are essentially designed that the packet coming out of OBS is the packet that will go into WebRTC. The FTL implementation we used only had to change the SSRC in flight, and later ones had to add SRTP when it became mandated.

Most of the work of the FTL standards effort is to essentially create a canonical version since there are some server behaviors that can’t be defined from the client, but on the whole, FTL is well understood, it’s documented (and getting bettered), and we’ll likely either code or canonicalize an existing implementation as the de facto reference implementation, and then resume development to add new features and to bring FTL out of the pit it was left in.

In short, FTL was and is the only standard that is specifically targeting latency as it’s number 1 concern. Neither HST, RIST, or WISH can claim that.

Furthermore, I need to ask a question: what is the ongoing cost to keep this code in OBS? ftl-sdk isn’t what I call a fast moving target, and most of it hasn’t changed in a long time.

8 replies

Hi @NCommander, and thank you very much for this lengthy and comprehensive post. This was the sort of thing I've been looking for.

I confess that I've had to do quite a lot of learning and reading over the last several days to improve my understanding of all these different protocols, so I want to offer my apologies if I've said things in this thread that may not make sense or are even factually incorrect. I appreciate the explanation and context you’re able to provide here, especially as someone who was involved with the creation of FTL at the beginning.

If I’m understanding your post correctly, you’re saying that the advantages of FTL over other protocols are the unique combination of:

  • Priority on low latency above all
  • A built-in, uncomplicated signaling layer
  • Easy transmission to viewers via WebRTC

Is that a fair summary? Did I miss anything?

(The remarks about FTL's success in the real world are fine, but I excluded it from the above list since it isn’t, strictly speaking, a feature of FTL. It is evidence that FTL is a useful protocol, but not a reason FTL is a useful protocol.)

Furthermore, I need to ask a question: what is the ongoing cost to keep this code in OBS? ftl-sdk isn’t what I call a fast moving target, and most of it hasn’t changed in a long time.

I tried to explain it earlier, but I will do so in more detail here. Ultimately, I think it comes down to the very fact that FTL was designed with low latency in mind instead of reliability. When it works, it’s great! When it doesn’t, users complain to us. FTL connections can fail catastrophically with extremely high numbers of dropped frames. Often, this was happening with users that had poor internet connections, but not exclusively. To quote one of our support volunteers:

When Mixer was still up, FTL was a pain to troubleshoot, because we didn't understand it very well, and didn't know what kinds of mitigating factors could be taken. Mostly it boiled down to: Using FTL: Dropped frames, stream looks terrible. Using RTMP: No dropped frames, stream ran perfectly.

The concern here is that a protocol that doesn’t have reliability as a priority translates into more people flooding our support systems wondering why their stream is dying. If the protocol is only intended to work on solid internet connections, then what are users on poor connections supposed to do, and how are they supposed to know if their internet connection is solid enough? Are they SOL? This is something that should be very clearly communicated to the user on the part of both the service provider and the encoder.

On the encoder side, the best solution would be something that could forcibly test users’ hardware and internet connections to verify that they can even successfully stream at all using FTL. But at that point, we’re talking about devoting development effort toward new features and bug fixing -- time that could be spent doing other things. We have an extremely limited development team (1 full-time developer) so we have to constantly make prioritization choices. Thus, we have to ask ourselves if continuing to support FTL is worthwhile, given the death of Mixer and the historical support problems that it caused for us.

In complete fairness, these support issues don’t come up nearly as often anymore since Mixer died. That said, FTL’s very presence in OBS encourages people to use FTL (see: Glimesh), which could raise the support load of the feature back up again. This leaves us with a choice: either deprecate FTL to discourage the continued use of FTL, or leave support in the program and commit to spending dev time/support time on it instead of other things.

In my opinion, the only way the right choice can be made on that decision is to determine whether the existence of FTL at all is justified in context of alternatives. If FTL deserves a place next to the other major streaming protocols, then it deserves support in OBS.

And the answer? Well, that’s what we’re discussing here. I think you’ve made a reasonable case for why FTL is unique among other protocols, which is an important step in favor of keeping FTL support, so thank you for that. Working on formalizing the FTL spec helps with that too.

As a side note, some of my OBS colleagues have suggested that the goal of ultra-low latency above all has not been sufficiently motivated (That is, what is the meaningful, practical difference between a unidirectional stream with 750ms latency vs. 250ms latency? What is the worth of a protocol that can achieve a little bit less latency at the cost of reliability?). Personally I think that discussion is a red herring, as it’s not our job to say why low latency is or isn’t useful. The point is that FTL has less latency than other options, and it’s up to the service provider (and user) to determine whether that feature is useful and worth the reliability trade-off. If they want to yeet packets into cyberspace with abandon, that is their prerogative.

As a side note, some of my OBS colleagues have suggested that the goal of ultra-low latency above all has not been sufficiently motivated (That is, what is the meaningful, practical difference between a unidirectional stream with 750ms latency vs. 250ms latency? What is the worth of a protocol that can achieve a little bit less latency at the cost of reliability?). Personally I think that discussion is a red herring, as it’s not our job to say why low latency is or isn’t useful. The point is that FTL has less latency than other options, and it’s up to the service provider (and user) to determine whether that feature is useful and worth the reliability trade-off. If they want to yeet packets into cyberspace with abandon, that is their prerogative.

I feel that I can speak on this because I can see where you guys are coming from. When I launched Lightspeed I though it was cool and I made it primarily to learn but I also thought it would be cool to have something like this out there that someone can self host (to me its like a 2021 minecraft server for the next generation of tech kids). Anyhow, I have been getting TONS of messages saying that people have been dying for something like this. A lot seem to be coming from the broadcasting industry (see here). I have also seen that someone is considering this for broadcasting a wedding so it really seems like there is a demand for ultra-low latency applications. Lightspeed is by no means a large company (or ever will be) but moreso of a niche application and it would be really disappointing to see FTL support go away. I dont plan to ever submit lightspeed for entry into services.json since we deal with custom servers exclusively but I would really like to see FTL support continue and I am personally willing to help in whatever way OBS needs to make that happen! Thank you again for this discussion and I apologize if I have come across as confrontational in previous posts.

The concern here is that a protocol that doesn’t have reliability as a priority translates into more people flooding our support systems wondering why their stream is dying. If the protocol is only intended to work on solid internet connections, then what are users on poor connections supposed to do, and how are they supposed to know if their internet connection is solid enough? Are they SOL? This is something that should be very clearly communicated to the user on the part of both the service provider and the encoder.

I have to push back on the "protocol is only intended to work on solid internet connections" bit. I've streamed both on mixer and twitch with my horrible 30Mbps down/3Mbps up connection and with the right configuration I had better results with FTL than I ever had with RTMP, with 1/5th the delay and much better video quality. It's possible with the right setup I could've had good results with RTMP as well, but I don't think it's fair to say that FTL only works well with good internet

Howdy all,

Once again appreciate your time and the opportunity to discuss this in an open forum! Happy to answer some of your questions so hopefully you can understand our history of decision making and ultimately our perspective w.r.t. FTL. The answers I provide are from the perspective of janus-ftl-plugin, which is the technology currently powering Glimesh.tv.

The Glimesh.tv project started around July with the demise of Mixer. @clone1018 as the founder of Glimesh can probably provide more context on the relationship between Glimesh and the end of Mixer - but a substantial part of the motivation was to provide a new option for true low-latency (sub-second, and ideally way lower) streaming, as the Mixer shutdown left a void in this space.

At the time, SRT support in OBS had only recently been released a few months prior in mid March. At the time (and arguably still today), SRT in OBS was still a nascent technology - with no SRT services represented in services.json, and no broadly available consumer-facing streaming platforms with SRT support that I could find with a quick search.

As a new platform with many uphill challenges ahead of us, it made the most sense to leverage an existing protocol that had a proven track-record at scale, and what seemed at the time to be solid client support. Plus we knew with confidence from Mixer's example that we would be able to meet the low-latency expectation we set out to achieve.

Knowing what I know now about the perspective of the OBS team and the alternatives available, what would I choose today?

My perspective here is that a lot of these new protocols present a substantial risk. I don't have a whole ton of technical concerns - at the core of the issue, I just need to get a bunch of packets from OBS to my service as quickly as I can - I'm not super nitpicky over how that happens, though niceties like nack/retransmit and forward-error-correction are probably best for a good experience. My biggest concerns are about the politics and shifting industry focus on "what's next."

Right now I see three protocols on the table - SRT, RIST, and some form of WebRTC. SRT is the only choice with support in OBS available today, making that our only alternative available right now. With Glimesh going live soon, that leaves us with the uncomfortable choice of either choosing to support a protocol deprecated on the client-side, or choosing to be one of the first guinea pigs to implement SRT for a large-scale consumer-facing streaming platform.

In general I don't mind being a guinea pig and pushing forward with newer, potentially better technologies - but when I am shipping a product to a customer (a non-technical consumer, no less), a solid, proven foundation to build that experience on is the first priority, and currently that foundation is FTL. Long term maybe the answer is SRT/RIST/WebRTC/etc - but I feel the best approach to reach that future is a gradual transition to these new technologies, migrating off of FTL when we can say with confidence that the new technologies can meet or exceed the existing bar for a good customer experience.

Betting entirely on SRT now would mean we open ourselves up to the possibility that the industry decides to move in a different direction later on - we could spend a few months adding SRT support only to discover that next year it's being deprecated in favor of RIST or WebRTC. With FTL as our backup, we have the ability to experiment with the new nascent protocols without being burned if they don't work out - then once we have some indication that the new protocol has met our expectations and gained enough traction in industry, we can fully commit and pull the plug on the old stuff.

I hope that answers the questions you had, please let me know if there are any areas I can clarify!

Thanks once again for your time and the opportunity to discuss this. I know that dealing with issues like this are burdensome in both time and mental energy, so I really appreciate it!

3 replies

SRT has large and growing support in the professional video broadcast industry in both hardware and software encoders/decoders.

SRT is not currently a good choice for a transport between a server and clients, but I believe is a good option for OBS to server transports.

Currently there are some deficiencies in using SRT with OBS:

  • The configuration of the latency and the max bandwidth need to be specified in the query parameters
  • It isn't intuitive for users as to what latency setting they should set
  • The OBS speedtest won't work

SRT is a basic messaging protocol, with a convention of sending MPEG-TS over it, but it can be used to send anything. It would be easy to find or create a standard for running speedtests and latency tests (or establishing a stream and reading the latency stats from the SRT socket itself) and using that to provide good defaults for latency.

The max bandwidth setting can be derived from the bitrate specified on the encoder for the audio and video streams.

With this ability to measure appropriate SRT latency settings, it would provide fairly low latency (200-300ms in the US if there are POPs on both coasts).

The problem is that the SRT media packets and the RTP one differs and that appears to extend to how frame information is encoded. That means you'd have to convert one to the other at a CPU and latency hit. I don't know how different the two are, but most off the shelf implementations like FFMPEG usually require a full KF interval to transcode across protocols (which was our experience in converting FTL->RTMP). We're using RTP because that's what WebRTC uses to avoid a transcoding, muxing or demuxing step.

I don't deny SRT would work great for low latency video ingest, but in this case, it has to stay low latency to the last mile. It also doesn't define a specific signaling layer (neither does RTP, but FTL provides that role).

SRT header is 16 bytes, RTP header is (at minimum) 12 bytes - more if extension is used..

I've never dealt with video over RTP before I work in call centres so only ever voice and I've only ever seen 12 bytes..

So with the RTP header removed, how large is your packet? Can you add 16 bytes to it and still fit into the MTU?

Edit: or do you need to keep the RTP header? If so, then you would need to accomodate the extra 16 bytes

I'd like to give a real-world example that clearly validates WebRTC viability as more widely used standard instead of FTL.

Google Stadia uses WebRTC for delivering real-time audio/video in production today. I do not think any kind of consumer live streaming needs exceed strict requirements of gaming on a remote machine.

Signaling is a concern for many with WebRTC, but with WebRTC stack in OBS it shouldn't be a big deal to swap one signaling with the other or support multiple for some time or in general (for instance one based on SDP and another on ORTC types in JSON). WHIP draft should be more than enough to get things going.

With that in mind and the fact that the WebRTC is ultimately being used with SFU to deliver content to viewers, WebRTC will be present in the stack regardless, so having FTL makes people have to support 2 protocols and create bridges between them instead of just one and using off-the-shelf SFUs with little to no modifications.

4 replies

Hi @nazar-pc, and thanks for posting.

I noticed that you work with Restream.io, which had a history of supporting FTL until Mixer died. Can you comment on your experience with the FTL protocol at Restream, or is that more of a question for @Dead133?

We have similar impression to OBS feedback above.

It is great when it works, but with flaky connectivity users were disappointed with quality and there wasn't much our support team could help them with except decreasing bitrate or using RTMP. And in many cases switching to RTMP resulted in 1-2 seconds latency on Mixer that I don't remember being a deal-breaker for most users, Mixer worked really well even with RTMP.

Thanks for the feedback.

In your post above, you suggest that WebRTC might be a better alternative to FTL for the low latency use case. Despite that, looking at the merits of FTL on its own, do you think it ought to be deprecated, or do you think support for the protocol should remain present in OBS? Why or why not? (Note that I am not asking if you like the protocol, I am asking if you think its merits are deserving of continued support in OBS)

I imagine that might be a complicated question for someone who works at Restream, since obviously Restream is motivated to support whatever protocols are available from the services they support. So if Restream end up supporting a service like Glimesh that uses FTL, then Restream would also likely want users to have access to FTL in their encoder of choice.

This is a very long discussion already, I just wanted to make a few bullet points:

  • WHISH is the name of the working group that will host the work on the WHIP protocol. There is only one spec today, not two, and we could not use WHIP as a working group name because it already existed from back in the 50s.
  • There is an open source implementation in our fork of OBS called obs-studio-webrtc that Ben pointed to.
  • SDP has part of the handshake (JSEP) is a mandatory to implement part of webrtc already, so it s already implemented for you in any webrtc stack.
  • WHIP is designed to sit on top of webrtc, and hide all SDP and ICE manipulation to user, exactly what people want. Note: without ICE, you would have to go back to the game of opening ports and protocols in firewall and NAT in advance, with ICE, it s fully automated and transparent.
  • Adam Roach, ex area director of IETF for Applications and Real-Time and ex-mozilla is now at caffeine, the other company that historically proposed a webrtc patch for OBS. We are working together, with MFC which has just released their obs plugin (sideikick) code source two days ago, to make a joint proposal to the obs community about a webrtc implementation that would be standard, and reuse obs code to the max, with minimum dependency to libwebrtc.
  • Adam roach is actively participating in the WHIP effort. So are Janus, media soup and the usual SFU tech leads who participated in the webrtc standardisation effort for the past decade. Microsoft and Google expressed their interest in that specific case during the IETF dispatch process.
11 replies

If you don't mind me asking a relatively simplistic high-level question: What kind of latency should one expect when leveraging a WebRTC-based streaming stack? MFC for instance -- what kind of latency do those streamers experience?

edited

dodgepong on Jan 8, 2021

Maintainer

Author

I know Big Buck Bunny when I see it stuck_out_tongue

850ms is admittedly higher than I expected, especially in context of FTL's claims* of sub-500ms latency. Do you know where that latency tends to come from? Also, on a broader scale, is 850ms of latency typical of a WebRTC stream with this sort of use case?

*It's been quite a while since I've used FTL myself to see how well those claims currently hold up, though I'm sure the FTL folks would be happy to share their results. I don't doubt them, but also haven't seen any actual test results recently.

So, I'm going to sum up things as I read them right now, as of right now, there are multiple solutions that aren't FTL that can get subsecond latency, and some might do a better job of it. However, for something like obs-webrtc, I'm still not seeing a specification that can handle the authentication step like you have in RTMP and in FTL. Maybe I've overlooked it. I suppose you could implement a 401 HTTP authentication step, or add something to the SDP handshake in WHIP, but that doesn't appear to exist as implemented or defined right now.

No one is disagreeing that WebRTC does infact work for the last mile, but to actually get low latency from the streamer to the viewer, you need to emit a packet stream very close to what WebRTC will take (SRTP wrapping being the exception). Otherwise you have to introduce a transcoding step, and usually to transcode, you need a full KF interval. That essentially makes SRT and other non-RTP wire protocols a non-starter unless/until WebRTC can support a non-RTP based stream.

I will note that obs-webrtc will likely suffer the same sort of packet dropouts FTL will since it basically works on the same mechanism of transmitting RTP streams that FTL does.

0 replies

Er, one thing I do need to add, I'm not entirely sure you could easily route WHIP across a backend infrastructure. While FTL was intended to use SRTP, it was only in an authentication role (ultimately, FTL used source based identification). WHIP uses DTLS, which would require an additional decrypt stage before routing from the ingest daemon to a Janus server since in any real world deployment, those two would almost certainly be disconnected as they were at Beam/Mixer. I'm not sure how much of an impact on latency that would have, but I can see it making implementation of an ingest daemon more complicated.

0 replies

@NCommander as shown in my previous message, I think there are a lot of your statements and concerns that could be addressed by a dive in the documentation / specification draft / implementation. I want to keep this thread short, so I stay at your disposal to discuss in as many detail as you would want your concerns off thread anytime you see fit. Please note that the millicast platform which handles up to 2 millions concurrent viewers for a given single source, uses WHIP, with the usual HTTP token for authentification and access control. Tencent LEB (Live Event Broadcast) whose volume is two order of magnitude higher, also uses WHIP for ingest. A few bullets point again to illustrate my point:

  • Security on the internet is of paramount importance and even ore so since the snowden revelations (it s not random that he chose the IETF to make a virtual appearance from moscow). unlike VoIP, IETF decided to make encryption mandatory for WEBRTC, so SRTP (encrypted using DTLS-SRTP) is mandatory to implement. WHIP does not use DTLS at all.

  • webrtc does not handle authentication itself, just encryption. WHIP being HTTP based can reuse all the existing authentification mechanism provided by the application layer. This is one of the feature that has been deemed necessary, but which has not reach consensus, within WHIP. The different parties involved have all an opinion, and some experience on how they want to authenticate, all different, but have expressed their will to compromise, cooperate and discuss to reach consensus. The discussion will happen in the WHISH working group.

  • webrtc and WHIP are compatible with the new encryption messaging layer (MLS), and the new media encryption scheme for E2EE called SFrame, co-developped by the same authors as WHIP and google, used in google duo for three years, and proposed for standardisation both at IETF and W3C. The authors are also collaborating with Apple, and have a first implementation in safari tech preview. In that regard, it s a good internet and web citizen, and is aligned with future (internet and web) trends and standards.

  • The Encryption-is-taking-too-much-time claim used to be true, but has been since thanks to elliptic curve algorithms optimised to the point where it is inconsequential. It has been documented for example here (extract 1 below). After all, webrtc mandate DTLS-SRTP and does encryption / decryption on the fly and still achieve less than 100ms latency. ECDSA have been first deployed in chrome 47 in december 2016.

  • Janus and all other webrtc sfu already implement DTLS-SRTP, so don't trust me, or anybody else, go out and benchmark.

  • Janus and Medooze open source SFU already support WHIP. So with obs-sutdio-webrtc as a client, you have not one but two separate independent implementation.

Happy hacking.

(1) - "The key strength issue could be resolved by going to 2048-bit RSA keys or more, but that would delay call setup by several additional seconds. Instead of changing the RSA key size, Chrome 52 implements ECDSA keys (Elliptic Curve Digital Signature Algorithm) for use in certificates. These are as strong as 3072-bit RSA keys‚ but several thousand times faster: call setup overhead with ECDSA is just a few milliseconds."

1 reply

The key strength issue could be resolved by going to [...] RSA keys [...], but that would delay call setup by several additional seconds.

This is fine (and not actually that long, either, it's in low three digit millisecond territory), since this is just for establishing a transport connection. You don't wait and queue video while this happens. You start sending from real-time as soon as you've got your symmetric key negotiated.

One thing which is on the plus side for FTL against webrtc is that it can use our obs encoders, including hardware acceleration e.g. nvenc, quicksync, amf. It doesn't seem the case with obs-webrtc (dr alex fork of obs):

  • (1) the encoding can't be delegated to obs;

  • (2) it doesn't use HW acceleration.

Regarding (1), I found this project though: https://github.com/sonysuqin/WebRTCOBSEncoder ; it'd be interesting to be able to have the same thing for obs-webrtc.
Regarding (2), I'm aware of @agouaillard-cosmo blog post https://webrtcbydralex.com/index.php/2020/07/26/native-libwebrtc-for-windows-winrtc/ but I don't know the status of their fork regarding hw accel.

2 replies

Nothing in WebRTC spec prevents usage of hardware encoders.

Nothing in WebRTC spec prevents usage of hardware encoders.

i'm aware; that's not my point. Regarding the current implementation of webrtc (so obs-studio-webrtc of Dr Alex) or the future implementation in obs, imo it'd be a very good thing to be able to leverage our encoders. If I read well the code of Dr Alex fork, the webrtc outputs use raw frames; it'd be convenient if we could pass them our encoded data.

@pkviet This is an implementation detail. This is not a protocol discussion anymore.

wrt hardware acceleration, in OBS:

Why AV1 (or VP9 mode 2), because of the support for HDR, and up to 12 bits, 4:4:4 in webrtc with it.

the risk of using the same approach as the korean one, is to cut the RTP feedback loop, losing NACK, FEC, and all the other adaptability and resilience mechanisms while doing it. It would be better to inject the encoder in the media engine.

4 replies

the risk of using the same approach as the korean one, is to cut the RTP feedback loop, losing NACK, FEC, and all the other adaptability and resilience mechanisms while doing it. It would be better to inject the encoder in the media engine.

korean ?

  • libwebrtc design allow for injectable Encoder (res dec.) factory. So each application can provide their own. It would be almost trivial to reuse OBS provided encodes in libwebrtc. Actually, the MFC fork did just that and leverages OBS' x264 instead of the libwebrtc provided openH264.

ah very cool

  • in our current discussion with cafeine, reusing OBS hardware acceleration is on the roadmap,

excellent

  • we also proposed to the OBS team already to simply reuse the libwebrtc implementation they already ship in CEF. One could argue that If it s good enough for the browser source (obs-ninja ...), it should be good enough for the main encoders as well.

i was wondering if we could leverage it; that's an interesting idea.

I am happy to have in depth discussion about any of your requirements anytime you guys want.
I understand OBS is your baby, and I am the one who need to make the effort to address your concerns. I'm happy to keep a fork in sync while you re not confortable with it.
We brought the idea behind WHIP to the IETF exactly for this: so that all stakeholder would have an opportunity to share their needs, their opinion and participate in an open and free environement. I would love to see the OBS team send a representative to the meetings and share with the group their feedback.

https://github.com/sonysuqin/WebRTCOBSEncoder
korean project from remote monster in Seoul, 2 years old, so likely not working anymore, as remote monster has been acquired by kakaoTalk.

3 replies

By the way @agouaillard-cosmo you can click in the "Write a reply" box beneath a thread to reply to just that post if you like, rather than make a new thread in the discussion at the bottom of the page. Might help keep the conversation more organized. (Discussions are a new feature of Github that we are still testing out.)

I apologize, i m new to this and on mobile the visual difference is less obvious than on desktop. I will be carefull.

So after looking through the posts i have a question about what issues can arise with how WebRTC works in browsers and if these could be potential if not already existing issues with some of the implementations of WebRTC in obs that exists as a fork.
With this article from NordVPN when it details issues with WebRTC in chrome and firefox it details that WebRTC can leak the end users IP and that this is a core issue with WebRTC.
I'm not saying that ditching FTL for WebRTC can be bad I'm just more worried about the potential security risks for the end user using WebRTC to stream with and if these issues are non existent with the implementations or if its going to be handled.

3 replies

For client to server use cases (like with OBS) you can avoid sending any IP addresses because server is reachable directly, so nothing leaks beyond IP address from which you do the request anyway.

Also there is mDNS even when browser is used in a more traditional way.
Also doing WebRTC over VPN is not a good idea joy

Let's imaging you were leaking your IP in OBS (whatever the protocol). It would only be "leaked" to the ingest node of the platform you are streaming to, which is very likely to know who you are already through authentication. RTMP, FTL, and many other protocol do not make any attempt at hiding the origin IP of the stream.

Content verification, age verification, ... there are many reasons why anonymous streaming to a platform is at best a bad idea and at at most illegal from the platform point of view. If you are trying to hide your IP to the platform you are streaming to, you might be in breach of their EULA.

Now, on the other side, let's imaging that the last mile delivery protocol used by the platform was leaking IP. It would only leak to the viewer the IP of the egress node of the platform, not of the original source of the stream. As a matter of fact, many CDNs use webrtc's Datachannel based solutions to smooth last mile delivery (peer5, ...)

Ok so if i get the gist of it correctly the only places that would technically get the IP of the streamer is the OBS client and the ingest server no matter what is happening on the ingest server or the OBS client and in terms of streaming that would be acceptable as that is 100% necessary for an actual stream to be live.

Hi all,

I have greatly appreciated the conversation that has taken place here over the last several days. I have learned a lot! I'd like to summarize my current understanding of the situation and my thoughts on how we might proceed regarding this issue.

First is the question of what FTL brings to the table that is unique relative to other, more widely-used protocols. I don't actually think the answer is that it can provide lower latency than the alternatives, as it's clear WebRTC can achieve similar latency by disabling reliability features. Instead, it seems to me that the main appeal of FTL is its simplicity, particularly on the side of the service provider. WebRTC can do lots of things, and as such, it brings a lot of baggage. FTL, on the other hand, was developed for a specific use case (multiple simultaneous ingest of ad-hoc user-generated live video content), and as such it is able to remove a lot of WebRTC's cruft.

FTL's downside (and the OBS Project's main objection to it) is that, in pursuit of absolute low latency, FTL has been designed without mechanisms that would improve stream stability for users streaming under poor network conditions. This has historically led to an increased burden of support placed on OBS volunteers, and more generally leads to poor user experiences when FTL's network requirements are not properly communicated or detected.

In my opinion, the advantage of FTL's simplicity on the part of the service provider does not matter a whole lot to users in practice. My impression is that users don't generally care what protocol they are using, they just want their stream to work as advertised. FTL correctly advertises extremely low latency (especially in the marketing materials of services that leverage it) but this advertisement frequently lacks the caveat about the necessary network reliability.

Here are my current thoughts on the path forward:

  • The OBS team will begin work on implementing WebRTC output support in OBS.
  • The OBS team will place a "soft" deprecation on FTL in OBS starting March 1, 2020. Perhaps deprecation is the wrong word -- rather, simply implement a policy whereby we put a hold on accepting FTL-based service submissions as well as expenditure of time on further development/bug-fixing in OBS's FTL implementation.
  • Meanwhile, the FTL team will work on improving documentation of the FTL specification and development of related open-source libraries.
  • Once a build of OBS is released with WebRTC support, an evaluation period will begin regarding the state of FTL and WebRTC. FTL service providers will be encouraged to experiment with WebRTC and see if their use cases can be met by WebRTC instead, and determine what downsides there may be to this approach. The OBS team will also reevaluate our position on FTL following its development under the new FTL standards team as well as FTL’s impact on our support channels with the introduction of new FTL-based services. This period will likely last several months, possibly up to a year.
  • If our position is unchanged, and if current FTL-based service providers determine they can accomplish the same things with WebRTC, then the OBS team will proceed with the removal of FTL from the core code base. Otherwise, we will retain FTL support in the program.

A few thoughts on things that can be done that should help all parties during this time:

  • The FTL standards body may consider augmenting the FTL standard to include optional reliability features that retain the protocol’s relative simplicity but may give users with a suboptimal network the option to trade some latency for reliability. Ideally such features could be added while maintaining sub-second latency. Admittedly, I do no know how possible/likely this would be, but if the OBS Project's main objection to FTL is its potential for unreliability, then it may be worth considering as an option.
  • If the FTL standards body could assume ownership of the FTL implementation in OBS, it would certainly be a boon to the OBS Project regarding maintenance. There is at least one known issue where dropped frames are not calculated correctly in the UI. Further development opportunities would include improving communication to the user about FTL's network quality requirements, or even implementing a test within OBS to determine if that quality requirement is met by the user's network.
  • It would probably be worthwhile to work on extracting FTL code in OBS into its own plugin such that it is not tied to the existing output plugin anymore, which would both make it easier for a third party to maintain and allow for users to still use FTL in OBS without a fork even if FTL support was removed from the core OBS distribution.

I welcome further thoughts and discussion about this, including from other members of the OBS Project besides myself.

1 reply

I think one of the major points for keeping FTL support for now, is that it is currently the only free open-source solution for getting low-latency content from OBS to an in-browser player, as far as I am aware. That is Project Lightspeed.

While I can get behind the pros and cons of FTL vs WebRTC on paper, it is a moot discussion if users don't actually have the option to choose one over the other in practice. The current situation is that if FTL support is removed from OBS at this point, that essentially removes the option of streaming low-latency content to a browser without migrating to a paid subscription service; a major hurdle for most people who just do this as a hobby in their free time.

Hello everybody

Although this is already a long thread, I would like to jump on this discussion and highlight some bullet points for SRT and raise some interest for a native SRT integration into OBS, rather than using the ffmpeg SRT integration.

  • SRT is content agnostic and leaves great choice for audio and video codecs
  • SRT has a very good tradeoff between low latency and robustness at high packet loss. It's way faster than RTMP and can cope with intercontinental connections via public internet. (See my whitepaper RTMP vs. SRT)
  • SRT can work like RTMP on a single port and handle multiple incoming connections, each with an individual stream-ID (analog to RTMP stream key) (See SRT access control)
  • SRT is supported by many server systems and CDN's already, including Avid, Wowza, Nimble Server, Alicloud, Haivision Hub and many more. Some big names will follow in 2021.
  • SRT supports redundant connection modes, enabling even higher reliability over multiple network connections. Haivision just released the first devices supporting path redundancy. Many vendors will adapt this feature in 2021.
  • SRT can work with bi-directional streaming, allowing workflows like talkback or bi-directional audio/video communication
  • SRT is currently in a standardization process with a RFC submitted

Currently using SRT in OBS is still a bit clumsy, since it's ffmpeg based and all parameters have to be typed into a command line. A native SRT integration into OBS could bring a lot of benefits, not just ease of use.

  • SRT support for input: connect mobile phones as cameras with sub second latency over WiFi or 4G/5G using free apps like Haivision Play Pro, Larix Broadcaster or PC based systems using OBS or GaraninApps SRTstreamer
  • user friendly interface
  • detailed information of connection quality, possibility of showing graphs for bandwidth, RTT, packet loss, buffer levels

If there is interest on learning more details on these features, I can organise a Webinar about SRT for OBS developers and explain these feature in a bit more detail and also answer questions.

with best regards,
Justus

2 replies

Thanks for the reply. Discussions around improving OBS's SRT support would probably be better suited to an RFC so that we can keep this thread on the topic of FTL.

@J-Rogmann thanks for the offer of a webinar. I'd be interested. I can be reached on obs discord.
As to the srt params for srt output from obs, it's just a UI matter. I've thought of improving the ux , indeed passing them with the url is not very convenient. It's in my todo list.
We'd surely prefer a native implementation of srt. I've actually started a rewrite. But the current output (which I also wrote) seems to work fine so I don't have much incentive tbh.
Note that we ingest srt with the Media Source which relies on ffmpeg libs for demuxing and decoding. We already ingest from larix broadcaster. There's no plan to change srt ingest afaik.
As Ben suggested an rfc for srt would be better suited though. Or less formally it could be a separate GH discussion since we're straying from ftl.

Today is March 1st, which means we are now putting a hold on accepting new service submissions from FTL-based services or investing time into FTL output maintenance. We will continue to monitor the status of the FTL protocol in context of industry usage and demand, and will continue working toward adding WebRTC output support in OBS as the next major supported protocol.

2 replies

Hi @dodgepong Is there any timeline about WebRTC output support?

Q3 2022 is our new target for an MVP of WebRTC output.

@dodgepong We are also using FTL but willing to move on to WebRTC output, just hope there's a grace period where FTL and WebRTC output are both available. Is there an active development branch somewhere to test?

1 reply

There will be a grace period, yes. Most development related to WebRTC at the moment is being handled by @DDRBoxman. Our updated timeline for a minimum of WHIP-based WebRTC support is looking closer to Q3 2022.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK