file name control

This is using a liverepeater-edge I assume. You can use the MediaCaster API to start and stop liverepeater streams on an edge with MediaCaster type “liverepeater”

The 2nd is the MediaCaster system retrying. I don’t think there is way configurable way to limit the retries. You might be able to do something in IMediaCasterNotify2

Richard

Did you start your stream in StreamManager before trying to record with LiveStreamRecord?

I suggest you change the StreamType to “live”, then start the stream in StreamManager, then test playback in Flash. Then test LiveStreamRecord with the included Flash client in the package:

https://www.wowza.com/downloads/forums/livestreamrecord/LiveStreamRecord_3.0.zip

If that works, then return to this module.

Richard

We have an issue using this module - recorded files are often corrupted, sometimes have no sound, playback is freezing etc. Using mp4box it seems metadata are wrong:

E:>MP4Box.exe -info stream2_04.mp4

[iso file] Box “mdhd” has 2 extra bytes

[iso file] Box “mdhd” has 2 extra bytes

  • Movie Info *

Timescale 90000 - Duration 01:00:00.311

Fragmented File no - 2 track(s)

File Brand f4v - version 0

Created: GMT Thu Feb 17 12:00:17 2011

File has no MPEG4 IOD/OD

Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 22 Days, 03:14:34.381

Media Info: Language “English” - Type “vide:avc1” - 68084 samples

MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21

AVC/H264 Video - Visual Size 352 x 288 - Profile Baseline @ Level 2

NAL Unit length bits: 32

Pixel Aspect Ratio 12:11 - Indicated track size 352 x 288

Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 90000 - Duration 101 Days, 02:51:40.479

Media Info: Language “English” - Type “soun:mp4a” - 168405 samples

MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40

MPEG-4 Audio AAC LC - 1 Channel(s) - SampleRate 48000

Synchronized on stream 1

Using MPEG-TS stream, latest Wowza, StreamType live or rtp-live makes no difference. We can watch the same stream in flash player correctly. Any ideas?

We have an issue using this module - recorded files are often corrupted, sometimes have no sound, playback is freezing etc. Using mp4box it seems metadata are wrong:

E:>MP4Box.exe -info stream2_04.mp4

[iso file] Box “mdhd” has 2 extra bytes

[iso file] Box “mdhd” has 2 extra bytes

  • Movie Info *

Timescale 90000 - Duration 01:00:00.311

Fragmented File no - 2 track(s)

File Brand f4v - version 0

Created: GMT Thu Feb 17 12:00:17 2011

File has no MPEG4 IOD/OD

Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 22 Days, 03:14:34.381

Media Info: Language “English” - Type “vide:avc1” - 68084 samples

MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21

AVC/H264 Video - Visual Size 352 x 288 - Profile Baseline @ Level 2

NAL Unit length bits: 32

Pixel Aspect Ratio 12:11 - Indicated track size 352 x 288

Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 90000 - Duration 101 Days, 02:51:40.479

Media Info: Language “English” - Type “soun:mp4a” - 168405 samples

MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40

MPEG-4 Audio AAC LC - 1 Channel(s) - SampleRate 48000

Synchronized on stream 1

Using MPEG-TS stream, latest Wowza, StreamType live or rtp-live makes no difference. We can watch the same stream in flash player correctly. Any ideas?

The stream is running 24/7 (Mpeg-ts/UDP).

We start the stream with Streammanager - then the module (from this forum) starts recording. And then the module rotate the recorded files every hour. Is there something wrong in that module so these files are being corrupted? Is there any better way to archive hourly-based recording?

It seems that the problem is more likely with MPEG-TS stream. We do not have any problem with RTSP IP camera recording with the same module.

The patch has fixed the MDHD error message, but the recorded videos are still unusable (corrupted video), Mp4Box still write strange numbers about duration.

c:\temp\record>MP4Box.exe -info stream1.mp4

  • Movie Info *

Timescale 90000 - Duration 00:04:32.379

Fragmented File no - 2 track(s)

File Brand f4v - version 0

Created: GMT Thu Feb 17 17:00:21 2011

File has no MPEG4 IOD/OD

Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 00:04:32.379

Media Info: Language “English” - Type “vide:avc1” - 5208 samples

MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21

AVC/H264 Video - Visual Size 352 x 288 - Profile Baseline @ Level 2

NAL Unit length bits: 32

Pixel Aspect Ratio 12:11 - Indicated track size 352 x 288

Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 90000 - Duration 3 Days, 07:36:43.518

Media Info: Language “English” - Type “soun:mp4a” - 12740 samples

MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40

MPEG-4 Audio AAC LC - 1 Channel(s) - SampleRate 48000

Synchronized on stream 1

Do you think there something wrong in that recording module so these files are being corrupted? Is there any better way to archive hourly-based recording?

Good idea. In this case are the recorded files also corrupted. So it points to packetloss problem or encoder problem (Haivision Barracuda).

I’m using wowza media server2 prepetual 2.2.4 build27452

Flash Media Encoder 3.2 with (MP4:+streamname)

streamrecord hourly

I built the follwoing code using wowza IDE. it works good

package streamrecord.hourly.monthlyrollover;

import java.io.File;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;

import com.wowza.wms.application.*;
import com.wowza.wms.module.*;
import com.wowza.wms.plugin.integration.liverecord.*;
import com.wowza.wms.stream.IMediaStream;
import com.wowza.wms.stream.IMediaStreamActionNotify;
import com.wowza.wms.stream.IMediaStreamNotify;

public class ModuleStreamRecord extends ModuleBase implements IMediaStreamNotify {
	private IApplicationInstance appInstance;
	private String timezone;
	private StreamTimer streamTimer;
	private int date;
	private int startHour = 0;
	private int endHour = 23;
	private int hourOfDay = -1;
	private boolean record = false;
	private PublishNotifier publishNotifier;
	private List<String> streams;
	
	public static final int FORMAT_UNKNOWN = 0;
	public static final int FORMAT_FLV = 1;
	public static final int FORMAT_MP4 = 2;
	
	private Map<String, ILiveStreamRecord> recorders = null;

	private class StreamTimer extends Thread {
		private boolean doQuit = false;

		public synchronized void quit() {
			doQuit = true;
		}

