Results 1 to 10 of 10

Thread: Play2 and Metadata

  1. #1

    Default Play2 and Metadata

    If I understand correctly, FMS sends the Metadata for the new file after a transition succeeded (http://www.adobe.com/devnet/flashmed...ionscript.html) in the 'details' object.

    Wowza doesn't seem to do this so the new Metadata is not available (eg width and height for a higher resolution video that was transitioned to).

    Is there any way to get the new Metadata after the file changed without waiting for eg a seek event?

  2. #2
    Join Date
    Dec 2007
    Posts
    25,661

    Default

    Wowza does send the new metadata on switching.

    Richard

  3. #3

    Default

    PHP Code:
    #Software: Wowza Media Server 2.1.1 build24490 
    This is the result for onPlayStatus after the transition is successful:

    PHP Code:
    [0] => [0]
    [
    1] => [null]
    [
    2] => {
            [
    description] => "Started playing file_high.mp4.",
            [
    clientid] => "123456",
            [
    isFastPlay] => "false",
            [
    level] => "status",
            [
    code] => "NetStream.Play.TransitionComplete"                
            

    onMetaData is not called after the transition.

    So it's maybe another function that is called for the new MetaData?

  4. #4
    Join Date
    Dec 2007
    Posts
    25,661

    Default

    onPlayStatus and onMetaData are separate callbacks on the NetStream.

    Take a look at createPlayStream function from SimpleVideoStreaming player:

    Code:
    private function createPlayStream():void
    {
    	nsPlay = new NetStream(nc);
    	nsPlay.addEventListener(NetStatusEvent.NET_STATUS, nsOnStatus);
    	
    	var nsPlayClientObj:Object = new Object();
    	nsPlay.client = nsPlayClientObj;
    			
    	nsPlayClientObj.onMetaData = function(infoObject:Object):void
    	{
    		trace("onMetaData");
    		//clearInterval(progressTimer);
    			
    		// print debug information about the metaData
    		for (var propName:String in infoObject)
    		{
    			trace("  "+propName + " = " + infoObject[propName]);
    		}
    		
    		// grab the movies duration from the metadata
    		if (duration == 0)
    		{
    			duration = infoObject.duration;
    			slider.maximum = duration ;
    			progressTimer = setInterval(updateProgress, 250);
    			nc.call("getStreamLength", new Responder(theresult), streamStr.text);
    		} 
    	};		
    		
    	// print debug information when we encounter a cuePoint
    	nsPlayClientObj.onCuePoint = function(infoObject:Object):void
    	{
    		trace("onCuePoint: "+infoObject.name+" ("+infoObject.type+")");
    		var param:String;
    		for(param in infoObject.parameters)
    		{
    			trace("  param: "+param+"="+infoObject.parameters[param]);
    		}
    	};
    			
    	// print debug information when we play status changes
    	nsPlayClientObj.onPlayStatus = function(infoObject:Object):void
    	{
    		trace("onPlayStatus");
    		for (var prop:String in infoObject)
    		{
    			trace("\t"+prop+":\t"+infoObject[prop]);
    		}
    	};
    	
    	// set the buffer time and attach the video and audio
    	nsPlay.bufferTime = 3;
    	videoObj.attachNetStream(nsPlay);
    			
    	// start playback
    	isProgressUpdate = false;
    	isPlaying = true;
    			
    	nsPlay.play(streamStr.text);
    }

  5. #5
    Join Date
    Dec 2007
    Posts
    25,661

    Default

    Is it a live stream? In that case there is no metadata.

    Richard

  6. #6

    Default

    Richard,

    thanks for your fast reply.

    Of course these are two callbacks.

    With "Play" everything works as expected as the callbacks to onMetaData and onPlayStatus are fired.

    You can see in my posts that the problem is related to "Play2" and the transition after a dynamic switch to a new file. With "Play2" only onPlayStatus gets triggered.

    As it's already a bit weird that Wowza sends the data to the onPlayStatus callback in obj[2] instead of obj[0] with Play2, I am thinking that the MetaData maybe gets send somewhere else instead of onMetaData?

  7. #7

    Default

    it's vod btw

  8. #8
    Join Date
    Dec 2007
    Posts
    25,661

    Default

    I tested with JW Player, and it is working. I added some traces statements to track through a couple of transitions:


    Code:
    Type IS: metadata
      type = metadata
      audiocodecid = mp4a
      audiochannels = 2
      duration = 653.883
      avclevel = 30
      videoframerate = 24
      aacaot = 2
      moovPosition = 36
      audiosamplerate = 44100
      videocodecid = avc1
      avcprofile = 66
      height = 406
      tags = 
      trackinfo = [object Object],[object Object]
      width = 720
    Type IS: bandwidth
      bandwidth = 42598
      type = bandwidth
    Type IS: undefined
      clientid = BIAg4S4J
      level = status
      details = 8Juv1MVa_1500.mp4
      reason = NetStream.Transition.Success
      description = Transitioned to 8Juv1MVa_1500.mp4.
      code = NetStream.Play.Transition
    Type IS: playstatus
      type = playstatus
      level = status
      code = NetStream.Play.TransitionComplete
    Type IS: metadata
      audiosamplerate = 44100
      duration = 653.883
      videocodecid = avc1
      type = metadata
      avclevel = 30
      moovPosition = 36
      trackinfo = [object Object],[object Object]
      audiocodecid = mp4a
      videoframerate = 24
      width = 1080
      height = 608
      tags = 
      audiochannels = 2
      aacaot = 2
      avcprofile = 66
    Type IS: undefined
      level = status
      details = 8Juv1MVa_1100.mp4
      reason = NetStream.Transition.Success
      description = Transitioned to 8Juv1MVa_1100.mp4.
      clientid = BIAg4S4J
      code = NetStream.Play.Transition
    Type IS: playstatus
      type = playstatus
      level = status
      code = NetStream.Play.TransitionComplete
    Type IS: metadata
      type = metadata
      trackinfo = [object Object],[object Object]
      duration = 653.883
      aacaot = 2
      videoframerate = 24
      videocodecid = avc1
      avclevel = 30
      audiosamplerate = 44100
      avcprofile = 66
      width = 720
      height = 406
      tags = 
      audiocodecid = mp4a
      audiochannels = 2
      moovPosition = 36
    Richard

  9. #9

    Default

    Thanks,

    I'll inspect the source of the JW Player and hopefully find what I am missing.

  10. #10
    Join Date
    Dec 2007
    Posts
    25,661

    Default

    If it helps, here is where to look:

    com.longtailvideo.jwplayer.media.RTMPMediaProvider /onClientData

    The trace lines I added are:
    Code:
    public function onClientData(dat:Object):void {
    if (!dat) return;
    // I added
    trace("Type IS: " + dat.type);
    for (var propName:String in dat)
    {
    	trace("  "+propName + " = " + dat[propName]);
    }
    ...
    Events are sent to and forwarded from:
    com.longtailvideo.jwplayer.utils.NetClient

    Richard

Posting Permissions

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