How to configure a broadcast with GoCoder SDK for iOS

You can use the WowzaConfig class in the Wowza GoCoder™ SDK for iOS to configure properties for a live streaming broadcast. There are three primary categories of properties: video, audio, and connection properties for the Wowza Streaming Cloud™ service and Wowza Streaming Engine™ media server software.

Contents


Configure the stream Use the configuration presets
More resources

Configure the stream


Configure the video

Use the following properties to configure the video stream:

Property Description
videoFrameSize The video resolution (width by height) in pixels. The default is 640x480.
videoFrameRate The number of frames per second (fps). The default is 30.
videoKeyFrameInterval The number of frames between keyframe insertions. The default is 30.
videoBitate The video bitrate in bits per second (bps). The default is 1500.

The following example demonstrates how to use the video properties:

// Get a copy of the active config
WowzaConfig broadcastConfig = self.goCoder.config;

// Set the frame rate to 15 fps
broadcastConfig.videoFrameRate = 15;  
// Set the keyframe interval to 10 frames
broadcastConfig.videoKeyFrameInterval = 10;  
// Set the bitrate to 2.5 kbps
broadcastConfig.videoBitrate = 2500;

// Update the active config
self.goCoder.config = broadcastConfig;

Configure the audio

Use the following properties to configure the audio stream:

Property Description
audioSampleRate The audio sample rate in hertz (Hz). The default is 44100.
audioChannels The number of audio channels. The default is 2.
audioBitrate The audio bitrate in bits per second (bps). The default is 64000.

The following example shows how to use the audio properties:

// Get a copy of the active config
WowzaConfig broadcastConfig = self.goCoder.config;

// Set the sample rate to 22.1 kHz
broadcastConfig.audioSampleRate = 22100;  

// Update the active config
self.goCoder.config = broadcastConfig;

Configure the connection

Use the following properties to configure the connection to your Wowza Streaming Engine server or to a Wowza Streaming Cloud live stream:

Property Description
hostAddress The domain name or IP address of the destination. There isn't a default value.
portNumber The port number for the Wowza Streaming Engine server. The default is 1935.
applicationName The name of the destination live streaming application. The default is live.
streamName The name of the live stream that you're broadcasting. The default is myStream.
username (If your application requires it) the source authentication username. There isn't a default value.
password (If your application requires it) the password associated with the source authentication username. There isn't a default value.

The following example shows how to use the connection properties:

// Get a copy of the active config
WowzaConfig broadcastConfig = self.goCoder.config;

// Set the hostname
broadcastConfig.hostAddress = @"live.someserver.net";
// Set the name of the stream
broadcastConfig.streamName = @"someStreamName";

// Update the active config
self.goCoder.config = broadcastConfig;

Use configuration presets


Alternatively, configure your broadcast with one of the following presets, which accommodate common frame sizes:

Preset Frame Size Bitrate
WOWZFrameSizePreset352x288 352x288 280 Kbps
WOWZFrameSizePreset640x480 640x480 1.5 Mbps
WOWZFrameSizePreset1280x720 1280x720, or 720p 3.75 Mbps
WOWZFrameSizePreset1920x1080 1920x1080, or 1080p 5 Mbps
WOWZFrameSizePreset3840x2160 3840x2160, or UHD 4K 8 Mbps

The following example shows how to use a frame-size preset:

// Get a copy of the active config
WowzaConfig broadcastConfig = self.goCoder.config;

// Set the defaults for 720p video
[broadcastConfig loadPreset:WOWZFrameSizePreset1280x720];

// Update the active config
self.goCoder.config = broadcastConfig;

More resources



If you're having problems or want to discuss this article, post in our forum.