Wowza Community

Flash Player crashes on RTSP Re-streaming from D-Link DCS-942L and TrendNET TV-IP572W

Hi,

I’m trying to re-stream from 2 H.264 IP cameras: D-Link DCS-942L and TrendNET TV-IP572W. Wowza can connect to the cameras, and I can view the stream from Wowza using the RTSP URL in VLC.

When I try to view the RTMP stream in Flash Player, the player crashes. I captured the following meta data from the Flash Player before the player crashes:

D-LINK
meta
(Object)#0
  displayHeight = 480
  displayWidth = 640
  frameHeight = 480
  framerate = 15
  frameWidth = 640
  height = 480
  rtpsessioninfo = (Object)#1
    attributes = (Object)#2
      charset = "Shift_JIS"
      etag = "1234567890"
      range = "npt=now-"
    name = "DCS-942L"
    origin = "CV-RTSPHandler 1123412 0 IN IP4 192.168.1.204"
    protocolversion = "0"
    timing = "0 0"
  trackinfo = (Array)#3
    [0] (Object)#4
      description = "{H264CodecConfigInfo: codec:H264, profile:Baseline, level:3.0, frameSize:640x480, displaySize:640x480, frameRate:15.0}"
      language = "eng"
      profile-level-id = "42a01e"
      sampledescription = (Array)#5
        [0] (Object)#6
          sampletype = "H264"
      sprop-parameter-sets = "Z0IAHukBQHt/4AAAAwAcSABt3QAM3+YA2IEJQA==,aM4xUg=="
      timescale = 90000
      type = "video"
  videocodecid = "avc1"
  width = 640
TrendNET
meta
(Object)#0
  displayHeight = 400
  displayWidth = 640
  frameHeight = 400
  framerate = 15
  frameWidth = 640
  height = 400
  rtpsessioninfo = (Object)#1
    attributes = (Object)#2
      charset = "Shift_JIS"
      etag = "1234567890"
      range = "npt=now-"
    name = "TV-IP572W"
    origin = "CV-RTSPHandler 1123412 0 IN IP4 192.168.1.201"
    protocolversion = "0"
    timing = "0 0"
  trackinfo = (Array)#3
    [0] (Object)#4
      description = "{H264CodecConfigInfo: codec:H264, profile:Baseline, level:3.0, frameSize:640x400, displaySize:640x400, frameRate:15.0}"
      language = "eng"
      profile-level-id = "42a01e"
      sampledescription = (Array)#5
        [0] (Object)#6
          sampletype = "H264"
      sprop-parameter-sets = "Z0IAHukBQGd/4AAAAwAcSABt3QAM3+YA2IEJQA==,aM4xUg=="
      timescale = 90000
      type = "video"
  videocodecid = "avc1"
  width = 640

Any ideas?

Thanks,

Dan

I can provide an mp4 file that manifests the problem as well as a live stream if it will help.

Thanks,

Dan

Dan,

First, make sure you are configured following this guide:

https://www.wowza.com/docs/how-to-re-stream-video-from-an-ip-camera-rtsp-rtp-re-streaming

I would try adding the Application.xml /Streams nalUnitFilter Property (from the IP camera guide)

<Property>
    <Name>nalUnitFilter</Name>
    <Value>13</Value>
    <Type>Integer</Type>
</Property>

The nalUnitFilter Property is specific to Flash playback problems

And you might try the Application.xml /MediaCaster Property rtspFilterUnknownTracks

If that does not help, yes, send the source rtsp url to support@wowza.com. Include a link to this thread for reference.

Richard

Dan,

What is the video codec? Playback the rtsp source in VLC and check Tools > Codec Info. What do you see?

Richard

Dan,

Okay, thanks for that info. The codec is okay. Two video blocks like that might indicate UDP ports are blocked, but in that case they are usually identical. I don’t see any evidence of it, but are there two video tracks in that stream?

Please go ahead and send the source rtsp url, and that file, to support@wowza.com. Include a link to this thread for reference.

Richard

The long delay indicates that UDP ports are not open in your firewall and/or not properly mapped in your network to the server running Wowza. Take a look at this guide:

https://www.wowza.com/docs/how-to-troubleshoot-rtsp-rtp-playback

If you watch the codec info window after you start playback in VLC you should see the first block right away, then the 2nd one appear ~10 seconds later just as playback starts. Note that many Android devices cannot fail-over to TCP, so they just won’t work if UDP ports are blocked. For routers you have to port-forward and there is guidance for many routers at portforward.com

Also, sorry, should have pointed to this as well, if you are being a router or NAT this is important:

https://www.wowza.com/docs/how-to-set-up-an-application-for-rtsp-rtp-streaming

Richard

Dan,

With these changes, is perhaps the Flash crash problem fixed?

Richard

Daniel, how do you get the metadata from flash player?

Thanks, Rob

Thanks.

