New Whitepaper: Architecting a Video Encoding Strategy Designed for Growth
Creating the right encoding renditions to reach today's array of connected devices is challenging.
Creating the right encoding renditions to reach today's array of connected devices is challenging.
Note: This is Part 2 of a series on building an application around Zencoder. In part 1, we built a basic application that allowed us to upload a file, transcode it, and publish the Zencoder notifications to the browser via websockets. If you'd like to start from the end of the last post, clone the repository and checkout the branch "3_personal-namespace". $ git clone git@github.com:zencoder/zensockets.git $ cd zensockets $ git checkout 3_personal-namespace Adding in persistance In the first post, we concentrated entirely on the foundation of the app and handling notifications, but we never saved any information about the videos themselves. In the app's current state, once a video is uploaded and all the notifications are sent, it's like it never happened at all. In this post we'll add the ability to persist information about uploaded videos to a database so we can save extra information about videos and show a list of uploads to new visitors. In order to avoid needing to install a database server on our development environment, we'll use NeDB. If you're familiar with SQLite, you can think of NeDB as the Node.js, NoSQL equivalent. Just like SQLite, this isn't something you should use in production, but we'll go over concepts that translate well to any database or language.
Note: This is a a refactored version of a blog post on the same topic from May 28. Video is complicated. If you've ever used FFMPEG on the command line, you know the number of flags available can be staggering. Zencoder allows developers to focus on building applications around video without needing to build (or scale) their own encoding solution from scratch. That being said, developing a full-featured application is difficult, and doing so around Zencoder is no exception. This is the first post in a series that will cover the basics of developing an application around Zencoder's API by doing just that: building an application. Because of the breadth of the material we'll be covering, a basic understanding of web development is assumed. Implementing updates In order to show your users when a video is done encoding, you probably poll the Zencoder api for job progress. You don't want your users to have to sit and watch progress bars update, though, so why not let them browse other pages and receive a notification when the job is done? Because Zencoder allows you to publish notifications to any webhook, you can do whatever you want when your server receives them, such as broadcast it to connected clients via WebSockets. By the end of this post we'll have built a basic application that will send an API request to Zencoder, receive the notifications and update the front end via websockets based on those notifications. We'll be using the resulting application for future posts as well, so to save time we'll start with a basic boilerplate and build up from there.
Zencoder customer Screenlight offers a private video sharing and collaboration platform that makes it easy for video producers & editors to securely review videos with clients, get their feedback, and get video projects approved. The service solves communication and platform compatibility issues that people experience when using DVDs, email,...
We recently published a quick-start guide detailing how to publish an HLS live stream to S3 for testing purposes. If you'd like to take it a step further, you can use CloudFront as a CDN with no additional commitment. This guide assumes you've already gone through the Live to S3 quickstart guide and have that working. CloudFront Setup First we need to set up our CloudFront distribution. Log into your AWS console and go to your CloudFront dashboard. Click "Create Distribution" in the top left corner. You should now see two delivery method options. You might be tempted to select the "Streaming" option, but that's specifically for the RTMP protocol. What we want in this case is "Download", so make sure that's selected and click "Continue". When you click the input box for "Origin Domain Name", you will see a drop down menu of your available S3 buckets. Select the one you used in the Live to S3 quickstart guide, and the "Origin ID" field will automatically be populated. "Restrict Bucket Access" allows you to make it so people can only access your bucket through CloudFront. Because we'll want to be able to view both for testing later, leave this disabled.
Udemy, an online learning platform that connects students with instructors who are "tops" in a variety of fields--teachers range from celebrities to Ivy League professors--places tremendous emphasis on interactive, visual education, including video. Founded in 2010, Udemy has served more than 500,000 students who are seeking to advance their careers or foster a personal passion. Because Udemy was founded by a team of talented engineers, it originally utilized a video encoding solution that the team built themselves. But, as the Udemy offering grew and the platform needed to integrate more and more video content from a number of sources, the company began to experience issues with encoding reliability and found it difficult to scale to handle the volume of content available for processing. Troubleshooting became a full-time job and it was distracting the engineering team from other mission-critical duties. Enter Brightcove's Zencoder Cloud Transcoding service.
Video is complicated. If you've ever used FFMPEG on the command line, you know the number of flags available can be staggering. Zencoder allows developers to focus on building applications around video without needing to build (or scale) their own encoding solution from scratch. That being said, developing a full-featured application is difficult, and doing so around Zencoder is no exception. This is the first post in a series that will cover the basics of developing an application around Zencoder's API by doing just that: building an application. Because of the breadth of the material we'll be covering, a basic understanding of web development is assumed.