Wowza Video API Session 5: Asset Management

Now that you’re more familiar with Wowza Video, it’s time to discuss something you’ll definitely want to learn about: asset management. In this API how-to session, we’ll dive into how to create, organize, and manage video assets to make them discoverable, as well as how to add metadata and re-stream previous videos as live. Watch the video above or read the transcript below to get started.

*Note: You can access the Postman file for this session and previous sessions at this link.


Creating an Asset

Barry Owen: Hey everybody, Barry Owen back again with Rose Power.

Rose Power: Hey Barry, nice to be back with you again.

Barry Owen: Cool. Today, we’re going to do another session of our Wowza Video API series, which is session five, we’re going to talk about asset management within Wowza Video. Asset management is one of those features folks have been asking us for a long time, so it’s great that we have that in there. It really makes a Video on demand a first-class citizen within the Wowza Video platform.

Let’s get started. We’re back here again in our Postman, building on the previous sessions we had before so we’re just going to go ahead and get started. The first thing we’re going to want to do is create an asset. In this case, what we’re preparing to do is to upload a file from, in this case, my local storage into the asset management system. What you’ll see here is I just happen to have a portion video that I’m going to upload, and that’s really all I need to do to start; is just specify the file name of what I’m going to upload.

We’ll go ahead and send, and we’re going to get some interesting stuff back that I’ll hide here. We get the file name, we get an ID, and we also get this upload URL. In this case, what this allows us to do is easily push that file into a storage location that’s going to allow us to upload that file and get it processed, and you’ll notice over here in the UI, down at the bottom here, it sees that we’re getting ready to do that. I already have this set up, but in Postman it’s quite easy. Your content type is MP4 here in your headers, and in your body I chose binary, and then I selected a file to upload. In this case, I have this video on my disc that I’m going to upload, and it’s just a short little clip I downloaded from the web somewhere.

We’re going to go ahead and send this and what this is going to do is it’s going to call that API — uh-oh — well, it worked the second time. Apparently, Google didn’t like me the first time, but the second time it worked. The file is uploaded so we’re good to go. Now, what we’re going to do is we’re going to tell Wowza Video that the file’s there and ready. If for some reason your file didn’t upload properly, or you need to restart it, you can call this failed function. I’m going to go ahead and call the upload function. Again, I’ve pre-populated this with the duration of the asset and the file size of asset I uploaded.


Retrieving File Details

Barry Owen: All right. Now, we get some more information. We have a complete picture of our asset here within the platform, and some stuff we see that there’s currently no description for. There’s no available renditions because the file hasn’t processed yet. You’ll see the state of the video is processing. You’ll also see over here in the UI that it kicked over into the processing state. Basically, the file’s been uploaded the platform. Now, what we’re doing in the background is we’re taking the file, we’re grabbing some metadata of the file that we’ll use in the UI.

You’ll see that. Let me go over here to a cleaner page. Once the file is processing, it will go ahead and create a set of ABR renditions and an HLS asset that we store in the platform. As we talked about, if for any reason your upload failed, you can let the system know and it will put the asset in a state you can either start over or delete it and start over. In this case, our upload worked so I’m not going to actually make this call, but you get a response back that your upload tokens expired — maybe the Google API’s down, whatever it is — and you could notify Wowza Video that happened. As far as the status goes, I did some of my Postman tricks here where I captured our asset ID via a script. I should probably go and show you that.

API and computer graphic

If you’ve played with the Postman files I’ve written before I used these test scripts to populate local variables, to make the flow of the Postman really seamless. You don’t have to copy and paste IDs or do any of that stuff. It handles all this for you. I’ve pre-populated some things, so I can go down here and I can get the asset status and I know the IDs already set so I can send. What we’ll see here is it’s still processing. I do have a playback URL assigned. That playback URL won’t be ready until this is in fact done processing and playback enabled is set to True.

What you’ll see that in the UI is you’ll see that playback enabled is known as in the UI, it’s marked as Published. The asset can either be published like you see over here, or it can be unpublished if it’s not ready for people to view yet. Maybe that’s because you haven’t added the metadata or you haven’t added a description or things like that. You’re just not quite ready yet, or the file’s not done processing. Next, what we can do is add things to it ,and I think what I’m going to show you here is actually not going to work because the file’s not done processing yet. Let’s go ahead and hit it and you’ll get it.


Adding Tags

Barry Owen: You’ll get a notification here that, hey, it’s not done yet, you need to wait till the processing is done. But what we were going to do here is we were just going to add some simple things and I’m going to show you these in the UI real quick. But basically, we added a description, we added a name. In this case, we also added some tags. I’m going to show you an example of that over in the UI to see what this would’ve looked like. If you go look at this asset here, it’s got a title, of course. You notice that it has some tags down below and those were added either via the UI or they can also be added here — same thing, and you can add or delete tags just like this.

