# LiveStreamRecorderMP4 and MP4 metadata?

**URL:** <https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448>\
**Category:** Wowza Streaming Engine\
**Created:** [February 21, 2014, 4:41pm UTC](https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448 "2014-02-21T16:41:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Weatherford](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Jeremy\_Weatherford](https://community.wowza.com/u/Jeremy_Weatherford)\
**Post date:** [February 21, 2014, 4:41pm UTC](https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448/1 "2014-02-21T16:41:53Z")

</div>

Is there a way to write additional metadata fields to the header of the .mp4 file produced? I’d like to set the episode-id (TVEN) atom when recording.

Thanks,

Jeremy

---

<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:** [February 21, 2014, 11:51pm UTC](https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448/2 "2014-02-21T23:51:49Z")

</div>

Hi, Jeremy,

This method to [inject metadata](https://www.wowza.com/docs/how-to-inject-cue-points-or-metadata) in the live stream should work. The metadata should record.

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 15, 2014, 3:20pm UTC](https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448/3 "2014-03-15T15:20:24Z")

</div>

Jeremy,

I’ve been testing this and also do not find metadata injected into the live stream in the recording of the live stream. I will have to get back to you.

Richard

---

<div class="post-metadata">

**Author:** ![Jeremy\_Weatherford](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Jeremy\_Weatherford](https://community.wowza.com/u/Jeremy_Weatherford)\
**Post date:** [March 4, 2014, 11:33am UTC](https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448/4 "2014-03-04T11:33:01Z")

</div>

Okay, so I have the following in my streaming module after recorder.startRecording(stream, outputFile, false):

```auto
		// attempt to inject an episode ID
		AMFDataList amfList = new AMFDataList();
		
		amfList.add(new AMFDataItem("@setDataFrame"));
		amfList.add(new AMFDataItem("onMetaData"));
		
		AMFDataMixedArray metaData = new AMFDataMixedArray();
		
		metaData.put("tven", new AMFDataItem("XX test episode ID"));
		metaData.put("param2", new AMFDataItem("data2"));
		amfList.add(metaData);
				
		synchronized(stream)
	    {
			byte[] dataData = amfList.serialize();
			int size = dataData.length;
            long timecode = Math.max(stream.getAudioTC(), stream.getVideoTC());
            stream.setDataTC(timecode);
            stream.setDataSize(size);
            stream.startDataPacket();
            stream.addDataData(dataData, 0, size);
	    }		

```

However, the resulting .mp4 file doesn’t contain any additional data, as reported by ffmpeg:

```auto
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'c:\temp\Exam1 2014-02-24 09.35.56.mp4':
  Metadata:
    major_brand : f4v
    minor_version : 0
    compatible_brands: isommp42m4v
    creation_time : 2014-02-24 14:35:56
  Duration: 00:13:57.92, start: 0.000000, bitrate: 5283 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x
1080 [SAR 1:1 DAR 16:9], 5149 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc
    Metadata:
      creation_time : 2014-02-24 14:35:56
      handler_name : WowzaMediaServerPro
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 12
5 kb/s
    Metadata:
      creation_time : 2014-02-24 14:35:56
      handler_name : WowzaMediaServerPro

```

How can I inject metadata that will be written to the mp4 file?

Edit: also checked with a hex editor, and the strings written out don’t appear anywhere in the mp4 file, so it’s not just a matter of ffmpeg not reading them.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Becker](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Sebastian\_Becker](https://community.wowza.com/u/Sebastian_Becker)\
**Post date:** [September 4, 2014, 8:18pm UTC](https://community.wowza.com/t/livestreamrecordermp4-and-mp4-metadata/40448/5 "2014-09-04T20:18:01Z")

</div>

Hi,

are there any news on that? I guess I have the same problem.

**Current Setup:**

Streaming webcam from FlashPlayer (web) to Wowza-server and recording it there.

Generating Metadata (title / description) via FlashPlayer / Netstream.Send

I verified that the metadata is delivered to and recognized by Wowza-Server:

```auto
byte[] data = metaDataPacket.getData();
AMFDataList metaDataList = new AMFDataList(data);
logger.info("StreamListener '" + stream.getName() + "' | onMetaData: "+metaDataList.toString());

```

```auto
INFO server comment - StreamListener 'video-1409042059-1785536785' | onMetaData: 
{Obj[]: description: "Eine Beschreibung", caption: "Test-Caption", title: "Ein Titel"}

```

Also, when I use FLV instead of H264-Encoding in Flash, i get the metadata perfectly recorded.

But this is no option since FLV is poor quality with big file sizes.

I did not try different H264-Settings in Flash.

But this seems no problem since the metadata is passed to the server and can be decoded there.

Here are my H264-Settings if they do matter:

ActionScript:

```auto
var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3);
netStream.videoStreamSettings = h264Settings;

```

thanks for reading.
