Wowza Community

onFillChunkDataPacket behavior for RTMP and RTSP publishing

I’m new here, so my question might be a bit off:

I’m sending ID3 tags to iPad using the following code from live RTMP and RTSP streams:

import com.wowza.wms.module.*;
import com.wowza.wms.amf.*;
import com.wowza.wms.application.*;
import com.wowza.wms.httpstreamer.cupertinostreaming.livestreampacketizer.*;
import com.wowza.wms.media.mp3.model.idtags.*;
import com.wowza.wms.stream.IMediaStream;
import com.wowza.wms.stream.livepacketizer.*;
public class ModuleCupertinoLiveOnTextToID3 extends ModuleBase
{
	class LiveStreamPacketizerDataHandler implements IHTTPStreamerCupertinoLivePacketizerDataHandler
	{
		IApplicationInstance appInstance = null;
		
		public LiveStreamPacketizerDataHandler(IApplicationInstance appInstance)
		{
			this.appInstance = appInstance;
		}
		public void onFillChunkDataPacket(CupertinoPacketHolder holder, AMFPacket packet, ID3Frames id3Frames)
		{			
			while(true)
			{
				byte[] buffer = packet.getData();
				if (buffer == null)
					break;
				
				
				IMediaStream stream = appInstance.getStreams().getStream("myStream");
				
			
				
				getLogger().info("ModuleCupertinoVODOnTextToID3.onAppStart["+appInstance.getContextStr()+"] Send string: " + stream.getVideoTC());
								
								
				ID3V2FrameTextInformation comment = new ID3V2FrameTextInformation(ID3V2FrameBase.TAG_TIT1);
				comment.setValue("" + stream.getVideoTC());
				id3Frames.putFrame(comment);
				break;
			}
		}
	}
	
	class LiveStreamPacketizerListener implements ILiveStreamPacketizerActionNotify
	{
		IApplicationInstance appInstance = null;
		
		public LiveStreamPacketizerListener(IApplicationInstance appInstance)
		{
			this.appInstance = appInstance;
		}
		public void onLiveStreamPacketizerCreate(ILiveStreamPacketizer liveStreamPacketizer, String streamName)
		{
			getLogger().info("ModuleCupertinoLiveOnTextToID3#MyLiveListener.onLiveStreamPacketizerCreate["+streamName+"]");
			if (liveStreamPacketizer instanceof LiveStreamPacketizerCupertino)
			{
				((LiveStreamPacketizerCupertino)liveStreamPacketizer).setDataHandler(new LiveStreamPacketizerDataHandler(appInstance));
			}
		}
		public void onLiveStreamPacketizerDestroy(ILiveStreamPacketizer liveStreamPacketizer)
		{
		}
		public void onLiveStreamPacketizerInit(ILiveStreamPacketizer liveStreamPacketizer, String streamName)
		{
		}
	}
	public void onAppStart(IApplicationInstance appInstance)
	{		
		appInstance.addLiveStreamPacketizerListener(new LiveStreamPacketizerListener(appInstance));
		getLogger().info("ModuleCupertinoLiveOnTextToID3.onAppStart["+appInstance.getContextStr()+"]");
	}
}

For RTMP publishing the ID3 tags are firing a lot more often than for RTSP. I’m using Wirecast for both.

Is there any way I can increase the frequency of onFillChunkDataPacket() firing for RTSP publising source?

When you’re outputting the timecodes, do you see any pattern? Is there a difference in the source stream encoding? What’s the eventual goal?

Solved using your post from last year:

http://www.wowza.com/forums/showthread.php?14702-New-iOS-streaming-supports-timed-data-event-in-live-and-video-on-demand-streams&p=75867#post75867