Replacing ads

Applies To: Windows Server 2008, Windows Server 2008 R2

It is common for radio stations to broadcast their content over the radio and the Internet simultaneously (called simulcasting). Internet radio broadcasts enable regional radio stations to access a much wider audience at a low additional operating cost. However, certain problems may arise when local advertising content is broadcast over the Internet. Local advertising is often not suitable for a global audience, and therefore it is sometimes necessary to substitute Internet-specific ads for local advertisements. This task is made more difficult because of the need for it to be done in real-time.

The most effective advertisement replacement technique is to use a server-side playlist containing excl and priorityClass playlist elements in coordination with an encoder that has been configured to send a script command to the Windows Media server. This script command signals the start of the advertising segment. The signal is interpreted at the publishing point by the excl playlist element. If the script command value matches the begin attribute value of the excl element, the content in the excl element interrupts the live stream. The replacement advertising content is contained within a priorityClass element which has a peers attribute value of pause. When the replacement advertisement ends, the pause value causes playback to resume with the live stream.

This advertisement replacement strategy works best if the length of the local advertisement and the replacement advertising content match. Differences in the lengths of the two types of content can cause the server to return to the original content late or prematurely.

The key to successful advertisement replacement is seamless switching. The transition from one content source to another should occur quickly. Transition delays of more than two-tenths of a second can cause a late return to the live stream after a break. To reduce the delay, you can configure the encoder to send a cueing script command prior to the switching command. When the server receives the cueing command, it prebuffers data from the upcoming advertisement before the switch.

The following procedure demonstrates how to replace advertisements in a live stream.

To replace advertisements in a live stream

  1. Configure the encoder to transmit script commands that signal the start of an advertising break.

    • Based on the connection speed of your clients, determine the pre-buffering time necessary to transition smoothly to the replacement advertisement.

    • Configure the encoder to transmit a CUE_EVENT script command before the advertising break.

    • Configure the encoder to transmit a Fire_Event script command at the beginning of the advertising break.

  2. Create a playlist that alternates between primary and secondary digital media sources according to script commands received from the encoder.

    • Open the Windows Media Playlist Editor.

    • Click the smil element.

    • On the toolbar, click the Add Element arrow, and then click Exclusive.

    • An excl element is added to the playlist under the smil element.

    • Click the excl element.

    • On the toolbar, click the Add Element arrow, and then click PriorityClass.

    • A priorityClass element is added to the playlist under the excl element.

    • Click the priorityClass element, and then in peers, type pause.

    • On the toolbar, click Add Element.

    • The Add Media Elements dialog box opens.

    • Specify the name and location of the encoder. Repeat this step and specify the name and location of the alternate advertising source. Repeat this step again for any additional sources of advertising.

    • On the toolbar, click the Save playlist button.

    • Specify the name and location of the playlist file. The playlist file must use a .wsx file name extension.

  3. Create or edit a publishing point that uses the playlist you created in the previous section as its content source.

  4. Start the encoder and begin streaming your live broadcast. Check that the replacement advertisement transitions are smooth and timed correctly. If the player needs more pre-buffering time to avoid gaps and overlap, make the appropriate changes in the encoder configuration