Publish and play a live stream (MPEG-TS based encoder)

Following the directions here: https://www.wowza.com/docs/how-to-publish-and-play-a-live-stream-mpeg-ts-based-encoder

I have downloaded the Application.xml file from the tutorial and added the StreamNameAlias module to it. Everything seems to work fine (under FLASH only), but after about 10 seconds of streaming, java crashes with the following exception:

INFO session connect-pending 207.179.74.242 -
INFO session connect 207.179.74.242 -
INFO stream create - -
INFO server comment - StreamNameAliasFile.load[/usr/local/WowzaMediaServer/conf/aliasmap.play.txt]: size:0:2 hash:false matchAll:false
INFO server comment - ModuleStreamNameAlias.nameToAlias[play]: streamName:c3f4a878-4fcc-460d-af3a-e551e6b782d1 alias:{pattern: "*" alias:"${Stream.Name}" wildcardMatches:{[0]: "c3f4a878-4fcc-460d-af3a-e551e6b782d1"}} result:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - MediaStreamMediaCasterPlay: startPlay
INFO server comment - RTPMediaCaster.create[8355938]
INFO server comment - RTPMediaCaster.init[8355938]
INFO server comment - RTPMediaCaster.Reconnector[8355938:stream/_definst_:c3f4a878-4fcc-460d-af3a-e551e6b782d1]: start: 1
INFO server comment - StreamNameAliasFile.load[/usr/local/WowzaMediaServer/conf/aliasmap.stream.txt]: size:12:12 hash:true matchAll:false
INFO server comment - ModuleStreamNameAlias.nameToAlias[stream]: streamName:c3f4a878-4fcc-460d-af3a-e551e6b782d1 alias:{pattern: "c3f4a878-4fcc-460d-af3a-e551e6b782d1" alias:"udp://207.179.74.242:62173" wildcardMatches:null} result:udp://207.179.74.242:62173
INFO server comment - RTPSessionDescriptionDataProviderBasic.getStreamInfo[stream/_definst_]: URI: udp://207.179.74.242:62173
INFO stream create - -
INFO server comment - RTPUDPTransport.bind[stream/_definst_]: 0.0.0.0/0.0.0.0:62173
INFO stream publish c3f4a878-4fcc-460d-af3a-e551e6b782d1 -
INFO server comment - RTPMediaCaster.Reconnector[8355938:stream/_definst_:c3f4a878-4fcc-460d-af3a-e551e6b782d1]: done: 1
INFO server comment - UDPTransport.firstPacket: bind:0.0.0.0/0.0.0.0:62173 msg:/207.179.74.242:17367
INFO server comment - RTPDePacketizerMPEGTS.handleRTPPacket: IMPORT: programID[prg:0x1,filter:none]
INFO server comment - RTPDePacketizerMPEGTS.handleRTPPacket: IMPORT: videoPID[prg:0x1,pid:0x44,filter:none]: streamType:H264:27
INFO server comment - RTPDePacketizerMPEGTS.handleRTPPacket: IMPORT: audioPID[prg:0x1,pid:0x45,filter:none]: streamType:AAC:15 audioLanguage:uknown
INFO server comment - LiveStreamPacketizerSanJose.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTarget: 10000
INFO server comment - LiveStreamPacketizerSanJose.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTolerance: 500
INFO server comment - LiveStreamPacketizerSanJose.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: playlistChunkCount:4
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: sanjosestreamingpacketizer:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - SanJosePacketHandler.startStream[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - LiveStreamPacketizerSanJose.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Video codec: H264
INFO server comment - LiveStreamPacketizerSanJose.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Audio codec: AAC
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTarget: 10000
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTolerance: 500
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: audioGroupCount: 3
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: playlistChunkCount:3
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: cupertinostreamingpacketizer:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - CupertinoPacketHandler.startStream[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Video codec:H264 isCompatible:true
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Audio codec:AAC isCompatible:true
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1][mp4a.40.2]: AAC Audio info: {AACFrame: codec:AAC, channels:2, frequency:32000, samplesPerFrame:1024, objectType:LC}
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: smoothstreamingpacketizer:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - LiveStreamPacketizerSmoothStreaming.startStream[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1][avc1.66.20]: H.264 Video info: {H264CodecConfigInfo: codec:H264, profile:Baseline, level:2.0, frameSize:352x240, displaySize:352x240, frameRate:29.0, PAR:1:1}
INFO stream play c3f4a878-4fcc-460d-af3a-e551e6b782d1 -
INFO server comment - LiveStreamPacketizerSmoothStreaming.flushPendingAudio: Bitrate[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: 65570
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:0 count:63 duration:2016
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:1 count:63 duration:2016
INFO server comment - LiveStreamPacketizerCupertino.endChunkTS[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: id:1 a/v/k:102/270/3 duration:9760
INFO server comment - LiveStreamPacketizerSanJose.endChunkTS[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: id:1 a/v/k:307/271/3 duration:9760
INFO server comment - LiveStreamPacketizerSmoothStreaming.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Fragment durations: [2.9,3.0,3.0]
INFO server comment - LiveStreamPacketizerSmoothStreaming.flushPendingVideo: Bitrate[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: 265035
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:video id:0 count:90 duration:2976
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:2 count:63 duration:2016
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:3 count:63 duration:2016
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:video id:1 count:90 duration:3008
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:4 count:63 duration:2016
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:video id:2 count:90 duration:3008
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:5 count:63 duration:2016
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:audio id:6 count:63 duration:2016
INFO server comment - LiveStreamPacketizerSanJose.endChunkTS[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: id:2 a/v/k:283/271/3 duration:9024
INFO server comment - LiveStreamPacketizerCupertino.endChunkTS[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: id:2 a/v/k:94/270/3 duration:9024
Exception in thread "VHostHandler._defaultVHost_.430" java.lang.OutOfMemoryError: Java heap space
        at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:133)
        at java.lang.StringCoding.decode(StringCoding.java:173)
        at java.lang.String.<init>(String.java:444)
        at com.wowza.util.Base64.encodeBytes(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.LiveStreamPacketizerSanJose.c(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.LiveStreamPacketizerSanJose.b(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.LiveStreamPacketizerSanJose.endChunkTS(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.LiveStreamPacketizerSanJose.endChunk(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.SanJosePacketHandler.b(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.SanJosePacketHandler.handleHolderInternal(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.SanJosePacketHandler.handleHolder(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.SanJosePacketHandler.handlePacketSorted(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.SanJosePacketHandler.handlePacket(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.SanJosePacketHandler.handlePacket(Unknown Source)
        at com.wowza.wms.httpstreamer.sanjosestreaming.livestreampacketizer.LiveStreamPacketizerSanJose.internalHandlePacket(Unknown Source)
        at com.wowza.wms.stream.livepacketizer.LiveStreamPacketizerBase.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
WARN server comment - LiveReceiver.startVideoPacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Video packet sync issue.
Exception in thread "IdleWorkerUtil-4" java.lang.OutOfMemoryError: Java heap space
Exception in thread "VHostTransport._defaultVHost_.10" java.lang.OutOfMemoryError: Java heap space
WARN server comment - LiveReceiver.startAudioPacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Audio packet sync issue.
INFO server comment - LiveStreamPacketizerSanJose.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTarget: 10000
INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Add chunk: type:video id:3 count:90 duration:3008
Exception in thread "Thread-11" java.lang.OutOfMemoryError: Java heap space
INFO server comment - MediaStreamMap.removeLiveStreamPacketizer[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Destroy live stream packetizer: cupertinostreamingpacketizer
Exception in thread "VHostHandler._defaultVHost_.454" java.lang.OutOfMemoryError: Java heap space
Exception in thread "IdleWorkerUtil-6" java.lang.OutOfMemoryError: Java heap space
Exception in thread "IdleWorkerUtil-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "VHostHandler._defaultVHost_.426" java.lang.OutOfMemoryError: Java heap space
INFO server comment - LiveStreamPacketizerSanJose.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTolerance: 500
WARN server comment - LiveReceiver.startVideoPacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Video packet sync issue.
INFO server comment - MediaStreamMap.removeLiveStreamPacketizer[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Destroy live stream packetizer: sanjosestreamingpacketizer
INFO server comment - LiveStreamPacketizerSanJose.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: playlistChunkCount:4
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: sanjosestreamingpacketizer:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTarget: 10000
INFO server comment - SanJosePacketHandler.startStream[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: chunkDurationTolerance: 500
INFO server comment - LiveStreamPacketizerSanJose.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Video codec: H264
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: audioGroupCount: 3
INFO server comment - LiveStreamPacketizerSanJose.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Audio codec: AAC
INFO server comment - LiveStreamPacketizerCupertino.init[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: playlistChunkCount:3
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: cupertinostreamingpacketizer:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - CupertinoPacketHandler.startStream[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: smoothstreamingpacketizer:c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Video codec:H264 isCompatible:true
INFO server comment - LiveStreamPacketizerSmoothStreaming.startStream[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1]: Audio codec:AAC isCompatible:true
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1][avc1.66.20]: H.264 Video info: {H264CodecConfigInfo: codec:H264, profile:Baseline, level:2.0, frameSize:352x240, displaySize:352x240, frameRate:29.0, PAR:1:1}
INFO server comment - LiveStreamPacketizerCupertino.handlePacket[stream/_definst_/c3f4a878-4fcc-460d-af3a-e551e6b782d1][mp4a.40.2]: AAC Audio info: {AACFrame: codec:AAC, channels:2, frequency:32000, samplesPerFrame:1024, objectType:LC}
INFO vhost vhost-stop _defaultVHost_ -
INFO server comment - MediaStreamMediaCasterPlay: close
INFO stream stop c3f4a878-4fcc-460d-af3a-e551e6b782d1 -
INFO stream destroy c3f4a878-4fcc-460d-af3a-e551e6b782d1 -
INFO session disconnect 330653744 -
INFO application app-stop _definst_ stream/_definst_
INFO server comment - RTPMediaCaster.shutdown[8355938:stream/_definst_:c3f4a878-4fcc-460d-af3a-e551e6b782d1]: c3f4a878-4fcc-460d-af3a-e551e6b782d1
INFO server comment - RTPMediaCaster.disconnect[8355938:stream/_definst_:c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - RTPMediaCaster.closeRTPSession[8355938:stream/_definst_:c3f4a878-4fcc-460d-af3a-e551e6b782d1]
INFO server comment - RTPUDPTransport.unbind[stream/_definst_]: /207.179.74.242:62173 sent:0 recv:1013

If I take out the LiveStreamPacketizers it seems to work fine, but my goal is to get this to work for both FLASH as well as iOS.

FYI, I do know that my MPEG-TS is out of sync. I am using the RTPDePacketizerWrapperReChunkMPEGTS to compensate for this.

Can anyone offer any help here?

Well, you’re getting an OutOfMemory error which seems strange to me, to think it would be caused by an encoding issue. You have implemented the steps in the Tuning Guide, right?

It couldn’t hurt to offer up more information. Such as a description of how you’re doing your encoding. See here for a list of helpful information to include: https://www.wowza.com/forums/content.php

You can do systematic troubleshooting to narrow down the problem. Take out all your modules and see if the issue still manifests with your stream. You could try transcoding prior to Wowza, or test with a different stream, etc…

Aaron,

You will get outOfMemory errors from overloading the server. Do you have any custom modules doing HTTP or JDBC calls? These can cause problems that might lead to outOfMemory.

Richard

Removing unneeded LiveStreamPacketizers is a good idea.

Richard

Also, are you implementing ILogNotify? That might be expensive. Have you tried without that? Can you convert to unix time stamps later?

Richard

Randall,

Thanks for your response. Yes, I have gone through the tuning guide. Everything is setup correctly. I can playback VOD files just fine in both the flash player as well as iOS. I’ve been running live streams through it as well, but only watching in flash from this point. I’m trying to get it to work in iOS.

Are you suspecting the encoder? I can’t tell you much from this point. All I know is that it is encoding h.264/AAC Baseline level 2 and sending MPEG-TS over UDP. I have an email into the developer to get more information from that side of the equation. Can you recommend a known working live encoder that will send MPEG-TS over UDP to Wowza so I can run a test.

Thanks!

Aaron

Richard,

The only custom module I have is for the log appender. It allows me to have for unix time stamps in the logs. Other than that, I have StreamNameAlias in this specific application, but that’s it. I also noticed that it I remove the sanjosestreamingpacketizer I still have a failure, but the exception seemed to be very different. Let me get it back into that state, and I’ll reply with the messages.

Thanks!

Aaron

“Are you suspecting the encoder?”

You said your MPEG-TS stream was out of sync, suggesting a problem with the encoder.

“Can you recommend a known working live encoder that will send MPEG-TS over UDP to Wowza so I can run a test.”

Haivision Barracuda/Makito I think, can send MPEG-TS. VLC and FFMPEG also.