		public void run() {
			while (true) {
				try {
					TimeZone tz = TimeZone.getTimeZone(timezone);
					Calendar cal = Calendar.getInstance(tz);

					date = cal.get(Calendar.DATE);
					int prevHour = hourOfDay;
					hourOfDay = cal.get(Calendar.HOUR_OF_DAY);
					int start = startHour;
					int end = endHour;
					if (start > end && hourOfDay > start) {
						end += 24;
					}

					if (end < start && hourOfDay < end) {
						start -=24;
					}

					if (hourOfDay >= start && hourOfDay < end) {
						record = true;
					} else {
						record = false;
					}

					streams = appInstance.getMediaCasterStreams().getMediaCasterNames();

					if (prevHour != hourOfDay && record) {
						for (String streamName : streams) {
							IMediaStream stream = appInstance.getStreams().getStream(streamName);
							appInstance.getVHost().getHandlerThreadPool().execute(new DoStartRecording(stream, streamName));
						}
					} else if(!record) {
						for (String streamName : streams) {
							ILiveStreamRecord recorder = recorders.remove(streamName);
							if(recorder != null)
								recorder.stopRecording();
						}
					}
					
					Thread.currentThread();
					Thread.sleep(60000);
					synchronized (this) {
						if (doQuit) {
							break;
						}
					}
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}

	public void onAppStart(IApplicationInstance appInstance) {
		this.appInstance = appInstance;
		WMSProperties props = appInstance.getProperties();
		startHour = props.getPropertyInt("startHour", 0);
		endHour = props.getPropertyInt("endHour", 24);
		timezone = props.getPropertyStr("timezone", "America/Chicago");

		appInstance.addMediaStreamListener(this);
		recorders = Collections.synchronizedMap(new HashMap<String, ILiveStreamRecord>());
		publishNotifier = new PublishNotifier();
		
		streamTimer = new StreamTimer();
		streamTimer.setName("RecordController-" + appInstance.getApplication().getName());
		streamTimer.setDaemon(true);
		streamTimer.start();
	}

	public void onAppStop(IApplicationInstance appInstance) {
		streamTimer.quit();

		// cleanup any recorders that are still running
		synchronized (recorders) {
			Iterator<String> iter = recorders.keySet().iterator();
			while(iter.hasNext())
			{
				String streamName = iter.next();
				ILiveStreamRecord recorder = recorders.get(streamName);
				recorder.stopRecording();
				getLogger().info("  stopRecording: "+streamName);
			}
			recorders.clear();
		}
		
		recorders = null;
		appInstance.removeMediaStreamListener(this);
		publishNotifier = null;
	}

	private synchronized void startRecording(IMediaStream stream) {
		String streamAlias = stream.getName().substring(0, stream.getName().indexOf(".stream"));
		
		if (!streamAlias.isEmpty()) {
			String outputPath = appInstance.getStreamStorageDir()+"/"+String.format("%02d", date); //day;
			boolean append = false;
			File path = new File(outputPath);
			if (path.exists()) {
				File outputFile = new File(path.getPath()+File.separator+streamAlias+"_"+String.format("%02d", hourOfDay)+".mp4");
				Date today = new Date();
				if (!(outputFile.lastModified() < today.getTime() - 86400000)) {
					append = true;
				}
				
			} else {
				path.mkdirs();
			}
			
			recordStream(stream, FORMAT_MP4, append, outputPath+File.separator+streamAlias+"_"+String.format("%02d", hourOfDay)+".mp4", false, true, true);
		}
	}
	
	private void recordStream(IMediaStream stream, int format, boolean append, String outputPath, boolean versionFile, boolean startOnKeyFrame, boolean recordData)
	{

		String streamName = stream.getName();
		
		// if a format was not specified then check the stream prefix and choose accordingly
		if (format == FORMAT_UNKNOWN)
		{
			format = FORMAT_FLV;
			String extStr = stream.getExt();
			if (extStr.equals("mp4"))
				format = FORMAT_MP4;
		}
		
		String params = "stream:"+streamName;
		params += " format:"+(format==FORMAT_MP4?"mp4":"flv");
		params += " append:"+append;
		if (outputPath != null)
			params += " outputPath:"+outputPath;
		else
		{
			File writeFile = stream.getStreamFileForWrite();
			params += " outputPath:"+writeFile.getAbsolutePath();
		}
		params += " versionFile:"+versionFile;
		params += " startOnKeyFrame:"+startOnKeyFrame;
		params += " recordData:"+recordData;
		
		getLogger().info("ModuleStreamRecord.startRecording: "+params);
		
		// create a stream recorder and save it in a map of recorders
		ILiveStreamRecord recorder = null;
		
		// create the correct recorder based on format
		if (format == FORMAT_MP4)
			recorder = new LiveStreamRecorderMP4();
		else
			recorder = new LiveStreamRecorderFLV();
		
		// add it to the recorders list
		ILiveStreamRecord prevRecorder = recorders.get(streamName);
		if (prevRecorder != null)
			prevRecorder.stopRecording();
		recorders.put(streamName, recorder);
		
		// if you want to record data packets as well as video/audio
		recorder.setRecordData(recordData);
		
		// Set to true if you want to version the previous file rather than overwrite it
		recorder.setVersionFile(versionFile);
		
		// If recording only audio set this to false so the recording starts immediately
		recorder.setStartOnKeyFrame(startOnKeyFrame);
		
		// start recording
		recorder.startRecording(stream, outputPath, append);
	}

		@Override
		public void onMediaStreamCreate(IMediaStream stream) {
			stream.addClientListener(publishNotifier);
		}

		@Override
		public void onMediaStreamDestroy(IMediaStream stream) {
			stream.removeClientListener(publishNotifier);
			if(!stream.isPlay()) {
				ILiveStreamRecord recorder = recorders.remove(stream.getName());
				if (recorder != null)
					recorder.stopRecording();
			}
		}
		
	private class PublishNotifier implements IMediaStreamActionNotify {

		@Override
		public void onPause(IMediaStream stream, boolean isPause,
				double location) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void onPlay(IMediaStream stream, String streamName,
				double playStart, double playLen, int playReset) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void onPublish(IMediaStream stream, String streamName,
				boolean isRecord, boolean isAppend) {
			if(record)
				appInstance.getVHost().getHandlerThreadPool().execute(new DoStartRecording(stream, streamName));
		}

		@Override
		public void onSeek(IMediaStream stream, double location) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void onStop(IMediaStream stream) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void onUnPublish(IMediaStream stream, String streamName,
				boolean isRecord, boolean isAppend) {
			ILiveStreamRecord recorder = recorders.remove(streamName);

			if (recorder != null)
			{
				// stop recording
				recorder.stopRecording();
			}
		}
	}
	
	private class DoStartRecording implements Runnable {
		private IMediaStream stream;
		private String streamName;
		private DoStartRecording(IMediaStream stream, String streamName) {
			this.stream = stream;
			this.streamName = streamName;
		}

		public void run() {
			List<String> mediaCasters = appInstance.getMediaCasterStreams().getMediaCasterNames();
			if (mediaCasters.contains(streamName)) {
				int lockCount = appInstance.getMediaCasterStreams().getMediaCaster(streamName).getLockCount();
				if (lockCount > 0)
					startRecording(stream);
			}
		}
	}
}

with the follwoing Application Conf

<Root>
	<Application>
		<!-- Uncomment to set application level timeout values
		<ApplicationTimeout>60000</ApplicationTimeout>
		<PingTimeout>12000</PingTimeout>
		<ValidationFrequency>8000</ValidationFrequency>
		<MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
		<MaximumSetBufferTime>60000</MaximumSetBufferTime>
		<MaximumStorageDirDepth>25</MaximumStorageDirDepth>
		-->
		<Connections>
			<AutoAccept>true</AutoAccept>
			<AllowDomains></AllowDomains>
		</Connections>
		<!--
			StorageDir path variables
			
			${com.wowza.wms.AppHome} - Application home directory
			${com.wowza.wms.ConfigHome} - Configuration home directory
			${com.wowza.wms.context.VHost} - Virtual host name
			${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
			${com.wowza.wms.context.Application} - Application name
			${com.wowza.wms.context.ApplicationInstance} - Application instance name
			
		-->
		<Streams>
			<StreamType>live-record</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content/qt</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater -->
			<LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer</LiveStreamPacketizers>			
			<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
			<Properties>
			</Properties>
		</Streams>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming -->
		<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>			
		<SharedObjects>
			<StorageDir></StorageDir>
		</SharedObjects>
		<Client>
			<IdleFrequency>-1</IdleFrequency>
			<Access>
				<StreamReadAccess>*</StreamReadAccess>
				<StreamWriteAccess>*</StreamWriteAccess>
				<StreamAudioSampleAccess></StreamAudioSampleAccess>
				<StreamVideoSampleAccess></StreamVideoSampleAccess>
				<SharedObjectReadAccess>*</SharedObjectReadAccess>
				<SharedObjectWriteAccess>*</SharedObjectWriteAccess>
			</Access>
		</Client>
		<RTP>
			<!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
			<Authentication>
				<PublishMethod>digest</PublishMethod>
				<PlayMethod>none</PlayMethod>
			</Authentication>
			<!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
			<AVSyncMethod>senderreport</AVSyncMethod>
			<MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
			<IdleFrequency>75</IdleFrequency>
			<RTSPSessionTimeout>90000</RTSPSessionTimeout>
			<RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
			<RTSPBindIpAddress></RTSPBindIpAddress>
			<RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
			<RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
			<IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
			<!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
			<Properties>
			</Properties>
		</RTP>
		<MediaCaster>
			<!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
			<Properties>
				<Property>
				    <Name>forceInterleaved</Name>
				    <Value>true</Value>
				    <Type>Boolean</Type>
				</Property>			
			</Properties>
		</MediaCaster>
		<MediaReader>
			<!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
			<Properties>
			</Properties>
		</MediaReader>
		<MediaWriter>
			<!-- Properties defined here will override any properties defined in conf/MediaWriter.xml for any MediaWriter loaded by this applications -->
			<Properties>
			</Properties>
		</MediaWriter>
		<LiveStreamPacketizer>
			<!-- Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications -->
			<Properties>
			</Properties>
		</LiveStreamPacketizer>
		<HTTPStreamer>
			<!-- Properties defined here will override any properties defined in conf/HTTPStreamers.xml for any HTTPStreamer loaded by this applications -->
			<Properties>
			</Properties>
		</HTTPStreamer>
		<Repeater>
			<OriginURL></OriginURL>
			<QueryString><![CDATA[]]></QueryString>
		</Repeater> 
		<Modules>
			<Module>
				<Name>base</Name>
				<Description>Base</Description>
				<Class>com.wowza.wms.module.ModuleCore</Class>
			</Module>
			<Module>
				<Name>properties</Name>
				<Description>Properties</Description>
				<Class>com.wowza.wms.module.ModuleProperties</Class>
			</Module>
			<Module>
				<Name>logging</Name>
				<Description>Client Logging</Description>
				<Class>com.wowza.wms.module.ModuleClientLogging</Class>
			</Module>
			<Module>
				<Name>flvplayback</Name>
				<Description>FLVPlayback</Description>
				<Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
			</Module>
 			<Module>
				<Name>liverecord</Name>
				<Description>StreamRecordModule</Description>
				<Class>streamrecord.hourly.monthlyrollover.ModuleStreamRecord</Class>
			</Module>

		</Modules>
		<!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
		<Properties>
			<Property>
				<Name>starHour</Name>
				<Value>00</Value>
				<Type>Integer</Type>
			</Property>
			<Property>
				<Name>endHour</Name>
				<Value>24</Value>
				<Type>Integer</Type>
			</Property>
			<Property>
				<Name>timezone</Name>
				<Value>GMT+03:00</Value>
				<Type>String</Type>
			</Property>

		</Properties>
	</Application>
</Root>

i want to record exactly 1 hour then split to new folder but it never happened it records less or more and never exceeded 55 min

I also want to use Media mover module to move the every day stream to new folder

please advice

Thanks

Thanks for this great module, one question,

How could I make it record in the morning say 6:57am them stop at 7:10am in the morning and again at 6:57pm then stop 7:10pm each day Mon- Fri?

Something like

private int starAMTtime = 6:57am;

private int endAMTime = 7:10am;

private int starPMTtime = 6:57am;

private int endPMTime = 7:10am;

A dunno know you guys are the geniuses I am just so fortunate to be here any ideas???

so does anyone have a working compiled version for wowza 3 and wants to share with us?

Hi,

in your Application.xml is:

ModuleStreamRecord

File Management

streamrecord.hourly.monthlyrollover.ModuleS treamRecord

Is there a space in “ModuleS treamRecord” - if yes - remove and it might work.

Greetings,

SWKIDE

Hi,

Good work on this module…

Can I use this methods without MediaCaster? Right now it seem it either works only with “mediacaster”.

Use case: User Starts the FLME Encoder->wowza should automatically kick the “StreamRecordModule” to start recording every 3 hrs.

Thanks

Larry

Are you looking in /content?

Please give ready-made module. I have great difficulty in compiling.

Thank you.

wowza 2.2.4, windows 2k8 r2

Sorry for my english.

Stream from IP-Camera Axis (RTSP). Start Stream is available on request from the JW Player from site.

Module is compiled as:

Copypaste original code from 2nd post this topic and click “save”

In Wowza 2.2.4:

List lib folder:

bcprov-ext-jdk15-145.jar
commons-lang-2.5.jar
jid3lib-0.5.4.jar
log4j-1.2.16.jar
ModuleStreamRecord.jar [COLOR="#00FF00"]//compiled module - 9.3 KB[/COLOR]
wms-ant.jar
wms-bootstrap.jar
wms-commons-modeler.jar
wms-core.jar
wms-httpstreamer-cupertinostreaming.jar
wms-httpstreamer-sanjosestreaming.jar
wms-httpstreamer-smoothstreaming.jar
wms-jlayer.jar
wms-mediareader-flv.jar
wms-mediareader-h264.jar
wms-mediareader-mp3.jar
wms-mediawriter-flv.jar
wms-mediawriter-h264.jar
wms-plugin-integrationrecord.jar
wms-plugin-livestreamrecord.jar
wms-server.jar
wms-stream-file.jar
wms-stream-live.jar
wms-stream-publish.jar
wms-stream-record.jar
wms-stream-rtp.jar
wms-stream-shoutcast.jar
wms-transport-security.jar

\conf\rtplive\Application.xml:

<Root>
	<Application>
		<!-- Uncomment to set application level timeout values
		<ApplicationTimeout>60000</ApplicationTimeout>
		<PingTimeout>12000</PingTimeout>
		<ValidationFrequency>8000</ValidationFrequency>
		<MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
		<MaximumSetBufferTime>60000</MaximumSetBufferTime>
		<MaximumStorageDirDepth>25</MaximumStorageDirDepth>
		-->
		<Connections>
			<AutoAccept>true</AutoAccept>
			<AllowDomains></AllowDomains>
		</Connections>
		<!--
			StorageDir path variables
			
			${com.wowza.wms.AppHome} - Application home directory
			${com.wowza.wms.ConfigHome} - Configuration home directory
			${com.wowza.wms.context.VHost} - Virtual host name
			${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
			${com.wowza.wms.context.Application} - Application name
			${com.wowza.wms.context.ApplicationInstance} - Application instance name
			
		-->
		<Streams>
			<StreamType>rtp-live</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater -->
			<LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer</LiveStreamPacketizers>			
			<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
			<Properties>
				<Property>
					<Name>fixH264VideoNALLenStartcodeMix</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
			</Properties>
		</Streams>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming -->
		<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>			
		<SharedObjects>
			<StorageDir></StorageDir>
		</SharedObjects>
		<Client>
			<IdleFrequency>-1</IdleFrequency>
			<Access>
				<StreamReadAccess>*</StreamReadAccess>
				<StreamWriteAccess>*</StreamWriteAccess>
				<StreamAudioSampleAccess></StreamAudioSampleAccess>
				<StreamVideoSampleAccess></StreamVideoSampleAccess>
				<SharedObjectReadAccess>*</SharedObjectReadAccess>
				<SharedObjectWriteAccess>*</SharedObjectWriteAccess>
			</Access>
		</Client>
		<RTP>
			<!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
			<Authentication>
				<PublishMethod>digest</PublishMethod>
				<PlayMethod>none</PlayMethod>
			</Authentication>
			<!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
			<AVSyncMethod>senderreport</AVSyncMethod>
			<MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
			<IdleFrequency>75</IdleFrequency>
			<RTSPSessionTimeout>90000</RTSPSessionTimeout>
			<RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
			<RTSPBindIpAddress></RTSPBindIpAddress>
			<RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
			<RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
			<IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
			<!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
			<Properties>
			</Properties>
		</RTP>
		<MediaCaster>
			<!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
			<Properties>
				<Property>
				    <Name>forceInterleaved</Name>
				    <Value>true</Value>
				    <Type>Boolean</Type>
				</Property>
				<Property>
					<Name>rtspFilterUnknownTracks</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
				<Property>
					<Name>debugRTSPSession</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
			</Properties>
		</MediaCaster>
		<MediaReader>
			<!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
			<Properties>
			</Properties>
		</MediaReader>
		<MediaWriter>
			<!-- Properties defined here will override any properties defined in conf/MediaWriter.xml for any MediaWriter loaded by this applications -->
			<Properties>
			</Properties>
		</MediaWriter>
		<LiveStreamPacketizer>
			<!-- Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications -->
			<Properties>
			</Properties>
		</LiveStreamPacketizer>
		<HTTPStreamer>
			<!-- Properties defined here will override any properties defined in conf/HTTPStreamers.xml for any HTTPStreamer loaded by this applications -->
			<Properties>
			</Properties>
		</HTTPStreamer>
		<Repeater>
			<OriginURL></OriginURL>
			<QueryString><![CDATA[]]></QueryString>
		</Repeater> 
		<Modules>
			<Module>
				<Name>base</Name>
				<Description>Base</Description>
				<Class>com.wowza.wms.module.ModuleCore</Class>
			</Module>
			<Module>
				<Name>properties</Name>
				<Description>Properties</Description>
				<Class>com.wowza.wms.module.ModuleProperties</Class>
			</Module>
			<Module>
				<Name>logging</Name>
				<Description>Client Logging</Description>
				<Class>com.wowza.wms.module.ModuleClientLogging</Class>
			</Module>
			<Module>
				<Name>flvplayback</Name>
				<Description>FLVPlayback</Description>
				<Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
			</Module>
			<Module>
				<Name>ModuleMediaWriterFileMover</Name>
				<Description>ModuleMediaWriterFileMover</Description>
				<Class>com.wowza.wms.module.ModuleMediaWriterFileMover</Class>
			</Module>
                        <Module> 
                                <Name>ModuleStreamRecord</Name> 
                                <Description>File Management</Description> 
                                <Class>streamrecord.hourly.monthlyrollover.ModuleStreamRecord</Class> 
                        </Module>
		</Modules>
		<!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
		<Properties>
			<Property>
				<Name>fileMoverDestinationPath</Name>
				<Value>${com.wowza.wms.context.VHostConfigHome}/content/acopy</Value>
			</Property>
			<Property>
				<Name>fileMoverDeleteOriginal</Name>
				<Value>false</Value>
				<Type>Boolean</Type>
			</Property>
			<Property>
				<Name>starHour</Name>
				<Value>00</Value>
				<Type>Integer</Type>
			</Property>
			<Property>
				<Name>endHour</Name>
				<Value>24</Value>
				<Type>Integer</Type>
			</Property>
			<Property>
				<Name>timezone</Name>
				<Value>GMT-08:00</Value>
				<Type>String</Type>
			</Property>
		</Properties>
	</Application>
</Root>

wowza starts without errors, but there is no record Stream. I tried to switch the time in windows at the XX hours and 59 minutes during the transition to the next hour, nothing happens. I tried to run the stream by hand (with the jw player) - a record still is not happening.

Tell me what could be the problem.

P.S. My timezone GMT+4, but the change in the aplications.xml not yet become.

I’ve successful used this module for recording live streams. Now I have the liverepeater-edge stream type and it isn’t working as wished: the recording starts only after I start playing a stream and ends after I stop playing it.

I added a ServerListener for starting the application instance at server start but it doesn’t find the streams (streams = appInstance.getMediaCasterStreams().getMediaCasterNames();).

Do I have to keep playing the streams for 24 hours or is there a nicer method?

Thanks

I’ve successful used this module for recording live streams. Now I have the liverepeater-edge stream type and it isn’t working as wished: the recording starts only after I start playing a stream and ends after I stop playing it.

I added a ServerListener for starting the application instance at server start but it doesn’t find the streams (streams = appInstance.getMediaCasterStreams().getMediaCasterNames();).

Do I have to keep playing the streams for 24 hours or is there a nicer method?

Thanks

I’ve solved the problem using:

              IApplicationInstance app_instance = app.getAppInstance("_definst_");
		app_instance.startMediaCasterStream("stream_name.stream","liverepeater");

in a ServerListener.

No problem :).

I still have a question.

I have .stream files with a rtmp url for the repeater. I keep the names of files in a Application Property container. If a stream file doesn’t exist I get:

onPublish
WARN server comment - LiveMediaStreamHandler.connect: failure

or if it can’t connect to the rtmp url it retries and retries:

INFO server comment - LiveMediaStreamHandler.resetConnection: (SOCKET, R: fms.server.com ...)
INFO server comment - LiveMediaStreamHandler.sessionClosed: 

and the recording starts and writes files.

How can I unpublish the streams in this situations and in the second case set a limit for retrying before unpublishing?

I should reformulate. Let’s say I’m starting 20 streams using their names. Some streams are good, received from another location and some are not (if stream file doesn’t exist or rtmp url is broken).

I want to find if a stream is really working having the IMediaStream stream and stream name.

I tried a couple of actions like System.out.println("test stream: "+stream.getVideoMissing()); but there was no difference between good and bad streams.