Wowza Community

m4v http streaming

We are able to stream m4v file via rtmp and rtsp and I was trying to add http. I am confused about all the httpstreamers and what function they perform in file playback mode. All I want to do is intercept the http stream and play alias requests like we do for rtsp/rtmp. Specifically I am trying to stream to iphone and android phones.

I was looking at using IModuleOnHTTPSession on top of the other IModuleOn interfaces we already use. What streamer should I use for VOD type streaming to iOS and Andriod devices.

All I want to do is intercept the http stream and play alias requests like we do for rtsp/rtmp

Richard,

Use IMediaStreamNameAliasProvider2

package com.wowza.wms.example.module;
com.wowza.wms.example.module.ModuleStreamNameAliasExample
import com.wowza.wms.application.*;
import com.wowza.wms.client.IClient;
import com.wowza.wms.httpstreamer.model.IHTTPStreamerSession;
import com.wowza.wms.mediacaster.IMediaCaster;
import com.wowza.wms.module.*;
import com.wowza.wms.rtp.model.RTPSession;
import com.wowza.wms.stream.IMediaStream;
import com.wowza.wms.stream.IMediaStreamNameAliasProvider2;
import com.wowza.wms.stream.livepacketizer.ILiveStreamPacketizer;
public class ModuleStreamNameAliasFull extends ModuleBase implements IMediaStreamNameAliasProvider2 {
	public void onAppStart(IApplicationInstance appInstance) {
		String fullname = appInstance.getApplication().getName() + "/"
				+ appInstance.getName();
		getLogger().info("onAppStart: " + fullname);
		
		appInstance.setStreamNameAliasProvider(this);
	
	}
	public String resolvePlayAlias(IApplicationInstance appInstance,
			String name, IClient client) {
		getLogger().info("Resolve Play Flash: " + name);
		
		IMediaStream stream = appInstance.getStreams().getStream(name);
		
		if (client.getIp().equals("127.0.0.1"))
				{
					name="mp4:Extremists.m4v";
				}
		stream.getProperties().setProperty("foo", "bar");
		
		return name;
	}
	public String resolvePlayAlias(IApplicationInstance appInstance,
			String name, IHTTPStreamerSession httpSession) {
		getLogger().info("Resolve Play HTTPSession: " + name);
		return name;
	}
	public String resolvePlayAlias(IApplicationInstance appInstance,
			String name, RTPSession rtpSession) {
		getLogger().info("Resolve Play RTPSession: " + name);
		return name;
	}
	public String resolvePlayAlias(IApplicationInstance appInstance,
			String name, ILiveStreamPacketizer liveStreamPacketizer) {
		getLogger().info("Resolve Play LiveStreamPacketizer: " + name);
		return name;
	}
	public String resolveStreamAlias(IApplicationInstance appInstance,
			String name, IMediaCaster mediaCaster) {
		getLogger().info("Resolve Stream Mediacaster: " + name);
		return name;
	}
	public String resolvePlayAlias(IApplicationInstance appInstance, String name) {
		getLogger().info("Resolve Play: " + name);
		return name;
	}
	public String resolveStreamAlias(IApplicationInstance appInstance,
			String name) {
		getLogger().info("Resolve Stream: " + name);
		return name;
	}
}

Richard

All the different HTTP streaming methods are built into the server. We support Apple HTTP live streaming and Smooth Streaming. In 2.1.2.07 we have added support for Flash HTTP streaming. The tutorial below explains the URL formats and configuration needed for the different streaming protocols when doing video on demand playback.

https://www.wowza.com/docs/how-to-set-up-video-on-demand-streaming

Flash HTTP streaming is covered here:

http://www.wowza.com/forums/content.php?111-Flash-HTTP-Streaming-preview-AddOn-package

You do not need to mess with request filters and the like to get anything to work. This is all pre-configured in HTTPSTreamers.xml. The requests are handled based on the URL that is used. We have not documented (nor do we plan in the short term) how to add your own HTTP streaming type. At this time the API is private and only for Wowza’s use.

We do not support straight progressive download at this time. Wowza only supports the chunked streaming methods. At some point we will also most likely add support for WebM (VP8 and Theora Ogg).

Does this answer the question?

Charlie

I already have that since I implmented IMediaStreamNameAliasProvider2 for my other sessions. This does not address the session question, which or how do I get the httpsession events?

I think you are missing the point. I already have all this code that is not what was asked. I want to know how to configure the application to use the appropriate httpstreamer. I aked for an explination of the httpstreamers and a choise on which one to use for basic vod http delivery for IOS and Android clients. I currenty can not get httpstreaming working at all for a http://///Extremists.m4v request. IF I understand the docs right I need to declare a httpstreamer to handle with RequestFilter set to include *.m4v. Which one do I use?

Here is an example:

package com.wowza.wms.example.module;
import com.wowza.util.IOPerformanceCounter;
import com.wowza.wms.httpstreamer.cupertinostreaming.httpstreamer.*;
import com.wowza.wms.httpstreamer.model.*;
import com.wowza.wms.httpstreamer.smoothstreaming.httpstreamer.*;
import com.wowza.wms.module.*;
import com.wowza.wms.rtp.model.*;
public class ModuleSessionExample extends ModuleBase {
	//This will work for Cupertino, Smooth sessions
	public void onHTTPSessionCreate(IHTTPStreamerSession httpSession) {			
	}
	
	public void onHTTPSessionDestroy(IHTTPStreamerSession httpSession) {
		IOPerformanceCounter perf = httpSession.getIOPerformanceCounter();	
		getLogger().info("HTTPSession OutBytes: " + perf.getMessagesOutBytes());
	}
	public void onHTTPCupertinoStreamingSessionCreate(
			HTTPStreamerSessionCupertino httpSession) {
	}
	
	public void onHTTPCupertinoStreamingSessionDestroy(
			HTTPStreamerSessionCupertino httpSession) {
		IOPerformanceCounter perf = httpSession.getIOPerformanceCounter();
		getLogger().info("HTTPCupertinoStreamingSession OutBytes: " + perf.getMessagesOutBytes());
	}
	
	public void onHTTPSmoothStreamingSessionCreate(
			HTTPStreamerSessionCupertino httpSession){
	}
			
	public void onHTTPSmoothStreamingSessionDestroy(
			HTTPStreamerSessionSmoothStreamer httpSession) {
		IOPerformanceCounter perf = httpSession.getIOPerformanceCounter();
		
	}
	public void onRTPSessionCreate(RTPSession rtpSession) {
	
	}
	
	public void onRTPSessionDestroy(RTPSession rtpSession) {
		IOPerformanceCounter perf = rtpSession.getIOPerformanceCounter();
		getLogger().info("MessageOutBytes: " + perf.getMessagesOutBytes());
	}
}

Richard