We know the issue which you are describing as well. Some specific IP cameras crash jw player. This is what helped in most situations:

  1. changing to udp mode

  2. adding rtpIgnoreProfileLevelId true, rtspFilterUnknownTracks true, rtspValidationFrequency 0, nalUnitFilter 13,

  3. sometimes helped AVSyncMethod change to systemclock

Hope this helps.

Thanks Richard - Those properties don’t seem to make a difference.

The only thing that helps is to cut out the video track. Then I can stream the audio over RTMP with no issues.

rtspStreamAudioTrack

true

Boolean

rtspStreamVideoTrack

false

Boolean

I’ll go over the guide again to make sure there are no other properties that I haven’t tried, then I’ll send the source mp4 file and sample URLs to the support email.

Thanks,

Dan

Hi Richard,

Both the D-Link DCS-942L and TrendNET TV-IP572W report the exact same info in VLC under Tools -> Codec:

Stream 0
  Type: Video
  Codec: H264 - MPEG-4 AVC (part 10) (h264)
Stream 1
  Type: Video
  Codec: H264 - MPEG-4 AVC (part 10) (h264)
  Resolution: 640x480  (TrendNET uses 640x400)
  Frame rate: 30
  Decoded format: Planar 4:2:0 YUV full scale

If I use LiveStreamRecord module to record an mp4 from the live stream FFmpeg reports the following:

\ffmpeg-20130406-git-7775992-win64-static\bin\ffprobe trendnet.mp4
ffprobe version N-51639-g7775992 Copyright (c) 2007-2013 the FFmpeg developers
  built on Apr  5 2013 22:29:42 with gcc 4.8.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrn
b --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --ena
ble-zlib
  libavutil      52. 25.100 / 52. 25.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  1.100 / 55.  1.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 49.100 /  3. 49.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'trendnet.mp4':
  Metadata:
    major_brand     : f4v
    minor_version   : 0
    compatible_brands: isommp42m4v
    creation_time   : 2013-04-12 13:49:59
  Duration: 00:01:00.48, start: 0.000000, bitrate: 266 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p, 640x400, 263 kb/s, 30.01 fps, 30 tbr, 90k tbn, 30 tbc
    Metadata:
      creation_time   : 2013-04-12 13:49:59
      handler_name    : WowzaMediaServerPro

The file trendnet.mp4 crashes when viewed in Flash Player through a vod application.

Thanks,

Dan

I sent sample MP4 files and RTSP URLs to support@wowza.com.

Thanks,

Dan

Thanks Richard - I sent sample MP4 files and RTSP URLs to the support address.

About the 2 video blocks, in my RTSP setup my EC2 external IP address had changed. I corrected it and now have only the single stream:

Stream 0
  Type: Video
  Codec: H264 - MPEG-4 AVC (part10) (h264)
  Resolution: 640x480
  Frame rate: 30
  Decoded format: Planar 4:2:0 YUV full scale

  • For the D-Link and TrendNET, I found that I had to change the following property for them to connect (Axis was fine with interleave):
		<MediaCaster>
			<RTP>
				<RTSP>
					<!-- udp, interleave -->
					<RTPTransportMode>udp</RTPTransportMode>
				</RTSP>
			</RTP>

Thanks - I updated my post above. Bottom line, my RTP->RTSPConnectionIpAddress/RTSPOriginIpAddress addresses weren’t updated when my EC2 external IP changed. I have corrected them and see a single line in VLC now, which I think is good.

Any ideas on the H.264/MP4 Flash crash? I’ll wait to see if you can reproduce the problem with the URLs that I sent to the support address and the sample files.

Thanks!

Dan

Unfortunately, no. I can still reproduce the Flash crash in 3 separate scenarios:

  1. Re-stream the D-Link or TrendNET IP camera over RTMP to Flash Player.

  2. Create an mp4 file from the D-Link or TrendNET IP camera using the Wowza LiveStreamRecord module and view it over RTMP using a VOD application.

  3. Have either camera FTP a video clip and view it over RTMP using a VOD application.

Thanks,

Dan

Hi Rob,

I had an old Flash ActionScript project lying around that used a NetConnection and NetStream to display video in a Video object. My thought was that if I could reproduce the crash that I’m seeing in Flowplayer and the Wowza example clients, then maybe I could debug it in the IDE using the Flash debugger. I can reproduce the crash, but I can’t seem to get any useful information other than the metadata that is output right before the crash. In the test project, I create a metadata handler in a client and attach it to the NetStream.

