mbebenita / Broadway

A JavaScript H.264 decoder.
Other
2.73k stars 424 forks source link

support h265 #187

Open jboeyin opened 6 years ago

jboeyin commented 6 years ago

hi, can you update it to play h265 videos?

yahsaves commented 6 years ago

Updating to h265 would require building an entirely new decoder from source. There is already a project that decodes h265 videos with Javascript you can check out:

https://github.com/strukturag/libde265.js?files=1

jboeyin commented 6 years ago

Yeah, actually I had used that project before I start this session, look, it has much bad experience with decoding experience, it took entire CPU on the Mac book, and it can't be working on mobile devices. As we can see, H265 has many advantages like smaller video size, more smoothly and more clearly, so it is reasonable to implement that decoder.

yahsaves commented 6 years ago

Unfortunately that's part of the price that comes with H265. It compresses more efficiently because it does more calculations under the hood.

You could probably improve the performance of the other project, but you would be trying to decode the latest video standard using JavaScript where most low end devices still struggle to do it using native code.

There's a reason many devices have dedicated mp4 chips, as having a dedicated chip guarantees performance and saves battery life.

Anything you do with H265 is going to be experimental at best, and when trying to decode it with JavaScript or even wasm's stack machine you're going to be in for a lot of fun.