wowza and streaming. lesson 3.

id.241224001.173804

Lesson 3: Adaptive Bitrate Streaming with Wowza

Adaptive Bitrate Streaming (ABR) ensures that viewers experience optimal video quality based on their network conditions. This lesson explains how to configure and deliver ABR streams using Wowza Streaming Engine.


Step 1: What is Adaptive Bitrate Streaming?

ABR automatically switches between different quality levels of video streams depending on the viewer's bandwidth and device capabilities. Wowza supports ABR by transcoding a single input stream into multiple output streams at various bitrates.


Step 2: Enable Transcoding in Wowza

  1. Enable Transcoder AddOn:

    • Log in to Wowza Streaming Engine Manager.

    • Go to the Applications tab and select your application (e.g., LiveStreamApp).

    • Navigate to the Transcoder section.

    • Enable the Transcoder AddOn and click Save.

  2. Set Up Transcoder Templates:

    • Go to the Templates section under Transcoder.

    • Use a default template like transrate.xml or create a new one:

      • Default (e.g., transrate.xml):

        • Includes multiple output renditions (e.g., 1080p, 720p, 480p, 360p).
      • Custom:

        • Adjust the bitrates and resolutions according to your needs.

Step 3: Configure Encoder for Input Stream

Example with OBS Studio:

  1. Stream Setup:

    • In OBS, configure the stream as explained in Lesson 2.

    • Stream a high-resolution video (e.g., 1080p) to the application (e.g., LiveStreamApp).

  2. Start Streaming:

    • Begin streaming from OBS.

Step 4: Test Adaptive Playback

  1. Playback with HLS:

    • Open the HLS playlist URL in a browser or player like VLC:

        http://<your-server-ip>:1935/LiveStreamApp/_definst_/mystream/playlist.m3u8
      
  2. Verify Adaptation:

    • Simulate different bandwidths using tools or network throttling in browsers to observe quality adjustments.

Example:

Scenario:

You want to stream a live event with adaptive quality options: 1080p (high), 720p (medium), and 480p (low).

  1. Set Up Application:

    • Name: EventABRStreamApp

    • Input Stream: rtmp://192.168.1.100:1935/EventABRStreamApp

  2. Transcoder Template:

    • Modify transrate.xml:

        <Encodes>
          <Encode>
            <Name>1080p</Name>
            <Video>
              <Codec>H.264</Codec>
              <Bitrate>4000</Bitrate>
              <Width>1920</Width>
              <Height>1080</Height>
            </Video>
          </Encode>
          <Encode>
            <Name>720p</Name>
            <Video>
              <Codec>H.264</Codec>
              <Bitrate>2500</Bitrate>
              <Width>1280</Width>
              <Height>720</Height>
            </Video>
          </Encode>
          <Encode>
            <Name>480p</Name>
            <Video>
              <Codec>H.264</Codec>
              <Bitrate>1000</Bitrate>
              <Width>854</Width>
              <Height>480</Height>
            </Video>
          </Encode>
        </Encodes>
      
  3. Stream from OBS:

    • Configure OBS to stream at 1080p to rtmp://192.168.1.100:1935/EventABRStreamApp.
  4. Test Playback:

    • Open the HLS playlist:

        http://192.168.1.100:1935/EventABRStreamApp/_definst_/mystream/playlist.m3u8
      
    • Watch the stream adjust quality dynamically.


Step 5: Monitor Performance

  1. Check the Server Monitor:

    • Confirm that multiple renditions (1080p, 720p, 480p) are being streamed.
  2. Optimize Settings:

    • Ensure enough server resources (CPU, bandwidth) are available for transcoding.

Next Steps:

In the next lesson, we will explore DVR (Digital Video Recorder) features to enable pause, rewind, and resume functionality for live streams.