Rose Power: And so, if I understand correctly, this isn’t for SEO or search tags or anything like that. This is for organizing your videos because I know a lot of our customers that use Wowza Video have sometimes hundreds or thousands of video assets. This would be a quick way for them to search for certain videos within the CMS. Am I saying that correctly?

Barry Owen: Yeah, that’s exactly right. I mean, imagine you have a lot of videos, right? In this case, the easiest thing for people to relate to is let’s say you have an OTT platform and you have a bunch of content. Well, those content could be TV shows, it could be movies. You could put genres in there. This could be a science fiction. You could put actors, you could put producers, anything in kind of you can build a structured tag set or a taxonomy that really helps you with your customers’ interface, expose those things to a lot of the users to filter and discover content much more easily. Tags are very powerful feature. You can also of course do a full tags search on the description and the titles, but what you’ll find is that the tags are super useful for finding content.

Rose Power: Okay.


Adjusting an Asset

Barry Owen: Again, our asset is still processing and that’s fine. Once it’s done, you have the ability to publish or unpublish an asset just by toggling the playback flag. I’m going to go grab a different one here, grab the idea of this asset to show you. We’re going to go in here. Oh, sorry, I did the wrong way. I want to actually make it False. Get the response back, you see that it’s now we’re going to go back over into the UI and you’ll see that now this asset’s unpublished. What that means is that the asset won’t show up in search results and the URL is not playable. That allows you to hide content that’s a work in progress or something like that from people being able to be discovering and in play.

All right. Now, we’re going to go back. That’s the process of getting an app, getting an asset into the system, manipulating the asset, changing it, creating the description, publishing on public. That’s for effectively single assets, and of course, you can also delete them. Now, on a broader scale, you can also go back and you can go back and you can get a list of all your assets. This gives you just everything in the system. This may be useful if you’re looking to build an index or something like that, where you just want to show people a list view of everything in there. Of course, you can also paginate it so you can say how many pages you want, how many items per page. That allows you to create user interfaces that are a little more compact, where you may want to have it next, here. Let me hide this, where you may want to have next buttons here and things like that for you to be able to continue to look.


Live-to-VOD Assets

Rose Power: Barry, if you’re going to cover this, just tell me to be patient.

Barry Owen: All right.

Rose Power: This is really cool for me to say, we haven’t seen anybody do this with the API yet. I’ve only been using the UI. Is there another way that you could do live-to-VOD and then have that asset stored in the same?

Barry Owen: Yeah, absolutely. What you’ll see here in both in this list, as well as over here in the user interface is this is in fact a live-to-VOD asset right here. This was a demo that one of our ISCs did and it was when he created the live stream, he made this selection to save this into the asset management system and you see that it shows up in here as an asset. Then you can do all the same things with them. You can publish, unpublish, you can add the metadata, you can add descriptions, so we can go over here and take a look at one of these in the UI and you’ll see that it went ahead and it created or in this case actually persisted the HLS, ABR ladder.

It’s got a playback URL. It’s got a title. It doesn’t have any description, but he has gone back here and added some tags. Again, everything you saw me do with an uploaded asset, you can absolutely do with the live-to-VOD workflow, which is very powerful and keep those live assets available for future viewing, which is great. The other important thing, obviously, listing the assets is great, but if I have 10,000 assets, listing the assets doesn’t really help me a ton. I probably want to be a little more granular than that. Of course, there’s a full featured search capability, right?

video transcoding graphic

Searching Your Library

Barry Owen: As I said, you can search by name, you can search by tag, you can search by description and then you can add some filters in there to sort by creation date or things like that. I’ll show you that in a sec, but let’s just do a basic search. In this case, you can see what we’ve done here as we’ve just added a query equal on here, and in this case, we’re querying for the word Jeep, so let’s see what happens. As you can see here now, we’re going to get back our assets that have Jeep and both of these have Jeep in the title. If we went and dug in, some of them also have Jeep in the tag. Just because it’s in the title here, I could have a different video altogether that has Jeep as a metadata tag, and it would show up as well. It’s not just because it’s in the title.

In this case, we came back with two records and you see that this one in effect is unpublished, so I lied. It actually does show up in the search results. So you want to filter that on the UI side for anything you’re going to create, because what happens when this playback enabled is false, this playback URL is actually not going to work. It’s not going to return new data. Up to you if you wanted to be able to find them, you can hide those from your user interface if you don’t want to show those ones that are not published, or in the case of certain workflows, you may want to show them and just say, they’re not published. Do you have a question, Rose?

