14 ms·
Prime Video Uses WebAssembly
- jeffbee 5y agoPrime video has unbelievably bad performance on LG WebOS, and it’s not the platform because Hulu, Netflix, Disney, YouTube are all fine. If this is new and makes their app work acceptably, then great! Just checked and Prime using 90MB in my TV, while YouTube uses 214KB, so maybe I already have the wasm monstrosity.
- Commodore63 5y agoPrime might maintain more of an asset cache than YT does.
- jeffbee 5y agoMaybe it shouldn't? I feel like the problems with their app are more algorithmic than in the implementation details. I once had to go edit my watchlist on amazon.com because I had added enough movies that whatever super-linear algorithm they were using simply could not comprehend my watchlist and the input watchdog timer would murder the app. And come to think of it that was when I used Prime on a Roku, so it's a cross-platform problem (yay, WASM!).
- jozzy-james 5y agohaven't noticed any performance issues on mine (edit: relative to other apps in that ecosystem) - tho is a newer model. the UHD for in-house productions is pretty darn atrocious tho (looking at you, goliath) edit: HDR, not UHD...tho have only noticed it predominate on their originals vs purchases.
- random_ind_dude 5y agoI have an LG UHD TV model from 2020 running webOS and I haven't noticed any performance issues either with Prime Video, UHD, HDR or otherwise. I use Bluetooth speakers/earphones for audio. The sound is almost perfectly synced with the video in Prime while there is a noticeably annoying delay in the Netflix app on the same TV.
- jeffbee 5y agoTo be clear, my beef is with the browsing UI, not the playback. The playback on all these devices is handled by dedicated hardware. It's not like Amazon's app is decoding videos in a WASM VM.
- random_ind_dude 5y agoWell, X-Ray is a feature in the Prime app that I like and use quite often and is very snappy. Since it's part of the UI overlay, I think it's handled by the WASM module (probably with local caching) and not by the dedicated video-decoding hardware in the TV. I agree that the browsing UI can sometimes take an extra second or two to refresh which I don't find to be a dealbreaker since it's the video/audio playback that I care about the most.
- laurencerowe 5y agoWhile app the performance is just poor on my 2019 LG OLED TV I find HDR content to be unwatchable on it, seemingly a long running problem across multiple platforms: https://www.amazonforum.com/s/question/0D54P00007HLPkoSAH/letterbox-borders-are-gray-how-do-i-change-them-to-black https://www.amazonforum.com/s/question/0D54P00007HLPkoSAH/le... HDR content is somewhat better when played through the Prime Video PS5 app, though it still seems much darker than HDR content played on the Netflix/AppleTV/HBO LGTV apps.
- gjsman-1000 5y agoIt's not just HDR content. I was watching a 2008 BBC drama called Little Dorrit on a Roku in 1080p streaming, no HDR because that didn't exist when it was filmed. It was super smeary, had terrible blacks, tons of obvious banding artifacts, it was really bad. I bought the 1080p Blu-Ray version from the UK, and even my parents standing 10 feet away from our 48" 1080p TV (without me explaining the problems with the Prime version) could tell the difference after about 10 seconds.
- kcb 5y agoCould possibly be an issue with the HDMI Black Level setting on the Roku's input.
- gjsman-1000 5y agoIt was a Roku TV, so the Roku video signal was built-in and not passed over HDMI.
- perryizgr8 5y agoOh man I'm kind of happy to know that other people have this HDR problem too. Why don't apps and TVs just provide a simple toggle to turn it off? Why must it be automatic and non user selectable? Just give me the normal color stream!
- bick_nyers 5y agoI found most LG WebOS apps to have issues of some kind. A quick Google search tells me that they finally now have an HBO Max app, but that was a major issue for the longest time for me. I got a Google stick instead.
- deleted 5y ago[deleted]
- Sunspark 5y agoWhy don't apps like this leverage gpu hardware acceleration? On my old tablet, Netflix runs a-ok, the media player has hardware acceleration and runs a-ok, but Amazon Prime stutters. I haven't checked it in years, so maybe it is better now, but I am skeptical this is the case, because if the original creators of the Android app didn't think hardware accelerated video might be a nice idea, why would it be different now? This is a structural issue.
- lathiat 5y agoThere is a cross sectional problem between what codecs that specific hardware supports (and generally is supported by all the popular devices), how much bandwidth you have on your connection and how many different codecs the various streaming services can support and cache locally. There are trade offs to be made.
- shmerl 5y agoDidn't everyone agree to align on AV1? So that should become a non issue as its adoption progresses.
- Sunspark 5y agoWhat about all the older CPUs and GPUs out there that don't have hardware support for AV1?
- shmerl 5y agoThat's why I said as it's being adopted. Right now it's just the very beginning of this phase (for instance AMD just started providing hardware decode in RDNA2). So I expect this to become a non issue at some point.
- Sunspark 5y agoAs long as they don't take it as an excuse to reduce bitrates further. It's getting pretty bad these days with macro-blocking everywhere. This practice really took off when covid started. I actually cancelled Netflix because of it. Amazon is not as bad for macroblocks, but I have run into a few shows that show macroblocks, such as Mr. Robot.
- gjsman-1000 5y agoPersonally, 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."
- Kaedon 5y agoThe challenge would be that Prime Video is distributed on many client devices. Here’s a list of a few TV OSes: https://en.m.wikipedia.org/wiki/List_of_smart_TV_platforms https://en.m.wikipedia.org/wiki/List_of_smart_TV_platforms. How would you manage a different native app for each of them? Caveat: previously worked at Prime Video though not in this area, still at Amazon
- gjsman-1000 5y agoI could be incorrect, but last time I did some reverse-engineering, Netflix had a Qt application that used native C++ bindings to knock out huge sections of that list. That Qt application was only lightly modified for each platform, IIRC, and it appeared all over the place from those cheap Linux-based Blu-ray players to Smart TV clients. Anywhere that was embedded, generally Linux-based, and unlikely to get frequent updates. As for some of the larger players like Roku or Android, those ones are more obvious where to hire. Java developers and BrightScript developers.
- mftb 5y agoIt all kind of undermines your original comment tho that they're trying to avoid native. It seems more likely that they're goal is to reach as many devices as they can and be able to do updates frequently. In the first paragraph of the linked article the guy says the trade-off is between "updatability and performance".
- nofunsir 5y agoI am really sick of fast-churn and forced updates. Guys. Settle. Write a native app or three. It’ll be ok.
- sheeshkebab 5y agoNow I know why Prime video app sucks on every iOS device I tried it on, including Apple TV
- alx__ 5y agoDisney+ uses WASM and feels like it has less "suck". Prime just seems to lack some UX polish.
- jackson1442 5y agoI've never had a problem with the functionality of Prime Video across any apple/webOS devices. The UI, however, is easily the worst of any streaming platform. Why is a search result returned for each individual season of a TV series? Why doesn't it follow ANY of the Apple TV UI conventions? But somehow it's more reliable than Netflix, Hulu, and HBO Max (hbo isn't that high of a bar though).
- lucb1e 5y agoDon't forget that every single button in the UI lags. Start an episode, pause immediately because you just realized you forgot something in the kitchen? Oops now you disabled subtitles because that UI button was still busy popping up (and subtitles are necessary to understand their whispers without being DEAFENED BY LOUD SCENES without adjusting volume by 50% every 2 minutes). Want to hide the UI because you just finished navigating the menus to re-enable those subtitles and hit the back button? Oops now you go back to the main overview because the first click did register, it just took a minute for the TV to respond and now your second click takes you back. Now have fun scrolling down five rows three columns to find the thing you were watching 1 second ago and do this dance again. This is not helped by LG shipping a CPU literally slower than a raspberry pi's in a €550 2019 TV, but other apps do not have this problem. It's too bad Prime has some exclusives like The Expanse, I look forward to finishing the couple series we had in the queue and cancelling Prime again.
- rustworld 5y agoReally interesting to see the adoption. Disney+ Shared the following: https://medium.com/disney-streaming/introducing-the-disney-application-development-kit-adk-ad85ca139073 https://medium.com/disney-streaming/introducing-the-disney-a...
- formerly_proven 5y ago> Prime Video > xyz [4K/UHD] 4K is not available when using a computer > HD is not available because you're not using Windows when using Windows > HD is not available because you don't have HDCP Graphics driver begs to differ. Prime SD is usually somewhere between 240p and 320p, HD looks like a decently encoded 720p file. Never seen it but I'm guessing 4K might actually approach the quality of a 2007 Blu-Ray.
- verytrivial 5y agoI saw these errors the one time I tried Prime Video and laughed out loud, and ended the trial on the spot. It was like being turned away by a bouncer from a awful looking bar because they didn't like your shoes. Thus ends our relationship!
- chaosite 5y agoPrime 4K's bit-rate is ~15Mb/s. A UHD Blu-Ray has a bit-rate that's more like 70Mb/s, and a 1080p Blu-ray has a bit-rate of ~28Mb/s. Of course, 4K is usually encoded with H.265 while 1080p is encoded with H.264, so the raw bit-rate numbers are not as useful for comparison - but still, that's almost twice the bit-rate for a quarter of the pixels, and H.265 isn't magic.
- sharken 5y agoPrime 4K is nice, but if you have a decent sound system with Atmos, then Amazon Prime is not the place. Apple TV has been the best platform so far for 4K and Atmos content, if you also want an option to purchase a title. https://www.highdefdigest.com/news/show/everything-on-amazon-prime-video-in-hdr10-dolby-vision-andor-dolby-atmos/42831 https://www.highdefdigest.com/news/show/everything-on-amazon...
- pier25 5y agoHere in Mexico at least, there's almost no 4k content on Prime. Even less Atmos content. Netflix, Disney, and Apple are great. HboMax has 4k content, but their tech is really bad and the quality is constantly jumping between SD to 720p to 1080p to 4k. We have a 500Mbps fiber connection.
- rappatic 5y agoIt's nice to see a big company like Amazon using Wasm in something that actually sees the light of production (and in something that's used by so many people). I always see tech giants supporting or contributing to newer technologies like Wasm without really using them in important applications.
- dwmbt 5y agoas of late last year - of the large tech companies - it seems that amazon and microsoft might be the biggest Rust (in prod) evangelists. they basically swiped all the mozilla rust devs that were laid off and made their own dedicated Rust teams. so far, this has been good for the ecosystem as they continue to contribute to the community but i know there's a lot of community members that feel uneasy about those moves. here's to hoping the worries amount to nothing :)
- dwmbt 5y agofirst time i've seen practical wasm system design and the transition written about. that being said, i would really love a deeper dive. the graphics were also insightful -- cheers, alexandru
- pacificat0r 5y agoI'd actually love to do a more in-depth presentation of the internals and how stuff works together. Who knows, maybe in a future post :) If you have any specific question, I could try to answer it here.
- RcouF1uZ4gsC 5y agoLanguage 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 WASM tooling, and the 2020’s may end up being the WASM/Rust decade.
- nojito 5y ago> I think Rust has the best WASM tooling, and the 2020’s may end up being the WASM/Rust decade. Still pales in comparison to .NET
- miohtama 5y agoLook to the future, not to the past.
- easton 5y agoI mean, Microsoft seems to be making it clear that the replacement for old-school ASP.NET formsy apps to be Blazor, which is C# you write that runs in the browser via WASM. Makes making SPAs easier if that’s your stack. https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blaz...
- avgDev 5y agoI'm rewriting an MVC 5 app in Blazor as we speak. I'm "full-stack" but my JS skills are pretty low compared to C#, which I am extremely comfortable with. It is actually extremely fun to work with. Havin ability to inject a service directly into a page is amazing. I'm hoping Blazor gets more popular. However, I will see how this project goes and if I hit any major road blocks, so my opinion my shift. So far it seems like a great option.
- deleted 5y ago[deleted]
- zlei 5y agoJust curious: which specific wasm VM implementation are they using?
- johncolanduoni 5y agoThey mentioned joining the Bytecode Alliance, so probably wasmtime.
- pacificat0r 5y agoIt's actually Web assembly micro runtime (still from bytecode alliance but it's a vm that also supports interpreted mode)
- oofbey 5y agoWhy is this in their “science” blog?
- ec109685 5y agoWhat was the reason for web assembly versus just running rust directly on the target hardware? Is the idea that the constrained WASM environment requires less QA than if the hardware was targeted specifically by the rust compiler?
- exdsq 5y agoIf you target a WASM VM you’re not tied into Rust itself which seems appealing from a risk standpoint
- jedisct1 5y agoELF, COFF, Mach-O, etc. objects can already be linked together regardless of the compiler producing them.
- root_axis 5y agoHow so? Your source code is still in Rust so seems like you'd still be tied to it.
- rafale 5y agoThe source code is in Rust. But the compilation target is WASM instruction set.
- root_axis 5y agoWhy does that matter with respect to being less tied to rust? Yes, it compiles to WASM but your engineers still have to write rust in order to make changes to the software. I mean I suppose they could edit the WASM directly since it's technically human readable, but if you're doing that why bother with rust at all?
- exdsq 5y agoIn terms of platform support - if you target a VM you don’t have to worry about moving from Rust because another language might not support that runtime. Now any language that can work on a WASM VM is okay. Also, if the app isn’t monolithic it means supporting services can be in other languages than Rust too.
- pornel 5y agoThe egui framework they mention is pretty neat: https://emilk.github.io/egui/ 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.
- FpUser 5y agoChecked demo. Bugs when interacting. For example when clicking buttons on top does not switch to supposed part. just flushes screen momentarily. Clicking refresh on browser right after that fixes the situation. Major pita is keyboard handling when selecting, cutting, pasting text in edit controls and markup editor
- rafale 5y agoImmediate mode is such an outdated approach for a modern UI framework. It's a deal-breaker imo.
- coldtea 5y agoImmediate vs retained is not about "modern" vs "outdated", both are about as old as computer graphics themselves. One is better in some cases, the other in others. In any case, the fashion (for the last ~10 years) is to consider immediate mode the modern approach, and retained mode an awkward practice of the 90s. So you can call "immediate mode" a lot, but you can't call it "outdated" when most consider it the new black...
- TruthWillHurt 5y agoPrime Video app sucks. Spend less time over-optimizing, more time improving usability.
- myko 5y agoIt is the worst of the major streaming apps. It's very slow and has lots of loading/reloading on every piece of hardware I've used it on (Android phone, iPad, AppleTV, AndroidTV). I imagine the other streaming apps use similar techniques to share code, so I wonder why theirs is so poor in this regard. Outside of the major players though it gets a lot worse - Funimation's streaming app is horrendous, as is Crunchyroll's. At least Prime Video is doing better than that tier.
- lostgame 5y agoBut Amazon is one of the largest companies in the world - Crunchyroll has an excuse. Amazon doesn’t. My girlfriend’s smart TV runs WebOS and if we have to use Prime for some reason it’s easier to plug the laptop in via HDMI and do it via a browser. Amazon’s app seems to just be broken on WebOS there. Not only that, but what the heck is up with the completely uninspired UI and user-hostile UX? The importance of seasons being lumped together is something a focus group should have noticed. Amazon was a web-first company - you really have to wonder how they screwed up their user experience so, so badly.
- maeln 5y agoI cannot believe how Amazon is one of the biggest company on the planet and still cannot seem to figure out UI/UX for any of their product. Amazon (the website) having an awful UX might be "by design" (i.e dark patterns) but it make no sense for Amazon Video, AWS dashboard, the kindle/device side of the Amazon website, ...
- AtlasBarfed 5y agoHave you seen the AWS UI? Or the AWS API? I actually think this is a product of Amazon's workplace culture. The old joke about the first 90% taking 90% of the time and the last 10% takes the other 90% of the time. Amazon only invests in the first 90%, and doesn't give a shit about the rest of it because they have already won the monopoly, and their sociopathic stack ranking forced firing culture won't reward people working on polish. In UIs, that second 90% is polish. Polish comes from low priority ticket/feature fulfillment, and if you're working on low priority tickets, that means you're getting fired in the next reaper cycle.
- curiousgal 5y agoAnd yet they can't even implement Picture-in-Picture mode on their Android app. A basic feature has been stable for years among any app that plays videos. Not to mention that their show recommendations are the worst ever, I would be ashamed to be part of their ML team honestly. (For reference I'm an American/North African woman staying in France and all of my recommendations are for Indian action movies, literally all of them. I've never seen a single Bollywood film ever.) Anyway this is to say, technical innovation won't undo the damage done by shitty product managers.
- chj 5y agoOn systems such as iOS which you don't have JIT, performance is going to be real bad, as if you are dancing with a pair of iron made shoes. Honestly Amazon should afford going full native, at least for the scene and animation stuff.
- beardedman 5y agoI really wouldn't use Amazon Prime as a shining example of WA.
- colesantiago 5y agowhy not? so they aren't using webassembly correctly? who is a better example and why?
- beardedman 5y agoI 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.
- stepbeek 5y agoI’ve been impressed with the Disney app. They had a rocky start but now it’s excellent. Definitely better than Amazon’s in my experience.
- karmasimida 5y agoIt is painfully slow comparing with its competitors, and for no good reason to be so. Overall it has the shittiest experience, also thanks to the monstrosity that is X-ray. At the best, this article can only say Prime Video would be more shitty without WASM maybe?
- bluehex 5y agoWould this architecture work on their iOS app as well even with Apple's restrictions on downloading executable code?
- Jyaif 5y agoYou can run WebAssembly in a WKWebview, which wouldn't break any Apple restriction.
- alvarlagerlof 5y agoThe prime video website doesn't seem to go higher than 480p. YouTube trailers for their own shows look vastly better.
- austincheney 5y agoSounds like they are doing it wrong. Our Wasm investigations started in August 2020, when we built some prototypes to compare the performance of Wasm VMs and JavaScript VMs in simulations involving the type of work our low-level JavaScript components were doing. In those experiments, code written in Rust and compiled to Wasm was 10 to 25 times as fast as JavaScript. For video processing, especially high fidelity, high frequency, and high resolution video, I can see WASM crushing JavaScript performance by orders of magnitude. But, that isn’t this. They are just launching an app. I have verified in my own personal application that I can achieve superior performance and response times in a GUI compared to nearly identical interfaces provided by the OS on the desktop. There are some caveats though. First, rendering in the browser is offloaded to the GPU so performance improvements attributed to interfaces in the browser are largely a reflection of proper hardware configurations on new hardware. The better the hardware the better a browser interface can perform compared to a desktop equivalent and I suspect the inverse to also be true. Second, performance improvements in the browser apply only up to a threshold. In my performance testing on my best hardware that threshold is somewhere between 30000 to 50000 nodes rendered from a single instance. I am not a hardware guy but I suspect this could be due to a combination of JavaScript being single threaded and memory allocation designed for speed in a garbage collected logical VM opposed to allocated for efficiency. Third, the developers actually have to know what they are doing. This is the most important factor for performance and all the hardware improvements in the world won’t compensate. There are two APIs to render any interface in the browser: canvas and the DOM. Each have different limitations. The primary interface is the DOM which is more memory intense but requires far less from the CPU/GPU, so the DOM can scale to a higher quantity of nodes without breaking a sweat but without cool stuff like animation. There are only a few ways to modify the DOM. Most performance variations come from reading the DOM. In most cases, but not all, the fastest access comes from the old static methods like getElementById, getElementsByTagName, and getElementsByClassName. Other access approaches are faster only when there is not a static method equivalent, such as querying elements by attribute. The most common and preferred means of DOM access are querySelectors which are incredibly slow. The performance difference can be as large as 250,000x in Firefox. Modern frameworks tend to make this slower by supplying additional layers of abstraction and unnecessarily executing querySelectors with unnecessary repetition.
- Zenst 5y agoI'd be happy with surround (5.1) upon windows, alas it seems you can only get that via an Amazon device. HD 5.1 would suit me over any 4k and do feel many streaming services use the 4k etc as marketing more than anything else and fail upon the audio aspect in regards to surround, which IMHO add's way more to the viewing experience than a bump in resolution - though others millage may vary.