News for hackers. Stuff that matters.
Re:Ask HN: What's preventing us from achieving seamless vide... by keithwinstein on Sunday May 12, 2019 @02:08AM (#19890451)
Low-latency packet video can work incredibly well over a dependable network connection (with a known constant throughput and no jitter), low end-to-end per-packet latency, and good isolation between everybody's microphone and speaker. This was mostly solved in the 1990s.

A lot of what makes Skype/Facetime/WebRTC/Chrome suck are the compromises and complexity inherent in trying to do the best you can do for when these things don't hold -- and sometimes, those techniques end up adding latency even when you do have a great network connection.

Receiver-side dejitter buffers add latency. Sender-side pacing and congestion control adds latency. In-network queueing (when the sender sends more than the network can accommodate, and packets wait in line at a bottleneck) adds latency. Waiting for retransmissions adds latency. Low frame rates add latency. Encoders that can't accurately hit a target frame size on an individual frame basis add latency. Networks that decrease their available throughput (either because another flow is now competing for the same bottleneck, or the bottleneck link capacity itself deteriorated) cause previously sustainable bitrates to start building up in-network queues, add latency.

And automatic echo cancellation can make audio incomprehensible, no matter how good the compression is (but the alternative is feedback, or making you use a telephone handset).

Another problem is that the systems in place are just incredibly complex. The WebRTC.org codebase (used in Chrome and elsewhere) is something like a half million lines of code, plus another half million of vendored third-party dependencies. The WebRTC.org rate controller (the thing that tries to tune the video encoder to match the network capacity) is very complicated and stateful and has a bunch of special cases and is written in a really general way that makes it hard to reason about.

