Results 1 to 5 of 5

Thread: LiveStreamRecorderMP4 and MP4 metadata?

  1. #1
    Join Date
    May 2013
    Posts
    13

    Default LiveStreamRecorderMP4 and MP4 metadata?

    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

  2. #2
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Hi, Jeremy,

    This method to inject metadata in the live stream should work. The metadata should record.

    Richard

  3. #3
    Join Date
    May 2013
    Posts
    13

    Default

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

    		// 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:

    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.
    Last edited by jweather; 03-04-2014 at 09:41 AM.

  4. #4
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    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

  5. #5
    Join Date
    Nov 2013
    Posts
    6

    Default

    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:

    byte[] data = metaDataPacket.getData();
    AMFDataList metaDataList = new AMFDataList(data);
    logger.info("StreamListener '" + stream.getName() + "' | onMetaData: "+metaDataList.toString());
    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:
    var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings();
    h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3);
    netStream.videoStreamSettings = h264Settings;
    thanks for reading.

Similar Threads

  1. How to get metadata of a vod mp4 file in wowza's content directory
    By lidabnu@126.com in forum On-Demand Streaming
    Replies: 1
    Last Post: 08-06-2014, 03:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •