Snapchat Style Filters with Tracking.js and Vonage
The Vonage Video API platform is used to embed real-time, high-quality interactive video, messaging, screen-sharing, and more into web and mobile apps. A lightweight JavaScript library called Tracking.js is used for face detection and color tracking in the browser environment. The application uses a base from OpenTok web samples for stream filters that can be edited. To start coding, you need to configure the application as it is and get a feel for the starting point by creating a project with Vonage Video API, generating a token, and setting up dependencies. The application then creates a new filter called "Brighten" and another one called "Threshold". Facial tracking with Tracking.js is added to render an image over the face like a mask. Two masks are created: Guy Fawkes and Batman, which can be applied to the stream using a select box in the application. The application also includes a live video stream that allows users to see their own faces with the different filters.
Company
Vonage
Date published
Nov. 16, 2020
Author(s)
Luke Oliff
Word count
3024
Language
English
Hacker News points
None found.