And the fact that the video encoder and the network transport protocol are usually implemented separately, by separate entities (and the encoder is designed as a plug-in component to serve many masters, of which low-latency video is only one, and often baked into hardware), and each has its own control loop running at similar timescales also makes things suck. Things would work better if the encoder and transport protocol were purpose-designed for each other and maybe with a richer interface between them (I'm not talking about changing the compressed video format itself; just the encoder implementation), BUT, then you probably wouldn't have access to such a competitive market of pluggable H.264 encoders you could slot in to your videoconferencing program, and it wouldn't be so easy for you to swap out H.264 for H.265 or AV1 when those come along. And if you care about the encoder being power-efficient (and implemented in hardware), making your own better encoder isn't easy, even for an already-specified compression format.

Our research group has some results on trying to do this better (and also simpler) in a principled way, and we have a pretty good demo video: https://snr.stanford.edu/salsify . But there's a lot of practical/business reasons why you're using WebRTC or FaceTime and not this.

Re:Ask HN: What's preventing us from achieving seamless vide... by ignoramous on Sunday May 12, 2019 @08:19AM (#19891447)
Keith, thanks for your inputs.

Noob question: Where do you think Google's BBR https://ai.google/research/pubs/pub45646 and CMU's HFSC https://www.cs.cmu.edu/~hzhang/HFSC/main.html fall short?

--

For folks unaware, Keith created https://mosh.org and is an expert in Computer Networks.

Here's a relevant talk by Keith on Sprout, a new transport protocol for live video on noisy cellular networks that uses probabilistic inference to predict congestion; and Remy, a program that generates transport protocols on-the-fly in response to network conditions: https://youtu.be/UsCOVF0vDe8

And here's a talk at Usenix on Salsify: https://youtu.be/LPj2ffe7Isk news.yc discussion: https://news.ycombinator.com/item?id=16964112

UoCambridge's David McKay on Information Theory, Pattern Recognition, and Neural Networks : https://videolectures.net/course_information_theory_pattern_...

Re:Ask HN: What's preventing us from achieving seamless vide... by miki123211 on Sunday May 12, 2019 @09:04AM (#19891621)
I remember good old Skype from like 3, 4 years ago that didn't use to suck at this so much, at least on the audio side. When the network connection was really bad, it used something like phone quality, when it was good, the quality was closer to Face Time. You could hear the quality shift dynamically when network conditions were changing (i.e. someone starting a download). I really enjoyed talking on Skype back then, I knew I could depend on it and get the best I could, whatever the conditions were. Now it's much worse, the quality is average, it doesn't handle bad connections well and it doesn't fully utilize the good ones. I don't think we have anything as good now as we had back then. There's Team Talk which is amazing for audio, but much more cumbersome to set up.
Re:Ask HN: What's preventing us from achieving seamless vide... by ejcho623 on Sunday May 12, 2019 @01:45PM (#19893297)
Why do you believe the quality is going backwards? Is there something they are optimizing for the compromise in quality?
Re:Ask HN: What's preventing us from achieving seamless vide... by miki123211 on Friday May 17, 2019 @09:15PM (#19944993)
not sure myself, I'm way out of my depth here, but a friend who knows much more about this sort of stuff, told me it's probably something to do with mobile connections. Apparently slow landline connections and bad cellular connections like 3G are unreliable in different ways. Also most mobile phones, definitely all iPhones, not sure about Android, can't go higher than 16kHz when it comes to audio calls, so anything better is pointless. Maybe it's just M$ and trying to save some pennies on the infra, especially that they're not p2p any more (also b/c mobile connections and restrictive NATS). I know They're supposedly not that bad any more, but considering what they've done to Skype's other aspects, I wouldn't be surprised really.
Re:Ask HN: What's preventing us from achieving seamless vide... by algesten on Sunday May 12, 2019 @03:28AM (#19890654)
Well put! It's also worth mentioning that because of the network conditions, UDP is a better choice than TCP. The reason is that the retransmissions in TCP are not helping with real-time video.

However every protocol doing this must have fallback from UDP to TCP because there are a surprising amount of corporate firewalls out there that arbitrarily limits the use of UDP.

We worked extensively with webrtc, but are recently switching to our own protocol. The main reason is that webrtc is very complex and generic. You can make a better user experience if you adapt the protocol to target your use case.

Another reason is that we can more easily detect firewalls and give the user feedback about it.

Re:Ask HN: What's preventing us from achieving seamless vide... by hardwaresofton on Sunday May 12, 2019 @04:02AM (#19890751)
Thanks for your work on the Salsify paper -- the paper was a great read and the novel approach is pretty great was illuminating.

I wonder if it would be possible to get Salsify into the browser using something like web-udp[0]. I don't think the lower level access to the encoder information is available to coordinate network usage...

For those who are interested in code, check out the encoder on Github[1].

[0]: https://github.com/osofour/web-udp

[1]: https://github.com/excamera/alfalfa

Re:Ask HN: What's preventing us from achieving seamless vide... by tracer4201 on Sunday May 12, 2019 @04:01AM (#19890750)
I bookmarked your link and the paper it links to for reading on my Monday commute.

In college, I had one Networks course which discussed IPs, subnets, cidr, UDP, TCP, various higher level protocols, packet headers, etc. There were a couple projects - I think I recall implementing TCP or sliding window. Anyway, that’s the extent of my background knowledge.

Where would one start if they want to dive deeper in video transmission or related topics that provide more than the very basic understanding I have?

Re:Ask HN: What's preventing us from achieving seamless vide... by rixed on Sunday May 12, 2019 @08:57AM (#19891598)
Since you seems to be very familiar with that topic, do you know if most popular video chat applications stream voice and video directly between peer, or do they have to go through some central server? And if so, how much latency does that cost us?
Re:Ask HN: What's preventing us from achieving seamless vide... by rlyshw on Sunday May 12, 2019 @09:10AM (#19891650)
WebRTC is direct peer to peer. There’s a reliance on a STUN/TURN server to provide signaling for things like NAT traversal but other than that it’s all p2p.
Re:Ask HN: What's preventing us from achieving seamless vide... by tehlike on Sunday May 12, 2019 @09:43AM (#19891845)
The answer might be a mix, if video conference involves more than trivial amount of participants.
Re:Ask HN: What's preventing us from achieving seamless vide... by MiddleEndian on Sunday May 12, 2019 @07:41PM (#19895338)
Are there any video chat platforms that just assume a good network quality (or have an option for such) so in the happy case there's less latency?
Re:Ask HN: What's preventing us from achieving seamless vide... by sansnomme on Sunday May 12, 2019 @11:21AM (#19892437)
Any relation between Salsify and the Puffer project?
Re:Ask HN: What's preventing us from achieving seamless vide... by heyoni on Sunday May 12, 2019 @04:13PM (#19894249)
Thank you for making mosh!