Wowza Transcoder AddOn

This post is also available in: Russian

Wowza-Transcoder

Following our latest review of the features of Wowza Media Server, let’s now look at how to transcode video streams using this plugin. This feature is helpful when you only have a single source of high quality video and you would like to deliver the video to multiple devices. Yet another example is video stream failback to audio only in an iOS application (AppStore’s requirement), where you need an additional stream with cut-off video. A typical approach to this problem requires a transcoder (you can also generate an audio only stream using the new Adobe Media Server 5.0). Usually, a transcoder is a separate server optimized for video handling. Wowza offers an alternative: transcoding at the media server level. Let’s look at how it works in more detail.

Wowza Transcoder is a paid addon to the Wowza Media Server. It can transcode incoming video to H.264 (MPEG-4) streams tailored for different viewing devices. To run a transcoder, please install a 64-bit version of Java. Wowza Media Server supports the hardware transcoder technologies: Intel Quick Sync hardware acceleration and Nvidia CUDA hardware acceleration.

If the transcoder has been configured correctly, at launch the Wowza server will validate the hardware transcoder and yield the following message, for example:

1
INFO server comment - JNI:TranscoderSession.isCUDAAvailable[_defaultVHost_: transcoder/_definst_/live1]: NVidia CUDA hardware acceleration is NOT available INFO server comment - JNI:TranscoderSession.isQuickSyncAvailable[_defaultVHost_: transcoder/_definst_/live1]: Intel Quick Sync hardware acceleration is available, version:1.1

In this example, Wowza Media Server has found hardware support for the Intel Quick Sync technology.

How to Configure the "Transcoder" App
1. Create the "[install-dir]\conf\transcoder" directory.
2. Copy the "Application.xml" basic configuration file from the "[install-dir]\conf" directory to "[install-dir]\conf\transcoder"
3. Create a "transcoder" directory in the "[install-dir]\applications" directory.
4. Make the following changes to the configuration file "[install-dir]\conf\transcoder\Application.xml", specifying the following parameters:

1
<StreamType>live-lowlatency</StreamType> <LiveStreamPacketizers>sanjosestreamingpacketizer</LiveStreamPacketizers> <LiveStreamTranscoder>transcoder</LiveStreamTranscoder> <Templates>${SourceStreamName}.xml,transrate.xml</Templates> <ProfileDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/profiles</ProfileDir>

5. Copy the basic transcoder configuration file "[install-dir]\transcoder\templates\transrate.xml" to the same directory with a new name, e.g. "live1.xml"
6. Make the following changes to the configuration file "[install-dir]\transcoder\templates\live1.xml", specifying the parameters of streams to be created. In this example, we create three streams:

  • Video source bit rate (1000) + audio source bit rate (48). The stream is not transcoded
  • video bit rate 750 + audio source bit rate 48
  • video bit rate 300 + audio source bit rate 48

After that, open preferences of Flash Media Live Encoder (FMLE) and specify the bitrate of the stream transmitted to the Wowza Media Server. In our example, the server will receive a stream with bit rate 1000. Streaming has to be configured to the "transcoder" application.

To view the stream, we will use OSMF Media Player. It has been built on OSMF open framework. Specify the address of the manifesto for the group live1_all (the group name is specified in the transcoder configuration file "[install-dir]\transcoder\templates\live1.xml"): "http://127.0.0.1:1935/transcoder/ngrp:live1_all/manifest.f4m"
Having received a stream from FMLE, the Wowza server takes its time to prepare a manifest. After the manifest has been created, you can view it by pointing your browser to URL: "http://127.0.0.1:1935/transcoder/ngrp:live1_all/manifest.f4m"

Benchmarking

Performance benchmarking with Wowza Transcoder AddOn. The benchmarking is conducted to compare performance of the two systems, with and without a hardware transcoder.

Two systems are involved in the process:
1. A system based on a low-end CPU Intel Core i3-2120 Sandy Bridge (CPU 3.30GHz, 4GB of RAM, Windows 7 Home x64, GPU Intel HD Graphics 200). This system supports the Intel Quick Sync hardware acceleration.
2. A system based on 2x server processors Intel Xeon E5620 Westmere (CPU 2.40 GHz, 8 GB of RAM, Ubuntu 10.04.4 LTS). This system offers no support for hardware transcoder.

The test has been run with a pre-configured transcoder. As a result, the transcoder creates three streams:

  • Video source bit rate (1000) + audio source bit rate (48). The stream is not transcoded
  • video bit rate 750 + audio source bit rate 48
  • video bit rate 300 + audio source bit rate 48

Besides, the transcoder puts the Wowza logo in a corner of the video picture (the logo is located in the directory "[install-dir]\content"). To determine the CPU utilization, we’ll use JConsole. This application has been described in our previous post on Wowza.

Benchmarking Results

Low-end processor and Intel Quick Sync hardware acceleration : wowza-transcoding-a The graphs show resource utilization in a system with an Intel Core i3-2120 CPU with the transcoder running. The load has been slightly growing in times of garbage collection by the JVM (Garbage Collector) to 12%. But the average CPU utilization was 9%.

Dual processor server: Wowza-transcoding The graphs show resource utilization in a system based on Intel Xeon E5620 at the time of running the transcoder. The load has been growing up a little at times of garbage collection by the JVM Garbage Collector (to 12%). However, the average CPU utilization was 7%.

As a result of the test, the following tentative conclusions might be made:

  • Memory utilization in the two systems differed slightly, with a more frequent garbage collection on Linux using JVM (Garbage Collector) Peak RAM utilization was identical and amounted to about 170MB
  • A system with a low-end Intel Core i3-2120 CPU with its integrated graphics core turned out a success in transcoding, however slightly losing in performance (yet by just 2%) to the system with a more powerful Intel Xeon E5620 server CPUs without a graphic kernel

To increase the load, we tried to feed Wowza with two streams having the same transcoding settings, and got the following results.

A low-end CPU with Intel Quick Sync hardware acceleration: Wowza-transcoding-???-????????? The graphs show resource utilization in a transcoder system with an Intel Core i3-2120 handling one or two inbound video streams. The CPU load at transcoding of 2 streams, linearly increased and averaged to 36%.

Dual processor server: Wowza-transcoding-1-2-bThe graphs show resource utilization in a transcoder system based on Intel Xeon E5620 processors and processing one or two incoming video streams. With transcoding of 2 streams, the CPU load has linearly increased, averaging to 36%.

As a result of the test, the following tentative conclusions might be made:

  • Dynamics of RAM utilization on both systems differed but slightly, with a peak at 250 – 300 MB;
  • A system with a low-end Intel Core i3-2120 CPU has shown 6% less average performance compared to a back-end Intel Xeon E5620 CPUs . A possible reason behind widening of the gap is a weak video core used by Wowza for transcoding purposes
  • Both systems showed a nonlinear increase in CPU utilization at dual stream transcoding
  • So care should be taken when running benchmark tests on a model, as the risk of instability is pretty high

In conclusion, I would like to add that Java-based transcoding is quite eccentric. 🙂 However, as it has been shown above, it is quite viable, allowing you to enable cost-efficient transcoding of live video streams. In our projects however, we use industry grade transcoders or open source alternatives run on dedicated servers (ffmpeg, avconv or VLC).

Leave a Reply