Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Afaik nvidia's NVCUVID API only supports H264 encoding, which would require a JavaScript H264 decoder. So far I haven't been able to get the one JS H264 decoder I know of (Broadway) to work reliably and fast enough for large video sizes.

I wish the industry would just get their act together and support a common video codec in browsers along with a JavaScript API that can deal with decoding single frames. Currently native streaming support for the <video> element in browsers is extremely poor and proposed solutions like MPEG-DASH or HLS add around 10 seconds(!) of latency.



The API you are looking for is WebRTC. VP8 is the most widely used codec for it, but you could use H.264 baseline if you really wanted.

You will need to include a WebRTC stack in your server though, which is a lot more complicated. But I think you will get better overall performance with it versus TCP - it's what WebRTC was designed for.

Also, you might want to look at ogv.js - if you want to keep going the JS way, it includes a very fast Theora decoder which should still be a lot better than MPEG-1.


Media Source Extensions[1] may be an option. It allows you to feed bytes to a video element, sourcing those bytes from wherever you'd like. There is a demo[2] that literally opens a video and split it in to parts arbitrarily. Chrome, IE, and Safari all have support for MP4 with MSE.

[1] https://en.wikipedia.org/wiki/Media_Source_Extensions [2] http://html5-demos.appspot.com/static/media-source.html


MSE is too high latency for this application.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: