Tutorials · 6 min read

video metadata

Video Metadata: Exploring advanced use cases and their benefits

Learn what is video metadata and how it finds application in various scenarios like e-learning or video sharing.

Zoltán

February 23, 2024

Metadata, within the context of api.video, is like a Swiss Army knife - it gives you a simple set of tools to solve countless complex problems. It can help you integrate video-on-demand (VOD) into your platform or application, all the while supporting and even enhancing the way you build your product.

What is metadata?

Metadata enables you to add an extra layer of data to the videos that you or your users upload. You can define an array of custom key-value pairs and use the values to enhance your application or website. Each video can have multiple key-value pairs in a metadata array, and you can use them to filter for specific content when listing videos, and to integrate video content into your app or website. You can add, edit, or remove metadata from video using both the api.video API and the Dashboard.

 

Now, let’s dive into some use cases where video metadata can be a game changer!

Video metadata for e-learning use cases

In this use case, we will look at how using metadata can help you solve some common problems that you might encounter when creating an e-learning platform.

 

Let’s say you want to offer video lessons for your users, and that you want to enable teachers to create courses (a series of lessons) on different topics, and varying levels of difficulty. For the sake of this example, let’s propose these courses:

 

  • Basic Node.js - 5 lessons
  • Advanced Node.js - 10 lessons
  • Advanced Sushi Making - 8 lessons  

These courses already imply a very large amount of background information that you’ll need to handle. Think about questions like:

 

  • How do you know the order of lessons?
  • What if you want to show all lessons on a certain difficulty level, regardless of the course?
  • What if multiple teachers create lessons in the same course and you want to give them extra payments based on how popular their lessons are?
  • What if you want to enable students to rate lessons on a scale of 1 to 10?
  • Better yet, what if you want to enable teachers to grade video-based homework for your students using your platform?

 

All of this fits neatly into metadata. Here’s an example set of key-value pairs that could belong to any lesson’s video:

 

json

Now let’s see how a student’s own video submission can be enhanced with metadata by giving them a few fields that they can fill out:

 

json

How to add video metadata to your e-learning solution

Let’s dive into the endpoints can help you solve the above problems.

 

  • First, you create a video object. This is the step where you can define the metadata attributes for each video object. Then, you upload a video into that video container object.
  • You can surface some of the relevant fields for your teachers who would upload their videos: course_id, lesson_number, difficulty_level, and so on.
  • For students, you can surface the uploader_notes field on your platform.
  • For listing and filtering by metadata on your frontend, use the list all videos endpoint. You can use the metadata keys and values in your request as query parameters to filter specific content. For example you can list all homeworks with this simple request query:

json

  • For video ratings, use the update a video endpoint. Make sure you track the different users who already rated a specific video based on their user ID and the videoID. Store their ratings and simply calculate an average rating, then use that result to edit the video metadata in the metadata.value field where metadata.key is rating.
  • For grading homeworks, you can also use the update a video endpoint. Just update the metadata.value field where metadata.key is grade. You can make excellent use of the video.encoding.quality.completed webhook to create notifications for teachers whenever a video with metadata.key = type and metadata.value = homework is uploaded. Learn more about webhooks in the developer documentation!

 

Remember, you can use any of these key-value pairs to list videos - use them to create a nice filtering & ordering functionality on your platform for a better user experience.

Video metadata for sports-themed video sharing use case

In this use case, we will look at how metadata can help you offer a platform where people can share their adventures through videos. You can also make things a bit more exciting by offering them the functionality to display their videos’ locations on a map.

 

For the sake of this example, we will enable users to vote with 👍 / 👎 on specific videos, and store the results in metadata for accurate tracking.

 

In such a case, when users upload a video, you can use the metadata field to define key-value pairs like these:

json

How to add video metadata to your video sharing platform

Now, let's see the endpoints that can help you solve the above problem.

 

  • The first few steps are the same as with the e-learning use case:
  • For listing and filtering by metadata on your frontend, use the list all videos endpoint. Here’s an example request query that filters the mountain cycling videos:

json

  • You can use open-source tools to grab the geolocation tags from the uploaded video files. You can then feed these coordinates to any map API, and display them per user. There’s a host of interesting directions that you can take with this! You can even make this a full-fledged feature by accepting trek logs, or GPX files from your users and feeding them to a map API to display routes instead of single points of interest.
  • For the 👍 / 👎 feature, you can implement a like & dislike button on your frontend, and store the number of likes and dislikes to calculate an overall score for each video.
  • Make sure you track users who push these buttons to avoid duplicate votes!
  • Read the value of score through the Retrieve video object or List all video objects endpoints when you load the videos on your frontend.
  • When you update a score after a user voted, use the update a video endpoint to update the metadata.value field where metadata.key is score.

 

There you go, that's it!

Appreciating the significance of video metadata is important when it comes to online videos. This essential element acts as the foundation for organizing video content, enhancing searchability, and customizing video experiences. Whether you're someone building an app or a content creator or a viewer, the use of metadata is sure to unlock fresh routes for engagement and discovery.

 

Dive into the developer documentation to understand more.

 

To start using api.video and see how all this works, sign up for a free sandbox account now!

Try out more than 80 features for free

Access all the features for as long as you need.
No commitment or credit card required

Video API, simplified

Fully customizable API to manage everything video. From encoding to delivery, in minutes.

Built for Speed

The fastest video encoding platform. Serve your users globally with 140+ points of presence. 

Let end-users upload videos

Finally, an API that allows your end-users to upload videos and start live streams in a few clicks.

Affordable

Volume discounts and usage-based pricing to ensure you don’t exceed your budget.