Rose Power: I was just going to comment. Actually, it sounds to me using tags is really important if you’re going to have a large library of assets. I don’t know how else you would search, ID possibly, but just pointing out this is very important for organizing.

Barry Owen: Yeah, especially if you’re using, you’ll see many cases in our UI over here that it’s in fact we have default titles for the title of the video to just be the file name or the live-to-VOD session. Probably what you would do if you were building a big content library is you’d probably add a descriptive title. You’d probably add a descriptive description and you’d probably add a group of tags. Those are really the right way to go about going and generating the search interface capabilities you’re after. Let’s see.

Barry Owen: I’m going to go back over here real quick and it looks like our asset is done. Yeah, you can see that actually is now moved to completed. You see the file that we uploaded over here is in fact there and in an unpublished state. Now, we’re actually going to go back and redo our edit methods here, going to add a little bit of metadata to it, and then I’m going to publish it, and then we’re going to go look at it in the UI. You can see that it is in fact published. It does have a description. It does not look like my tags worked so I did something wrong there that I’ll go back and look at later.But now, this video is available and viewable. It took a few minutes, I don’t know exactly how long it is, but takes a few minutes to process. But now, it’s in there, searchable.

Let’s get back to searching. We searched by Jeep. We found some assets. That’s great. What if we have hundreds of assets that turned back with Jeep? Well, we can go and we can sort them. In this case, we’re going to look at assets that have the word Tim in them, and we’re going to look at how to sort them.

In this case, we’re going to sort them by name. You have different ways to sort, and also down here at the last, it’ll tell you how many records and how it paginated by default, you can paginate this as well. When you call the API, if you only want to get back five records at a time, great, you call for five records at a time and you get page one, you ask for page two, you get the tech and five things like that. Very flexible, very easy to find, sort and filter exactly what you’re after.


Previews and Re-streams

Rose Power: Over in the UI, those little thumbnails there, when you click on one of those videos, can you get a little preview to play that video? Do you have to open it?

Barry Owen: Yeah.

Rose Power: Oh, cool.

Barry Owen: If you go in the UI, you can actually — this might be loud — you can actually play it there and see the video. Of course, you can go to the URL and you can play it or you can download it and grab it. Obviously, in most cases, you’re going to want to take this HLS, URL and embed this into a player and through your experience and play it back. You can also, from the UI or from the API, but from the UI, you can also re-stream this asset as live. What this button in the UI is a shortcut for creating a live stream with this file, as what’s going to be streamed as a source. That’s powerful if you want to create effectively VOD as live playback. You’re playing this back as live so obviously people can’t search ahead or things like that. They have to watch what you’re giving them and that’s one way to do VOD or linear that many people use.

Rose Power: That’s really neat. I actually didn’t know we had that button.


Sort by Creation Date

Barry Owen: It’s very handy. Lastly, what we have in the example is just another way to sort assets. In this case, I’m sorting by creation date. I wound up looking for lake. I only turned one, so let’s go. Let’s put in one where I know is going to return a bunch of records. You’ll see this one and now these are actually sorted by creation date from most recent to oldest. This also gives you… The thing I’m trying to highlight here in this is just the search API is very flexible. I encourage you to grab it and just play with it. You can build your own queries, gives you a way to really discover and how to present that content to your users via search. One other thing that’s useful that I threw in here is we’ve talked about tags quite a bit.

There’s a handy little function here that allows you to get all of the tags that are currently in your system. This just gives you a snapshot where this comes in useful is if you’re building an interface and you want to do, what’s called a faceted search, you can really easily do this as far as presenting these to users for categories, people could drill down on with a search via click. That’s a pretty nice feature to have where if you’re building an interface and you have a taxonomy here that’s built with a little more structure, ours is pretty free form here on this demo site, but that really allows you to go build a nice interface for people to drill down on stuff. You can imagine if this was science fiction, drama, comedy, things like that, where people could easily click and drill down and you can build that into your UI. That in a pretty quick nutshell is some of the capabilities of the asset management platform, uploading assets, modifying assets, publishing, unpublishing, and the ability to search. Before we wrap up, any other questions on these APIs, Rose?

Rose Power: I don’t have any questions. I thought that was really informative. I learned a lot when I work here so I think it’s going to be really helpful for our viewers. Thank you.

Barry Owen: All right. Well, thanks everybody, and we’ll be back shortly with our final session and that will delve into the analytics platform.


Search Wowza Resources



Follow Us


About Barry Owen

Barry Owen is Wowza’s resident video streaming expert and vice president of solutions engineering. In this role, he leads a team dedicated to helping customers succeed. From architecting custom applications to solving complex problems, Barry leverages more than 25 years of experience developing software-as-a-service, cloud-based, and live streaming platforms to create innovative solutions that empower organizations across every use case.