# UDP streaming to wowza with ffmpeg

**URL:** <https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419>\
**Category:** Wowza Streaming Engine\
**Created:** [August 27, 2013, 12:23pm UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419 "2013-08-27T12:23:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxim\_Kozlov](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Maxim\_Kozlov](https://community.wowza.com/u/Maxim_Kozlov)\
**Post date:** [August 27, 2013, 12:23pm UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419/1 "2013-08-27T12:23:46Z")

</div>

Hi.

I’m trying to push an mpeg-ts stream to wowza with ffmpeg:

```auto
ffmpeg -y -fflags +genpts -threads 0 -rtbufsize 2G -i INPUT -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -s 1280x720 -x264opts level=31:keyint=25:fps=25:ref=3:bitrate=4000:vbv_maxrate=4000:vbv_bufsize=4000 -preset:v medium -aspect 16:9 -af aresample=22050 -acodec libfdk_aac -ab 64k -ar 22050 -ac 2 -map 0:v -map 0:a -f mpegts "udp://192.168.155.6:10103?pkt_size=1316"

```

The bitrates lower than 4000k works fine. But when i set video bitrate to 4000k or more, live video sometimes(once in 30-180 seconds) breaks

![](http://img-fotki.yandex.ru/get/9110/24945529.3d/0_9f405_a7214966_orig)

and no any message in error.log

Tried to change sortBuffer, but have no luck.

The network between encoder and wowza server is 1G.

For tests, i started at wowza machine a ffmpeg, listening to udp port for incoming stream and saving this stream to file

```auto
ffmpeg -i udp://192.168.155.6:10103 -c copy -f mpegts test.ts

```

The live stream recorded without any artifacts.

What params in wowza should i check?

Or it is not possible to stream with high bitrates through udp?

Wowza running on on ubuntu linux.

**Application.xml**

```auto
<Root>
	<Application>
		<Connections>
			<AutoAccept>true</AutoAccept>
			<AllowDomains></AllowDomains>
		</Connections>
		<Streams>
			<StreamType>live</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<LiveStreamPacketizers>cupertinostreamingpacketizer, sanjosestreamingpacketizer, smoothstreamingpacketizer, dvrstreamingpacketizer</LiveStreamPacketizers>
			<Properties>
<Property>
	<Name>sortPackets</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>
<Property>
	<Name>sortBufferSize</Name>
	<Value>1500</Value>
	<Type>Integer</Type>
</Property>
			</Properties>
		</Streams>
		<Transcoder>
			<LiveStreamTranscoder></LiveStreamTranscoder>
			<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>
			<Recorders>dvrrecorder</Recorders>
			<Store>dvrfilestorage</Store>
			<WindowDuration>10800</WindowDuration>
			<StorageDir>/data/ndvr</StorageDir>
			<ArchiveStrategy>delete</ArchiveStrategy>
			<Repeater>
				<ChunkOriginURL></ChunkOriginURL>
			</Repeater>
			<Properties>
<Property>
	<Name>startRecordingOnStartup</Name>
	<Value>false</Value>
	<Type>boolean</Type>
</Property>
			</Properties>
		</DVR>
		<HTTPStreamers>cupertinostreaming, smoothstreaming, sanjosestreaming, dvrchunkstreaming</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>
			<Authentication>
				<PublishMethod>digest</PublishMethod>
				<PlayMethod>none</PlayMethod>
			</Authentication>
			<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>
<Property>
	<Name>rtpDePacketizerWrapper</Name>
	<Value>com.wowza.wms.rtp.depacketizer.RTPDePacketizerWrapperReChunkMPEGTS</Value>
</Property>
			</Properties>
		</RTP>
		<MediaCaster>
			<RTP>
				<RTSP>
					<RTPTransportMode>interleave</RTPTransportMode>
				</RTSP>
			</RTP>
			<Properties>
<Property>
	<Name>streamTimeout</Name>
	<Value>12000</Value>
	<Type>Integer</Type>
</Property>
			</Properties>
		</MediaCaster>
		<MediaReader>
			<Properties>
			</Properties>
		</MediaReader>
		<MediaWriter>
			<Properties>
			</Properties>
		</MediaWriter>
		<LiveStreamPacketizer>
			<Properties>
 <Property>
 <Name>cupertinoCreateAudioOnlyRendition</Name>
 <Value>true</Value>
 <Type>Boolean</Type>
</Property>
<Property>
	<Name>httpRandomizeMediaName</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>
			</Properties>
		</LiveStreamPacketizer>
		<HTTPStreamer>
			<Properties>
<Property>
	<Name>cupertinoCalculateCodecs</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>
<Property>
	<Name>cupertinoCalculateResolution</Name>
	<Value>false</Value>
	<Type>Boolean</Type>
</Property>
<Property>
    <Name>cupertinoAutoCreateMultibitratePlaylist</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>
<Property>
    <Name>cupertinoUseCalculatedVideoBitrate</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>
<Property>
    <Name>cupertinoUseCalculatedAudioBitrate</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>
<Property>
    <Name>cupertinoDefaultVideoBitrate</Name>
    <Value>250000</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoMaxCalculatedVideoBitrate</Name>
    <Value>0</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoDefaultAudioBitrate</Name>
    <Value>64000</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoMaxCalculatedAudioBitrate</Name>
    <Value>64000</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoBitrateAdjustmentFactor</Name>
    <Value>110</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>cupertinoPacketizeAllStreamsAsTS</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
</Property>
<!-- HTTP origin mode: on, off -->
<Property>
	<Name>httpOriginMode</Name>
	<Value>on</Value>
</Property>
<!-- Apple HLS: cache control -->
<Property>
	<Name>cupertinoCacheControlPlaylist</Name>
	<Value>max-age=1</Value>
</Property>
<Property>
	<Name>cupertinoCacheControlMediaChunk</Name>
	<Value>max-age=3600</Value>
</Property>
<!-- Smooth Streaming: cache control -->
<Property>
	<Name>smoothCacheControlPlaylist</Name>
	<Value>max-age=1</Value>
</Property>
<Property>
	<Name>smoothCacheControlMediaChunk</Name>
	<Value>max-age=3600</Value>
</Property>
<Property>
	<Name>smoothCacheControlDataChunk</Name>
	<Value>max-age=3600</Value>
</Property>
<!-- Flash HDS: cache control -->
<Property>
	<Name>sanjoseCacheControlPlaylist</Name>
	<Value>max-age=1</Value>
</Property>
<Property>
	<Name>sanjoseCacheControlMediaChunk</Name>
	<Value>max-age=3600</Value>
</Property>
<Property>
	<Name>cupertinoOnChunkStartResetCounter</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>
			</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>ModuleSecureURLParams</Name>
			     <Description>ModuleSecureURLParams</Description>
			     <Class>com.wowza.wms.plugin.security.ModuleSecureURLParams</Class>
			</Module>
		</Modules>
		</Properties>
	</Application>
</Root>

```

---

<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:** [August 27, 2013, 8:46am UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419/2 "2013-08-27T08:46:40Z")

</div>

You might try lowering the frame size from 1280 x 720 to something like 720 x 576 to see if that fixes it.

Salvadore

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 27, 2013, 5:12pm UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419/3 "2013-08-27T17:12:57Z")

</div>

And try a much lower bitrate. You have it set to 4000kbs (4mbs). Try bitrate:1000

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [August 27, 2013, 5:31pm UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419/4 "2013-08-27T17:31:06Z")

</div>

It is a balancing act of trade-offs. What matters is throughput from Wowza to the playback client. It doesn’t necessarily matter how much bandwidth either end is supposed to have, because there are many hops in between. The best solution is to use the Wowza Transocder and ABR streaming.

Richard

---

<div class="post-metadata">

**Author:** ![Maxim\_Kozlov](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Maxim\_Kozlov](https://community.wowza.com/u/Maxim_Kozlov)\
**Post date:** [August 27, 2013, 7:44pm UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419/5 "2013-08-27T19:44:11Z")

</div>

The same problem =(

---

<div class="post-metadata">

**Author:** ![Maxim\_Kozlov](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@Maxim\_Kozlov](https://community.wowza.com/u/Maxim_Kozlov)\
**Post date:** [August 27, 2013, 8:19pm UTC](https://community.wowza.com/t/udp-streaming-to-wowza-with-ffmpeg/39419/6 "2013-08-27T20:19:41Z")

</div>

Bitrates lower than 4000k works fine.

1Mbps for 720p video is too low.
