# How to read metadata of a recorded stream from server side

**URL:** <https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [March 17, 2014, 5:50am UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001 "2014-03-17T05:50:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Perez](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Richard\_Perez](https://community.wowza.com/u/Richard_Perez)\
**Post date:** [March 17, 2014, 5:50am UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/1 "2014-03-17T05:50:18Z")

</div>

Dear All,

We have a daily live stream which is recorded with the “Record all incoming streams” setting of our application.

We would like to give the opportunity to my publisher to give some additionnal information about the stream so we implement an HTTPprovider2Base with the following code :

```auto
public void onHTTPRequest(IVHost invhost, IHTTPRequest req, IHTTPResponse resp) {
		
		String titleToSet ;
		
		Map<String, List<String>> params = req.getParameterMap();
		
		if( params.containsKey("setTitle") ) {
			
			String title = params.get("setTitle").get(0);
			
			IMediaStream stream = VHostSingleton.getInstance("_defaultVHost_").getApplication("live").getAppInstance("_definst_").getStreams().getStream("afopi");
			
			if (stream != null)
			{
				AMFDataMixedArray data = new AMFDataMixedArray();
				data.put("title", new AMFDataItem(title));
				stream.sendDirect("onTextData", data);
				
				WMSLoggerFactory.getLogger(null).info("SetTitle : " + title);		
			}	
		}

```

So normally the metadata title is added to the stream and then to the recorded stream.

I now need to read this metadata from a server side module? is there some kind of MP4 utils to read these information?

Best regards

Richard

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [March 17, 2014, 8:29am UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/2 "2014-03-17T08:29:16Z")

</div>

Hi Richard, take a look at this forum thread. It may be helpful for what you need:

[server side code get metadata of a live stream](http://community.wowza.com/t/-/547)

Salvadore

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 17, 2014, 2:36pm UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/3 "2014-03-17T14:36:23Z")

</div>

Richard,

Note that your code is inserting a cuepoint (timed text) not metadata. [Take a look at this article](https://www.wowza.com/docs/how-to-inject-cue-points-or-metadata) which shows how to do both.

Also, in my recent test the metadata injected with this method into a live stream is not recorded in the file. I am looking into that. The method you are using the inject a cuepoint should work in the live stream and recording.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 17, 2014, 4:58pm UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/4 "2014-03-17T16:58:40Z")

</div>

Richard,

Metadata is associated with the file, but not a timecode. The cuepoints are associated with a timecode. The data from a cuepoint is streamed to the client in a recording at that time code, or in a live stream as you are doing it immediately

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 17, 2014, 6:10pm UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/5 "2014-03-17T18:10:27Z")

</div>

Do you mean without playing it? I think there are 3rd party programs that read and set cuepoints, like captionate.

To listen for a cuepoint during playback in RTMP client you have to do something like this:

```auto
nsPlay.client = nsPlayClientObj;
			
nsPlayClientObj.onTextData = function(obj:Object):void
{
	captionOutput.text = obj.text;
}

```

This is what you would need client-side for the example shown in the cuepoint/metadata article for the cuepoint named “onTextData”, which includes Object (AMFDataMixedArray on the Wowza side) with a .text field.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 19, 2014, 5:06pm UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/6 "2014-03-19T17:06:01Z")

</div>

We’re taking a look at this, will update you when I learn more.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Perez](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Richard\_Perez](https://community.wowza.com/u/Richard_Perez)\
**Post date:** [March 17, 2014, 6:45am UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/7 "2014-03-17T06:45:32Z")

</div>

Ok i have read the thread and there is two things i don’t understand.

I understand that metadata trigger the “onMetaData” function when the stream is played.

1. Does it mean that metadata are allways link to a TimeCode? In fact i just need to be able to add a general title to a stream like the title of mp3 in ID3 tag.

Does my previous code define a general metadata or is the title link to a TC? Is there a way to define this kind of general title?

1. The problem is that my server-side module doesn’t play the VOD file it just check loop through the files in content directory and delete files on different criterion (oldest files and anormaly short file). So i need to read metadata without playing the file. Is there a way to do that?

Best regards

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Perez](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Richard\_Perez](https://community.wowza.com/u/Richard_Perez)\
**Post date:** [March 17, 2014, 9:33am UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/8 "2014-03-17T09:33:35Z")

</div>

Ok thank you for your explanation.

So if i need to embed some information in my live stream and make them survive the recording process, i need to use cuepoints.

Is there a way to retrieve cuepoint from a video file without reading it?

Thanks

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Perez](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@Richard\_Perez](https://community.wowza.com/u/Richard_Perez)\
**Post date:** [March 17, 2014, 11:00am UTC](https://community.wowza.com/t/how-to-read-metadata-of-a-recorded-stream-from-server-side/40001/9 "2014-03-17T11:00:52Z")

</div>

Thank you for all your explanations. I will have to find another way to store metadata.

Do you think having metadata (not the kind which is associated with TC) store into the recorder file will be on Wowza Road Map?
