Get metadata of stream at any given time?

I have an HTTPProvider that will be called every minute to grab some information about a specific stream. Is there anyway (similar to the answer given here: server side code get metadata of a live stream) to retrieve this information at any time, without listening for it? Essentially I need to do this with only the VHost or Stream object from the HTTPProvider.

This is the type of data I need:

{Obj[]: author: "", copyright: "", description: "", keywords: "", rating: "", title: "", presetname: "Custom", creationdate: "Wed Mar 23 16:53:06 2011
", videodevice: "Video1", framerate: 15.0, width: 320.0, height: 240.0, videocodecid: "avc1", videodatarate: 500.0, avclevel: 31.0, avcprofile: 66.0, videokeyframe_frequency: 5.0}

Hi,

Also see the following tutorial which may be useful

https://www.wowza.com/docs/how-to-log-client-count-and-metadata-for-a-stream-every-10-seconds-modulelogviewercounts

Andrew

Hi there,

You can utilize the IMediaStreamActionNotify3 interface to collect stream data:

How to use IMediaStreamActionNotify3 interface to listen for RTMP stream events (includes codec info)

You can use WMSProperties to add properties to the stream that you can retrieve later,

stream.getProperties().setProperty("codecInfo", codecInfoString);

And then you can do the same for the onMetaData to get the metadata that you need.

Then you can extend this HTTPProvider to get to the Properties.

Also, you can call the IOPerformanceCounter object to get more info.

IOPerformanceCounter perf = stream.getMediaIOPerformance();

Salvadore

Actually, you are right, there is a built-in way:

https://www.wowza.com/forums/showthread.php?1444-Sample-code-to-extract-live-video-audio-datarate-from-metadata

My fault really, sorry for the misdirection.

Richard

Aaron,

I would give a try, see what you get.

Richard

Great, this should work perfect. Thanks.

Curious, why is metadata not apart of the stream object? It seems like that information should be stored in the stream object fields to be used and read at any moment with something like stream.getMetaData();

Oh cool, that method might work better, as the events in the listener were never triggered for some reason (onMetaData, onCodecVideoInfo and onCodecAudioInfo).

An observation of that code, it seems like there are times when that information might not exist. That doesn’t really make sense to me because if there is a stream, that stream will ALWAYS have certain information about it, like the video width and height, fps, etc. Maybe all the IFs are just to prevent nullpointerexceptions, but is it possible that a video will not have this information?

Thanks,

Aaron

Hmm, ok I tried that code, but it always breaks at this line:

if (metaDataProvider == null)
	break;

So basically there’s never any metadata. Maybe I’m not fully understanding what metadata is. I’m testing with the Big Buck Bunny sample.mp4 on a clean install apart from my plugin.

Is metadata not direct information about the video being streamed? Do I have to set it myself? I’m expecting it to be the information you get when you goto Properties > Details tab in windows on the file (though I also need this info on live streams as well as VOD).

Is this possible?