From TestProject.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   xmlns:local="*"
			   xmlns:components="components.*"
			   xmlns:layouts="spark.layouts.*"
			   width="985" height="635" backgroundColor="#F4F4F6" creationComplete="init();">
	
	<fx:Script>
		<![CDATA[
			import mx.utils.ObjectUtil;
			
			private var connection:NetConnection;
			private var stream:NetStream;
			private var video:Video;
			private var meta:Object;
			
			private function init():void {
				connection = new NetConnection();
				connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
				connection.connect("rtmp://www.<mywowzaserver>.com:1935/rtp/_definst_");
			}
			
			private function netStatusHandler(event:NetStatusEvent):void {
				trace(event+": "+event.info.code);
				switch (event.info.code) {
					case "NetConnection.Connect.Success":
						connectStream();
						break;
					case "NetStream.Play.Failed":
						stream.close();
						break;
				}
			}
			private function connectStream():void {
				stream = new NetStream(connection);
				stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
				var client:Object = {};
				client.onMetaData = onMetaData;
				client.onCuePoint = onCuePoint;
				client.onStatus = netStatusHandler;
				stream.client = client;
				stream.play("wowzasupport/trendnet");
				video = new Video();
				video.attachNetStream(stream);
				uic.addChild(video);
			}
			public function onMetaData(info:Object):void {
				trace("meta");
				meta = info;
				uic.width = video.width;
				uic.height = video.height;
				panel.visible = true;
				trace(ObjectUtil.toString(info));
			}
			public function onCuePoint(info:Object):void {
				trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
			}
			
		]]>
	</fx:Script>
	
	<s:Group id="panel" visible="false">
		<mx:UIComponent id="uic" />
	</s:Group>
	
</s:Application>

Cheers,

Dan

Thanks Rob,

I tried a few of those based on the troubleshooting guide, but I added the remaining ones that I hadn’t tried. Unfortunately I am still having no luck with the D-Link DCS-942L and TrendNET TV-IP572W. They crash when playback starts - the time increments to 1 second, no video is displayed then the player crashes. I see the same behaviour for VOD.

Here is my Application.xml for my RTP app:

<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</LiveStreamPacketizers>			
			<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
			<Properties>
				<Property>
					<Name>nalUnitFilter</Name>
					<Value>13</Value>
					<Type>Integer</Type>
				</Property>
			</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 -->
			<!-- 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>
			<!-- If this is a dvrstreamingrepeater, -->
			<!-- either define the general Application/Repeater/OriginURL below to point back to the origin -->
			<!-- or define this one (which affects only DVR origin-edge). *e.g. http://localhost/dvrorigin -->
			<Repeater>
				<ChunkOriginURL></ChunkOriginURL>
			</Repeater>
			<!-- Properties for DVR -->
			<Properties>
			</Properties>
		</DVR>
		<TimedText>
			<!-- VOD caption providers (separate with commas): vodcaptionprovidermp4_3gpp, vodcaptionproviderttml, vodcaptionprovidersrt, vodcaptionproviderscc -->
			<VODTimedTextProviders>vodcaptionprovidermp4_3gpp</VODTimedTextProviders>
			
			<!-- Properties for TimedText -->
			<Properties>
			</Properties>		
		</TimedText>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming -->
		<HTTPStreamers>cupertinostreaming</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-->
			<AVSyncMethod>systemclock</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>
				<Property>
					<Name>rtpIgnoreProfileLevelId</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
			</Properties>
		</RTP>
		<MediaCaster>
			<RTP>
				<RTSP>
					<!-- udp, interleave -->
					<RTPTransportMode>udp</RTPTransportMode>
				</RTSP>
			</RTP>
			<!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
			<Properties>
				<Property>
					<Name>rtspStreamAudioTrack</Name>
					<Value>false</Value>
					<Type>Boolean</Type>
				</Property>
				<Property>
					<Name>rtspStreamVideoTrack</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
				<Property>
					<Name>debugRTSPSession</Name>
					<Value>false</Value>
					<Type>Boolean</Type>
				</Property>
				<Property>
					<Name>rtspFilterUnknownTracks</Name>
					<Value>true</Value>
					<Type>Boolean</Type>
				</Property>
				<Property>
					<Name>rtspValidationFrequency</Name>
					<Value>0</Value>
					<Type>Integer</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>
				<Property>
					<Name>cupertinoChunkDurationTarget</Name>
					<Value>2000</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>
				<Property>
					<Name>cupertinoRepeaterChunkCount</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>
		<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>ModuleLiveStreamRecord</Name>
				<Description>ModuleLiveStreamRecord</Description>
				<Class>com.wowza.wms.plugin.livestreamrecord.ModuleLiveStreamRecord</Class>
			</Module>
			<Module>
				<Name>ModuleLimitPublishedStreamBandwidth</Name>
				<Description>Module Limit to Published Stream Bandwidth</Description>
				<Class>com.wowza.wms.plugin.collection.module.ModuleLimitPublishedStreamBandwidth</Class>
			</Module>
		</Modules>
		<!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
		<Properties>
			<Property>
				<Name>MaxBitrate</Name>
				<Value>0</Value>
				<Type>Integer</Type>
			</Property>
			<Property>
				<Name>StreamMonitorLogging</Name>
				<Value>true</Value>
				<Type>Boolean</Type>
			</Property>
		</Properties>
	</Application>
</Root>

Thanks,

Dan