Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Images and Video > 4.11. Video Processing

4.11. Video Processing

Videos are big business. In 2006, Google acquired YouTube for $1.65 billion, and today according to Google, YouTube accounts for more than 20 percent of Internet traffic worldwide. Once almost exclusively the realm of Flash, the landscape of video on the web has tilted drastically toward HTML5.

HTML5 provides a video element that lets you play and control videos. And the Canvas API lets you process videos, frame by frame, as the video plays.

Recall from Section 4.1.2, “The drawImage() Method,” on p. 257 that besides drawing images, drawImage() can draw a video frame into a canvas, like this:

var video = document.getElementById('video'); // A <video> element
...

context.drawImage(video, 0, 0); // Draw video frame


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint