Wowza Streaming Engine essentials for media site

2019-11-01 17:41:00

In this article, we will consider the basic principles of using the Wowza Streaming Engine to build a media portal. In order not to complicate the understanding, we will not address the issues of billing and monetization of the service, as well as deeply analyze the technical side.

Below is the general scheme of the media portal, as well as the processing of a user request to view a stream or video clip. As you can see, the Wowza Streaming Engine media server is only an executive mechanism, providing the transmission of video and audio data to end-user devices, and not the central part of the portal responsible for the logic of user interaction. Wowza Streaming Engine does not work under the control of a website engine or database server and does not provide a user interface. However, it is he who makes it possible to solve the problem of delivering streaming video content to user client devices

Many people have the impression that the media server software should provide a complete list of tools for creating a portal, including the end user interface, business logic, and video content management CMS. But this is not so, and for the different parts of the portal are responsible for the individual components, which, however, integrate perfectly with each other. So, what the Wowza Streaming Engine does not provide:

  • Receiving the original video signal directly from the capture card, HDMI, SDI or USB port
  • Web site interface for the end user.
  • Storage of descriptions and metadata of media content. (CMS)
  • Database Server.
  • Passing links to view content directly to the end user.
  • Media player interface for playing material and / or saving it to a local disk.
  • Providing monetization and billing tools.

The Wowza Streaming Engine media server is designed to perform the following:

  • Receive IP streams in various formats (RTPM, SRT, RTP / RTSP, MPEG TS UDP Multicast / Unicast, Shoutcast / ICY, HLS are supported).
  • Access to VOD files (mp4, mp3, flv, ism containers are supported).
  • Transcoding of incoming IP streams to get a set of streams in various bitrates and resolutions.
  • Transmux a stream to a format for streaming Live and VOD content suitable for delivery to subscriber devices.
  • Protecting content from unauthorized viewing (by built-in Wowza tools or integration with third-party DRM / CAS systems).
  • Providing a redundant and fault-tolerant system for distributing media content.

Let’s take a closer look at how data is processed on the Wowza server.

For example, let’s focus on one of the most common scenarios, with the original UDP Multicast SPTS stream with MPEG-2 compression. Such an initial stream for broadcasting on the Internet is not unique. Firstly, a high bitrate, and secondly, UDP cannot be transmitted through external networks without loss and often providers completely block the transmission of UDP packets, and thirdly, the stream encoded by the MPEG2 video codec cannot be played by the player on a web page or mobile device. All these parameters of the source stream can be converted by the Wowza server, and you can also create several additional Live-streams with lower quality parameters. This will help transfer content over narrow channels of communication (including with variable bandwidth).

Transcoding and transmuxing the stream format using the Wowza Streaming Engine:

  • Wowza supports transmuxing from one streaming video format to another, for all streaming media protocols, which provides the ability to play the stream with any web player or device
  • Transcoding of any stream is performed only 1 time, and not for each data transfer protocol separately
  • Stream on-the-fly transcoding can be performed using either processor power or GPU-based, which frees up CPU power for other tasks.

You can learn more about transcoding in Wowza by clicking on this link.

Record of stream and view video files

Wowza Streaming Engine allows you to record a live stream to an MP4 file, which you can later view directly from the Wowza server or copy for editing, sharing, archiving, etc. It supports recording with automatic generation of fragments in time and recording of the transcoded stream, in several qualities at once. Viewing VOD content (MP4 video files) on the Internet directly from Wowza using the video streaming protocol (streaming) has many advantages compared to viewing with placing a file on a regular web server using conventional downloading and progressive downloading methods. First of all, this is control over network resources, since each user in this case cannot consume network resources more than the file encoding bitrate. This eliminates peaks in the consumption of network resources characteristic of downloading files from a regular web server. The security of the content from unauthorized downloading is much higher, since the file cannot be downloaded to the entire viewing device. Significantly improves the user viewing convenience, so VOD content can be given in the form of a multi-bitrate stream (ABR). In this case, the player or the viewing device automatically selects the correct bitrate for playback in accordance with the current network connection conditions. Wowza will also allow, if necessary, to add subtitles and several language tracks with translation. There is support for working with a network drive S3, Azure, etc.

Protection against unauthorized viewing

In many cases, the media content of the site should be available for viewing only for authorized users. Access to media content is carried out through a link to a resource running the Wowza Streaming Engine and a simple copy of this link should, at a minimum, not lead to anyone who wants to view the live stream or vod video file. Wowza provides several ways to protect content, namely:

  • Referer validate is a simple method of restricting the ability to view the stream, only in the player located on the page of the site with a resolved domain name.
  • SecureToken - a more complex technique based on the generation of session browsing keys (tokens). For each viewing request, a unique link is generated with a given lifetime and, sometimes, taking into account the user's IP. Token generation on the web server side should be carried out only for authorized users of the site.
  • AES traffic encryption is an even more complicated technique, requiring the creation of additional software components (a key exchange server), but it also provides a differentiation of user rights to access a particular stream at the Wowza server level and end-to-end traffic encryption with a reliable cryptographic algorithm.
  • DRM is the most reliable method requiring the use of services of third-party service providers of DRM systems. Allows you to post content created by movie studios on the site that require a certified security system.

You can find out the technical details of the implementation of a particular content protection method in our article.

Load Scaling and Redundancy.

The Wowza Streaming Engine license has no restrictions on the number of streams and users viewing the stream. The maximum number of viewers is determined by the server hardware resources, resolution/bitrate of stream encoding, and, first of all, network bandwidth (server network card and Internet connection port). Since almost always broadcasting on the Internet is based on the unicast principle, the number of viewers supported by the server can be calculated using a simple formula:

Bit rate * maximum number of viewers at the same time <80% of network bandwidth (the lower of the network card or Internet port).

Bitrate values for typical stream resolutions:

Stream resolution Stream bitrate
8K 21 – 50 Mbps
4K 13 – 34 Mbps
1080p 3 – 6 Mbps
720p 1.5 – 4 Mbps
420p 0.5 – 2 Mbps
360p 0.4 – 1 Mbps

If the task is to build a scalable system that is designed for a huge number of simultaneous views, then there are two possible approaches: create your own streaming infrastructure or use third-party content delivery services - CDN (including social networks YouTube, VK, etc. as a CDN):

A component of the Wowza Streaming Engine is a special module - Wowza Dynamic Load Balancing AddOn, which allows you to create your own content delivery infrastructure - in fact, a private CDN network. Consider creating your own infrastructure in order to understand how several Wowza servers can work as a single solution.

The figure above shows the general scheme of the system during load balancing. Groups of subscriber devices are conditionally divided and are not rigidly tied by their type to a specific server. Initially, a request for a stream is sent to Edge with the Wowza Dynamic Load Balancing AddOn, regardless of where the content consumer is located or what viewing device it has. Wowza Dynamic Load Balancing AddOn accepts the request, analyzes and determines through which Edge server the user will receive the stream for viewing. Thanks to this approach, the system can be scaled horizontally by simply adding Edge servers. Additionally, system redundancy is provided - in the event of a failure of one of the Edge servers, all users are redirected to others.You can learn more about Wowza Dynamic Load Balancing AddOn here.