# Adding example modules

**URL:** https://community.wowza.com/t/adding-example-modules/42014
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [April 1, 2014, 5:48pm UTC](https://community.wowza.com/t/adding-example-modules/42014 "2014-04-01T17:48:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Nineesh\_K\_Dasan](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Nineesh\_K\_Dasan](https://community.wowza.com/u/Nineesh_K_Dasan)
#### Post date: [April 1, 2014, 5:48pm UTC](https://community.wowza.com/t/adding-example-modules/42014/1 "2014-04-01T17:48:59Z")

</div>

I have tried to add “ModuleAutoRecordAdvancedExample” from www.wowza.com/forums/content.php?576.

I am trying to receive a notification listener with the module. But when i am running i am getting the following error:

```auto
live/_definst_]StreamRecorderParameters: Er
ror creating NotifyListener: com.wowza.wms.livestreamrecord.model.LiveStreamRecordModuleAutoRecordAdvancedExample.MyStreamRecorderListener : java.lang.ClassNotFoundException: com.wowza.wms.livestreamrecord.model.
LiveStreamRecordModuleAutoRecordAdvancedExample.MyStreamRecorderListener|at java.net.URLClassLoader$1.run(URLClassLoader.java:217)|at java.security.AccessController.doPrivileged(Native Method)|at java.net.URLClas
sLoader.findClass(URLClassLoader.java:205)|at java.lang.ClassLoader.loadClass(ClassLoader.java:321)|at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

```

What is wrong here? Appeneded below is my settings what i have configured.

My lib folder contains:

```auto
-rwxrwxr-x 1 root root 34101 Feb 20 03:53 wms-stream-publish.jar
-rwxrwxr-x 1 root root 44116 Feb 20 03:53 wms-stream-file.jar
-rwxrwxr-x 1 root root 11030 Feb 20 03:53 wms-restlet-2.1.6.org.restlet.ext.simple.jar
-rwxrwxr-x 1 root root 71741 Feb 20 03:53 wms-mediawriter-h264.jar
-rwxrwxr-x 1 root root 21110 Feb 20 03:53 wms-mediareader-mp3.jar
-rwxrwxr-x 1 root root 12462 Feb 20 03:53 wms-license-rest.jar
-rwxrwxr-x 1 root root 219607 Feb 20 03:53 wms-httpstreamer-smoothstreaming.jar
-rwxrwxr-x 1 root root 192652 Feb 20 03:53 wms-httpstreamer-mpegdashstreaming.jar
-rwxrwxr-x 1 root root 9199 Feb 20 03:53 wms-httpstreamer-directstreaming.jar
-rwxrwxr-x 1 root root 348055 Feb 20 03:53 wms-core.jar
-rwxrwxr-x 1 root root 28248 Feb 20 03:53 wms-bootstrap.jar
-rwxrwxr-x 1 root root 37114 Feb 20 03:53 wms-amazonutil.jar
-rwxrwxr-x 1 root root 236920 Feb 20 03:53 jid3lib-0.5.4.jar
-rwxrwxr-x 1 root root 325110 Feb 20 03:53 wms-transcoder.jar
-rwxrwxr-x 1 root root 10318 Feb 20 03:53 wms-stream-shoutcast.jar
-rwxrwxr-x 1 root root 14836 Feb 20 03:53 wms-stream-rtp.jar
-rwxrwxr-x 1 root root 19139 Feb 20 03:53 wms-stream-record.jar
-rwxrwxr-x 1 root root 165127 Feb 20 03:53 wms-mediacache.jar
-rwxrwxr-x 1 root root 270233 Feb 20 03:53 wms-jax.validation.jar
-rwxrwxr-x 1 root root 114204 Feb 20 03:53 wms-drm.jar
-rwxrwxr-x 1 root root 2662745 Feb 20 03:53 wms-restlet-2.1.6.jar
-rwxrwxr-x 1 root root 8401 Feb 20 03:53 wms-mediawriter-flv.jar
-rwxrwxr-x 1 root root 181478 Feb 20 03:53 wms-httpstreamer-sanjosestreaming.jar
-rwxrwxr-x 1 root root 303230 Feb 20 03:53 wms-httpstreamer-cupertinostreaming.jar
-rwxrwxr-x 1 root root 1437 Feb 20 03:53 wms-ant.jar
-rwxrwxr-x 1 root root 283921 Feb 20 03:53 commons-lang-2.6.jar
-rwxrwxr-x 1 root root 101434 Feb 20 03:53 wms-stream-live.jar
-rwxrwxr-x 1 root root 55056 Feb 20 03:53 wms-stats.jar
-rwxrwxr-x 1 root root 32636 Feb 20 03:53 wms-mediareader-flv.jar
-rwxrwxr-x 1 root root 919717 Feb 20 03:53 jackson-databind-2.1.1.jar
-rwxrwxr-x 1 root root 5638218 Feb 20 03:53 wms-server.jar
-rwxrwxr-x 1 root root 483663 Feb 20 03:53 log4j-1.2.17.jar
-rwxrwxr-x 1 root root 205734 Feb 20 03:53 jackson-core-2.1.1.jar
-rwxrwxr-x 1 root root 580860 Feb 20 03:53 joda-time-2.3.jar
-rwxrwxr-x 1 root root 2434121 Feb 20 03:53 bcprov-jdk15on-149.jar
-rwxrwxr-x 1 root root 447105 Feb 20 03:53 wms-rest.jar
-rwxrwxr-x 1 root root 4473 Feb 20 03:53 wms-release-tools.jar
-rwxrwxr-x 1 root root 178472 Feb 20 03:53 wms-pushpublish.jar
-rwxrwxr-x 1 root root 128658 Feb 20 03:53 wms-mediareader-h264.jar
-rwxrwxr-x 1 root root 19642 Feb 20 03:53 wms-jlayer.jar
-rwxrwxr-x 1 root root 93713 Feb 20 03:53 wms-dvr.jar
-rwxrwxr-x 1 root root 87221 Feb 20 03:53 wms-commons-modeler.jar
-rwxrwxr-x 1 root root 9744 Feb 20 03:53 slf4j-log4j12-1.6.4.jar
-rwxrwxr-x 1 root root 25942 Feb 20 03:53 slf4j-api-1.6.4.jar
-rwxrwxr-x 1 root root 34464 Feb 20 03:53 jackson-annotations-2.1.1.jar
-rwxrwxr-x 1 root root 536216 Feb 20 03:53 wms-xstream-1.4.5.jar
-rwxrwxr-x 1 root root 11476 Feb 20 03:53 wms-mediareader-smil.jar
-rwxrwxrwx 1 root root 6437 Mar 31 11:01 wms-plugin-livestreamrecordautorecord_4.0.jar
-rwxrwxrwx 1 root root 345 Mar 31 12:26 wms-plugin-livestreamrecordexamplemodule_4.0.jar

```

My application.xml is

```auto
<?xml version="1.0" encoding="UTF-8"?>
<Root version="1">
	<Application>
		<Name>live</Name>
		<AppType>Live</AppType>
		<Description>Default application for live streaming created when Wowza Streaming Engine is installed. Use this application with its default configuration or modify the configuration as needed. You can also copy it to create another live application.</Description>
		<!-- 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-lowlatency</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, mpegdashstreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater, mpegdashstreamingrepeater -->
			<LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer,mpegdashstreamingpacketizer</LiveStreamPacketizers>
			<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
			<Properties>
			</Properties>
		</Streams>
		<Transcoder>
			<!-- To turn on transcoder set to: transcoder -->
			<LiveStreamTranscoder></LiveStreamTranscoder>
			<!-- [templatename].xml or ${SourceStreamName}.xml -->
			<Templates>${SourceStreamName}.xml,transrate.xml</Templates>
			<ProfileDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/profiles</ProfileDir>
			<TemplateDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/templates</TemplateDir>
			<Properties>
			</Properties>
		</Transcoder>
		<DVR>
			<!-- As a single server or as an origin, use dvrstreamingpacketizer in LiveStreamPacketizers above -->
			<!-- Or, in an origin-edge configuration, edges use dvrstreamingrepeater in LiveStreamPacketizers above -->
			<!-- As an origin, also add dvrchunkstreaming to HTTPStreamers below -->
			<!-- If this is a dvrstreamingrepeater, define Application/Repeater/OriginURL to point back to the origin -->
			<!-- To turn on DVR recording set Recorders to dvrrecorder. This works with dvrstreamingpacketizer -->
			<Recorders></Recorders>
			<!-- As a single server or as an origin, set the Store to dvrfilestorage-->
			<!-- edges should have this empty -->
			<Store></Store>
			<!-- Window Duration is length of live DVR window in seconds. 0 means the window is never trimmed. -->
			<WindowDuration>0</WindowDuration>
			<!-- Storage Directory is top level location where dvr is stored. e.g. c:/temp/dvr -->
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/dvr</StorageDir>
			<!-- valid ArchiveStrategy values are append, version, delete -->
			<ArchiveStrategy>append</ArchiveStrategy>
			<!-- Properties for DVR -->
			<Properties>
			</Properties>
		</DVR>
		<TimedText>
			<!-- VOD caption providers (separate with commas): vodcaptionprovidermp4_3gpp, vodcaptionproviderttml, vodcaptionproviderwebvtt, vodcaptionprovidersrt, vodcaptionproviderscc -->
			<VODTimedTextProviders>vodcaptionprovidermp4_3gpp</VODTimedTextProviders>
			<!-- Properties for TimedText -->
			<Properties>
			</Properties>
		</TimedText>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming, mpegdashstreaming, dvrchunkstreaming -->
		<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming,mpegdashstreaming</HTTPStreamers>
		<MediaCache>
			<MediaCacheSourceList></MediaCacheSourceList>
		</MediaCache>
		<SharedObjects>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/applications/${com.wowza.wms.context.Application}/sharedobjects/${com.wowza.wms.context.ApplicationInstance}</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>
			<RTP>
				<RTSP>
					<!-- udp, interleave -->
					<RTPTransportMode>interleave</RTPTransportMode>
				</RTSP>
			</RTP>
			<StreamValidator>
				<Enable>true</Enable>
				<ResetNameGroups>true</ResetNameGroups>
				<StreamStartTimeout>20000</StreamStartTimeout>
				<StreamTimeout>12000</StreamTimeout>
				<VideoStartTimeout>0</VideoStartTimeout>
				<VideoTimeout>0</VideoTimeout>
				<AudioStartTimeout>0</AudioStartTimeout>
				<AudioTimeout>0</AudioTimeout>
				<VideoTCToleranceEnable>false</VideoTCToleranceEnable>
				<VideoTCPosTolerance>3000</VideoTCPosTolerance>
				<VideoTCNegTolerance>-500</VideoTCNegTolerance>
				<AudioTCToleranceEnable>false</AudioTCToleranceEnable>
				<AudioTCPosTolerance>3000</AudioTCPosTolerance>
				<AudioTCNegTolerance>-500</AudioTCNegTolerance>
				<DataTCToleranceEnable>false</DataTCToleranceEnable>
				<DataTCPosTolerance>3000</DataTCPosTolerance>
				<DataTCNegTolerance>-500</DataTCNegTolerance>
				<AVSyncToleranceEnable>false</AVSyncToleranceEnable>
				<AVSyncTolerance>1500</AVSyncTolerance>
				<DebugLog>false</DebugLog>
			</StreamValidator>
			<!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
			<Properties>
			</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>
				<Property>
					<Name>cupertinoChunkDurationTarget</Name>
					<Value>10000</Value>
					<Type>Integer</Type>
				</Property>
				<Property>
					<Name>cupertinoMaxChunkCount</Name>
					<Value>10</Value>
					<Type>Integer</Type>
				</Property>
				<Property>
					<Name>cupertinoPlaylistChunkCount</Name>
					<Value>3</Value>
					<Type>Integer</Type>
				</Property>
			</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>
		<Manager>
			<!-- Properties defined are used by the Manager -->
			<Properties>
			</Properties>
		</Manager>
		<Repeater>
			<OriginURL></OriginURL>
			<QueryString><![CDATA[]]></QueryString>
		</Repeater>
		<StreamRecorder>
			<Properties>
				<Property>
					<Name>streamRecorderDebugEnable</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
				<Property>
					<Name>streamRecorderNotifyListener</Name>
					<Value>com.wowza.wms.livestreamrecord.model.LiveStreamRecordModuleAutoRecordAdvancedExample.MyStreamRecorderListener</Value>
					<Type>String</Type>
				</Property>
			</Properties>
		</StreamRecorder>
		<Modules>
			<Module>
				<Name>base</Name>
				<Description>Base</Description>
				<Class>com.wowza.wms.module.ModuleCore</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>ModuleCoreSecurity</Name>
				<Description>Core Security Module for Applications</Description>
				<Class>com.wowza.wms.security.ModuleCoreSecurity</Class>
			</Module>
			<Module>
				<Name>ModuleLiveStreamRecord</Name>
				<Description>ModuleLiveStreamRecord</Description>
				<Class>com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord</Class>
			</Module>
			<Module>
				<Name>ModuleAutoRecordAdvancedExample</Name>
				<Description>ModuleAutoRecordAdvancedExample</Description>
				<Class>com.wowza.wms.plugin.livestreamrecord.module.ModuleAutoRecordAdvancedExample</Class>
			</Module>
		</Modules>
		<!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
		<Properties>
			<Property>
				<Name>securityPublishRequirePassword</Name>
				<Value>true</Value>
				<Type>Boolean</Type>
			</Property>
		</Properties>
	</Application>
</Root>

```

Please help

---

<div class="post-metadata">

### Author: ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)
#### Post date: [April 2, 2014, 8:28am UTC](https://community.wowza.com/t/adding-example-modules/42014/2 "2014-04-02T08:28:56Z")

</div>

Hi,

Have you tried to modify the example or are you running it as is?

The error message you have posted doesn’t make sense as it says it is trying to locate a class but it is using the wrong class path.

Also, in your Application.xml, you are referencing a class called com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord. If this is your own implementation then it will possibly conflict with the ModuleAutoRecordAdvancedExample class.

If it is a revamped version of the old LiveStreamRecord plugin then you should remove it as it most likely will not be compatible with the new recording mechanism. You should also remove it’s jar file from the lib folder so that there are no conflicts there.

Roger.

---

<div class="post-metadata">

### Author: ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)
#### Post date: [April 1, 2014, 9:32am UTC](https://community.wowza.com/t/adding-example-modules/42014/3 "2014-04-01T09:32:44Z")

</div>

Hi there, it looks like the MyStreamRecorderListener.jar file is not included in the /lib folder.

It could be that the IDE is compiling the .jar to an old /lib folder.

Salvadore

---

<div class="post-metadata">

### Author: ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)
#### Post date: [April 3, 2014, 8:07am UTC](https://community.wowza.com/t/adding-example-modules/42014/4 "2014-04-03T08:07:00Z")

</div>

> ```auto
> <Property>
> <Name>streamRecorderNotifyListener</Name>
> <Value>com.wowza.wms.livestreamrecord.model.LiveStreamRecordModuleAutoRecordAdvancedExample.MyStreamRecorderListener</Value>
> <Type>String</Type>
> </Property>
> 
> ```

You only need to set this property if you have created your own listener class. As it is, the setting that you have used points to a non existent class path which is why you are getting the error.

The LiveStreamRecordModuleAutoRecordAdvancedExample sets the listener in code so you do not need to set the property for this module.

Roger.

---

<div class="post-metadata">

### Author: ![Roger\_Littin1](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@Roger\_Littin1](https://community.wowza.com/u/Roger_Littin1)
#### Post date: [April 7, 2014, 9:17am UTC](https://community.wowza.com/t/adding-example-modules/42014/5 "2014-04-07T09:17:31Z")

</div>

Hi,

The way that example module is written, you don’t need to set the property for streamRecorderNotifyListener.

That property is used when you are using the built in recorder and you want to get notifications that something has occured.

The MyStreamRecorderListener class is a sub class of LiveStreamRecordModuleAutoRecordAdvancedExample and will only be accessible from that. It won’t be accessible from anywhere else.

Roger.

---

<div class="post-metadata">

### Author: ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)
#### Post date: [April 1, 2014, 12:20pm UTC](https://community.wowza.com/t/adding-example-modules/42014/6 "2014-04-01T12:20:24Z")

</div>

Actually, what is the name of the project? Make sure that the project .jar file is located in the /lib folder, and check the path and module name against the Module in the Application.xml file.

Salvadore

---

<div class="post-metadata">

### Author: ![Nineesh\_K\_Dasan](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Nineesh\_K\_Dasan](https://community.wowza.com/u/Nineesh_K_Dasan)
#### Post date: [April 2, 2014, 10:13am UTC](https://community.wowza.com/t/adding-example-modules/42014/7 "2014-04-02T10:13:20Z")

</div>

Hi Roger, Salvadore,

My scenario is using the example AutoRecordAdvancedExample, such that i can receive notifications in for eg. (wowza access log or to a custom http url). I havent made any changes in the “wms-plugin-livestreamrecordexamplemodule\_4.0.jar”.

Just followed directions from here [https://www.wowza.com/docs/how-to-start-and-stop-live-stream-recordings-programmatically-livestreamrecordautorecord-example#installing](https://www.wowza.com/docs/how-to-start-and-stop-live-stream-recordings-programmatically-livestreamrecordautorecord-example#installing).

I have added the module in my live/Applications.xml, which is

> ModuleAutoRecordAdvancedExample
> 
> ModuleAutoRecordAdvancedExample
> 
> com.wowza.wms.plugin.livestreamrecord.module.ModuleAutoRecordAdvancedExample
> 
> Along with I have added property for notify listener in the live/Applications.xml -\>StreamRecord
> 
> > streamRecorderDebugEnable
> > 
> > true
> > 
> > Boolean
> > 
> > streamRecorderNotifyListener
> > 
> > com.wowza.wms.livestreamrecord.model.LiveStreamRecordModuleAutoRecordAdvancedExample.MyStreamRecorderListener
> > 
> > String
> 
> With the property =\> “streamRecorderNotifyListener”, I want to call the “wms-plugin-livestreamrecordexamplemodule\_4.0.jar” =\> ModuleAutoRecordAdvancedExample =\> MyStreamRecorderListener =\> onSegmentStart
> 
> How can I achieve this. What are the .jar files i have to use.
> 
> My wowza version is “4.0.1” and deployed in “Debian 6.0”
> 
> Tnx,
> 
> Nin

---

<div class="post-metadata">

### Author: ![Nineesh\_K\_Dasan](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Nineesh\_K\_Dasan](https://community.wowza.com/u/Nineesh_K_Dasan)
#### Post date: [April 3, 2014, 9:36am UTC](https://community.wowza.com/t/adding-example-modules/42014/8 "2014-04-03T09:36:35Z")

</div>

Hi,

In the example module “LiveStreamRecord\_4.0” =\> “wms-plugin-livestreamrecordautorecord\_4.0.jar” =\>“LiveStreamRecordModuleAutoRecordAdvancedExample” contains a sample Listener class such that

> // listener class for IStreamRecorder events
> 
> class MyStreamRecorderListener implements IStreamRecorderActionNotify
> 
> {
> 
> @Override
> 
> public void onCreateRecorder(IStreamRecorder recorder)
> 
> {
> 
> /\*
> 
> To set stream specific StreamRecorderParameter values, set them here
> 
> if (recorder.getStreamName().equals(“mySpeciaStream”))
> 
> {
> 
> StreamRecorderParameters params = recorder.getRecorderParams();
> 
> params.fileVersionDelegate = new SpecialStreamFileVersionDelegate();
> 
> params.notifyListener = new SpecialStreamOtherListener();
> 
> }
> 
> \*/
> 
> getLogger().info(“MyStreamRecorderListener.onCreateRecorder[” + appInstance.getContextStr() + “]: new Recording created:” + recorder.getStreamName());
> 
> }
> 
> @Override
> 
> public void onStartRecorder(IStreamRecorder recorder)
> 
> {
> 
> // log where the recording is going to being written
> 
> getLogger().info(“MyStreamRecorderListener.onStartRecorder[” + appInstance.getContextStr() + “]: new Recording started:” + recorder.getStreamName() + " " + recorder.getFilePath());
> 
> }
> 
> @Override
> 
> public void onSplitRecorder(IStreamRecorder recorder)
> 
> {
> 
> getLogger().info(“MyStreamRecorderListener.onSplitRecorder[” + appInstance.getContextStr() + “]: Segment recording:” + recorder.getStreamName());
> 
> }
> 
> @Override
> 
> public void onStopRecorder(IStreamRecorder recorder)
> 
> {
> 
> getLogger().info(“MyStreamRecorderListener.onStopRecorder[” + appInstance.getContextStr() + “]: Recording stopped:” + recorder.getStreamName() + " " + recorder.getCurrentFile());
> 
> }
> 
> @Override
> 
> public void onSwitchRecorder(IStreamRecorder recorder, IMediaStream newStream)
> 
> {
> 
> getLogger().info(“MyStreamRecorderListener.onSwitchRecorder[” + appInstance.getContextStr() + “]: switch to new stream, old Stream:” + recorder.getStreamName() +" new Stream:" + newStream.getName());
> 
> }
> 
> @Override
> 
> public void onSegmentStart(IStreamRecorder recorder)
> 
> {
> 
> getLogger().info(“MyStreamRecorderListener.onSegmentStart[” + appInstance.getContextStr() + “]: new segment created:” + recorder.getStreamName());
> 
> }
> 
> @Override
> 
> public void onSegmentEnd(IStreamRecorder recorder)
> 
> {
> 
> getLogger().info(“MyStreamRecorderListener.onSegmentEnd[” + appInstance.getContextStr() + “]: segment closed:” + recorder.getStreamName());
> 
> }
> 
> }

In my module property I have tried to call this Listener class. Is that correct?

Nin

---

<div class="post-metadata">

### Author: ![Nineesh\_K\_Dasan](https://avatars.discourse-cdn.com/v4/letter/n/bbce88/32.png) [@Nineesh\_K\_Dasan](https://community.wowza.com/u/Nineesh_K_Dasan)
#### Post date: [April 8, 2014, 3:59pm UTC](https://community.wowza.com/t/adding-example-modules/42014/9 "2014-04-08T15:59:49Z")

</div>

Hi Roger,

The problem solved for me. I have made changes in the “ **MyStreamRecorderListener** ” class and re build it. Now the listener providing me notifications when **onSegementStart** and **onSegmentEnd** methods.

Thank you all for the support.

```auto
[08/Apr/2014:14:47:00 +0530] onSegmentStart = null
 [08/Apr/2014:14:47:11 +0530] onSegmentEnd = 3_20140408091825491460.mp4
 [08/Apr/2014:14:47:11 +0530] onSegmentStart = 3_20140408091825491460.mp4
 [08/Apr/2014:14:47:22 +0530] onSegmentEnd = 3_20140408091825491460_0.mp4
 [08/Apr/2014:14:47:22 +0530] onSegmentStart = 3_20140408091825491460_0.mp4
 [08/Apr/2014:14:47:33 +0530] onSegmentEnd = 3_20140408091825491460_1.mp4
 [08/Apr/2014:14:47:33 +0530] onSegmentStart = null 
 [08/Apr/2014:14:47:33 +0530] onSegmentStart = 3_20140408091825491460_1.mp4
 [08/Apr/2014:14:47:44 +0530] onSegmentEnd = 3_20140408091825491460_2.mp4
 [08/Apr/2014:14:47:44 +0530] onSegmentStart = 3_20140408091825491460_2.mp4
 [08/Apr/2014:14:47:55 +0530] onSegmentEnd = 3_20140408091825491460_3.mp4
 [08/Apr/2014:14:47:55 +0530] onSegmentStart = 3_20140408091825491460_3.mp4
 [08/Apr/2014:14:48:01 +0530] onSegmentEnd = 3_20140408091825491460_4.mp4

```

I am splitting the recordings at specific durations. But from the above logs, i see a new file is generated at **onSegmentEnd**. I am using the “**recorder.getCurrentFile()**” function.

But actually the new filename firstly comes inside the “ **onSegmentStart** ” method?

Nin
