Broadcast Configuration

The WowzaConfig class is used to retrieve and set the configuration properties for a live streaming broadcast. The properties fall into three primary categories: video, audio, and the connection parameters for Wowza Cloud or a Wowza Streaming Engine server.

Video Stream Configuration

The following properties can be specified for the video stream.

Video Parameter Description Default value
Frame size The video resolution (width x height) in pixels 640x480
Frame rate The number of frames per second (fps) 30
Keyframe interval The number of seconds in between keyframe insertion 30
Bitrate The video bitrate (bps) 1500
// Get a copy of the active config
WowzaConfig broadcastConfig = self.goCoder.config;

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

// Update the active config
self.goCoder.config = broadcastConfig;
// Get the active config
WowzaConfig broadcastConfig = this.goCoder.getConfig();

// Set the frame rate to 15 fps
broadcastConfig.setVideoFramerate(15);
// Set the key frame interval to 10 seconds
broadcastConfig.setVideoFramerate(10);
// Set the bitrate to 2.5 kbps
broadcastConfig.setVideoFramerate(2500);

// Update the active config
this.goCoder.setConfig(broadcastConfig);

Audio Stream Configuration

The following properties can be specified for the audio stream.

Audio Parameter Description Default value
Sample rate The audio sample rate (Hz) 44100
Audio channels The number of audio channels (i.e. mono or stereo) 2
Bitrate The audio bitrate (bps) 64000
// 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;
// Get the active config
WowzaConfig broadcastConfig = this.goCoder.getConfig();

// Set the sample rate to 22.1 kHz
broadcastConfig.setAudioSampleRate(22100);

// Update the active config
this.goCoder.setConfig(broadcastConfig);

Connection Parameters

The following parameters can be specified to setup the connection to the streaming server or service.

Connection Parameter Description Default value
Host address The domain name or IP address of the destination (none)
Port number The port number for the streaming server 1935
Application name The name of the targeted live streaming application live
Stream name The name of the live broadcast stream myStream
Username (optional) The username for applications requiring source authentication (none)
Password (optional) The password for applications requiring source authentication (none)
// 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;
// Get the active config
WowzaConfig broadcastConfig = this.goCoder.getConfig();

// Set the hostname
broadcastConfig.setHostAddress("live.someserver.net");
// Set the name of the stream
broadcastConfig.setStreamName("conventionCoverage");

// Update the active config
this.goCoder.setConfig(broadcastConfig);


Using Configuration Presets

There are a number of preset configurations for commonly used frame sizes you can use to preconfigure the broadcast.

Preset identifier Video frame size Video bitrate
WZFrameSizePreset352x288 352x288 280 kbps
WZFrameSizePreset640x480 640x480 1.5 mbps
WZFrameSizePreset1280x720 (720p) 1280x720 3.75 mbps
WZFrameSizePreset1920x1080 (1080p) 1920x1080 5 mbps
WZFrameSizePreset3840x2160 (4k UHD) 3840x2160 8 mbps
Preset identifier Video frame size Video bitrate
WZMediaConfig.FRAME_SIZE_320x240 320x240 280 kbps
WZMediaConfig.FRAME_SIZE_640x480 640x480 1.5 mbps
WZMediaConfig.FRAME_SIZE_960x540 960x540 1.5 mbps
WZMediaConfig.FRAME_SIZE_1280x720 (720p) 1280x720 3.75 mbps
WZMediaConfig.FRAME_SIZE_1920x1080 (1080p) 1920x1080 5 mbps
WZMediaConfig.FRAME_SIZE_3840x2160 (4k UHD) 3840x2160 8 mbps
// Get a copy of the active config
WowzaConfig broadcastConfig = self.goCoder.config;

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

// Update the active config
self.goCoder.config = broadcastConfig;
// Update the active config to the defaults for 720p video
this.goCoder.setConfig(WZMediaConfig.FRAME_SIZE_1280x720);