8

I'm currently working on a project where there is a requirement to dynamically composite multiple synchronised video sources onto a single canvas. The initial prototype I put together loaded the video into HTMLVideoElements and then used requestAnimFrame (via Paul Irish's shim) to draw these onto a single canvas and maintain sync between the different elements.

Although this is functional and the system can hold sync fairly well (+/- 80ms tolerance) it is somewhat inefficient to say the least. I've been thinking about optimisations and one approach that seems pretty straight forward is to combine all the media into a single larger 'video sprite' and serve this. This would allow it to be load into a single video element which could then be used extract and render the areas of interest client side using drawImage() and remove the need to manage sync between sources.

Has anyone else implemented something similar in the past? If so what approach worked well for you?

Kim Burgess
  • 1,093
  • 7
  • 15

1 Answers1

1

Have you checked out popcorn.js?

Popcorn.js is an HTML5 media framework written in JavaScript for filmmakers, web developers, and anyone who wants to create time-based interactive media on the web. Popcorn.js is part of Mozilla's Popcorn project.

http://popcornjs.org/

tara
  • 11
  • 2
  • Yep, all over popcorn. Unfortunately however it addresses a different set of issues. The challenge faced in this project was to do with maintaining sync between a set of dynamically selectable media resources. – Kim Burgess Feb 07 '12 at 22:31