Kagami / webm.js

JavaScript WebM converter

Home Page:https://kagami.github.io/webm.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Software player performance

Kagami opened this issue · comments

I'm going to replace HTML5 player with software one, powered by ffmpeg's decoders, in order to be able to play and edit any video files. Realtime decoding is not that important since user may select heavyweight sources but it may be worth to think whether we can optimize it a bit.

I will start with simple and slow one-ffmpeg-call-per-one-frame, later we can try to adapt some ideas from ogv.js project.

So I implemented primitive software decoder. Some ideas how it could be improved:

  • Use bmp format instead of jpg? It should be a bit faster since there is no compression. Though it weights more (more data to send & store) so benchmark is needed.
  • Prefetch following frames, store them in cache
  • bmp was slower in my few simple tests
  • Added simple background prefetcher (only one thread for now)

Current implementation is slow and kludgy so it's not worth to tune it even more. Correct implementation will require separate build (player code with Emscripten interface linked to ffmpeg) and a lot of effort, but since our primary goal is encoding, it can wait for some time.