Live data from Hacker News

Prime Video Uses WebAssembly

amazon.science

121–130 of 254 posts

Re: Prime Video Uses WebAssembly

#121

Earlier quoted context omitted.

DeCSS was considered a very big no no if you worked for a company that did work for content owners. Doom9 had lots of info on how to use DeCSS, and so it was flagged by lots of corps. Where would I start today? That depends on your level of interest, and what you want to do. Are you wanting to learn things to do to stay hip and cool making videos for the socials, or are you wanting to do technical things to video for…

I am interested in using video compression to improve delivery of VR and AR content over the web. But, this can mean a lot of different things! I know there is a lot of opportunity for this, I have a lot of ideas, but my knowledge of video compression and video streaming is limited. There are some companies working on this, but it’s not a singular problem or solution. I expect it will end up being many categories of…

It's all made of inter prediction + intra prediction + residual coding.

There's an evolution from JPEG -> MPEG2 -> MPEG4 part 2 (XviD) -> AVC -> HEVC… where it gets more complicated over time but that's still the structure.

There's also alternative ideas like wavelets (JPEG2000) and many other minor silly ideas; almost all of them are bad and can be ignored. Which is not to say the MPEG codecs are perfect.

ML people think they can do "ML video compression" which will be a black box; I think this might work but only because calling your video codec ML means you can make your codec 1TB instead of a few hundred KB.

Re: Prime Video Uses WebAssembly

#122
post #61

Earlier quoted context omitted.

Because it's not just buttons and doodads, it's all the error handling and loading indicators and UI edge cases that are needed to make it seamless and good. Title too long? Does it get truncated or shrunk? Does the UI reverse itself for RTL languages? Does the focus ring move in a sensible order? This is front end engineering. It's a whole profession, and when it's done poorly, folks think your software is garbage.…

Frontend engineering is a thing because of the accidental complexity of a massive software stack that's evolved by accretion and gone through fad after fad after fad. I'm not looking down on frontend engineers, but I don't believe right-to-left languages or focus order inevitably leads to hundreds of thousands of lines of code or 50+ MB binaries.

This comes off incredibly naive of FE engineering.

Buttons and Doodads? sigh.

A significant factor as to why Apple has succeeded the past 2 decades is due to the design of their products - from the sleek aluminum bodies of their hardware to the UI/UX of their operating systems.

Unless you want your UI to look like something out of 1995, you're going to have to make it look good.

Making it look good will require a decent amount of code.

From animation libraries like Framer Motion, or data visualizations using d3, or even After Effects renders from Lottie.

That isn't even mentioning the amount of state that is required to be stored so that proper renders could occur - If your user has logged in, if your user has typed something into an input field, how many times you should retry a request if it fails, what functions to run due to a websocket response, and myriads of other things that FE engineers have to deal with.

Please reconsider your thoughts.

Re: Prime Video Uses WebAssembly

#123

Language success is in large parts driven by what system adopts that language. Objective-C’s success was driven by iOS. C’s success was driven by Unix. C++’s early success was driven in large part by 90’s GUI frameworks ( MDC, OWL, Qt, etc. I think Wasm is shaping up to be huge in that you can safely run, high performance code across multiple operating systems/CPU’s. Of all the languages, I think Rust has the best WA…

> Objective-C’s success was driven by iOS.

Well, Objective-C is from 1984 and its major success was being cloned to make a programming language called Java.

Re: Prime Video Uses WebAssembly

#124

Earlier quoted context omitted.

You're thinking of React and Flutter and so on. They aren't immediate mode. They're more like retained mode with a non-traditional way of keeping the UI state up to date. Very different to egui.

React and Flutter aren't immediate mode only because they're build on top of the DOM as primitive. Otherwise, conceptually they are evolutions of immediate mode. And they inspired plenty of GUIs outside the web to go "immediate" mode themselves.

Flutter isn't built on top of the DOM. And anyway that's not why they're not immediate mode. Take a look at some egui code and you'll see huge differences, e.g. in how button clicks are handled, when code runs, etc.

Re: Prime Video Uses WebAssembly

#125

Earlier quoted context omitted.

Can you recommend any resources for learning about video codecs?

Not sure if this is what you’re looking for, but this popped up a while back: https://blog.tempus-ex.com/hello-video-codec/

This is vaguely okay but makes the common mistake of overemphasizing that codecs use an IDCT. That's just a component of intra-prediction, it isn't necessarily important or used, and in H.264+ it isn't even a real IDCT when it is used. It's a simpler transform that isn't mathematically accurate but is bit-exact, which is more important.

Re: Prime Video Uses WebAssembly

#126

Earlier quoted context omitted.

You're thinking of React and Flutter and so on. They aren't immediate mode. They're more like retained mode with a non-traditional way of keeping the UI state up to date. Very different to egui.

React and Flutter aren't immediate mode only because they're build on top of the DOM as primitive. Otherwise, conceptually they are evolutions of immediate mode. And they inspired plenty of GUIs outside the web to go "immediate" mode themselves.

Words don't have any meaning anymore if react (and the HTML DOM) is considered anything close to "immediate mode".

For starters the DOM is a declarative thing - immediate mode means that you have a function called for each frame with imperative function calls written by the user of the immediate mode GUI toolkit for rendering each element of the GUI every time (unlike retained mode where a framework hides that behind some object model). It's not really possible to be more opposite to a declarative approach.

Re: Prime Video Uses WebAssembly

#127

Personally, to me , whenever I read these stories about how Amazon is doing this novel use of WebAssembly, or how Uber is doing ludicrous engineering effort to keep their React-based app under 300MB for the App Store, I can't help but think: "Man, that's an awful lot of work to avoid writing a native app."

I disagree with this perspective. From a startup pov, going with native apps will require multiple teams (Usually just Android + iOS, but occasionally Windows as well) React Native will only require one team, or just one engineer depending on the size of the project Better yet, If your front end developer is fluent in React(web), then that developer is already fluent in React Native. I completely disagree on the "awf…

Former Dev that did Web -> Ionic -> RN -> Native iOS over the course of 6 years speaking here.

- Web devs typically don’t have strong instincts for mobile apps, they require more mentorship & onboarding time.

- Animation and interactivity is strongly limited in RN - You’re always so many levels removed from the actual APIs being used. For example, using UIKit and CoreAnimation are absolutely amazing and super lightweight on CPU/GPU in comparison. UICollectionView is a modern miracle that offers so much more control than FlatList.

- JS/Babel/node_modules is hell, no I won’t elaborate.

- Multi-threading, priority/concurrent queues etc for maintaining good all-around perf while doing intense operations is very strong with native platforms. RN just has sophisticated band-aids.

Honestly it mostly depends on the type of work the app will be doing, the dev resources available to you, and the level of quality you want to attain. I strive to create the best of the best user experience, and native is the best way to attain that.

The app I work on still uses RN for some features, but the results historically have been disappointing on average.

Happy coding!

Re: Prime Video Uses WebAssembly

#128
post #52

The egui framework they mention is pretty neat: https://emilk.github.io/egui/ It an entirely custom toolkit, so don't expect it to have a native look and feel, but it's a GPU-first design with multiple back-ends. It can be used in native OpenGL apps too. It's an immediate-mode UI, so it's very easy to build and update even complex windows. Great choice if you want to prototype a game.

Can confirm this lib is very good. I use it to simplify my status app, it allows me to keep everything in Rust so that I don't need to know too much about react and other web tech.

There's demo apps that you can just grab and edit to your liking, and the docs explain what you need to build the WASM app and run it.

Re: Prime Video Uses WebAssembly

#129

I really wouldn't use Amazon Prime as a shining example of WA.

why not? so they aren't using webassembly correctly? who is a better example and why?

I use it on web/AppleTV/FireTV & IMO it doesn't have a great user experience on any platform. Generally it's a bit jerky/laggy & also often gets glitchy (on FireTV at least) post very long running videos. I'm not saying it sucks, but the apps for Disney & Netlix feel so much better to use. My comment wasn't directed at WebAssembly.

Re: Prime Video Uses WebAssembly

#130

Earlier quoted context omitted.

> I think Rust has the best WASM Nope, C/C++ has, emscripten remains undefeated You don't just put a name and expect things to skyroket C++/Go/C# has more chance to become the standard toolkit for WASM than rust rust problem, is people promotes more the "rust"™ rather than their project, the crabs definitely shadows them, it's unfortunate

Your comment seems to rooted in your dislike of Rust, rather than provide any technical arguments. The Rust tooling certainly was the best, no question. As the Mozilla WASM devs have moved on the WASM tooling has stagnated, sadly, and The C++ tooling has caught up. Languages like C# and Go are inherently worse for WASM because they require GC and have big runtimes they have to bring along.

Looking forward to a Rust framework than can actually compete with Blazor, nope Yew isn't it.
Post reply on HN