How Does SMIL Handle External Streaming with RTSP and RTP?

Synchronized Multimedia Integration Language (SMIL) manages external media streams like RTSP and RTP by acting as a temporal and spatial orchestration layer rather than handling the raw network transport itself. Through standard XML elements, SMIL references external streaming endpoints via uniform resource identifiers (URIs), coordinates real-time synchronization across independent media tracks, and delegates lower-level transport and session controls to the underlying media player engine.

The Role of SMIL in Media Streaming

SMIL is an XML-based markup language designed by the World Wide Web Consortium (W3C) to choreograph diverse media types—such as video, audio, text, and images—into a unified presentation. SMIL does not define codecs, transport protocols, or packet transmission logic. Instead, it serves as the presentation manifest that instructs a client player when, where, and for how long specific media streams should play.

When external streaming protocols are involved, SMIL establishes the playback schedule and spatial layout, leaving the actual packet negotiation, buffering, and decoding to specialized streaming protocols.

Referencing RTSP and RTP Endpoints

SMIL references streaming assets using the src attribute inside core media tags such as <video>, <audio>, or generic <ref> elements.

To initiate a stream over the Real-Time Streaming Protocol (RTSP), the URI scheme is directly declared within the element:

<smil>
  <head>
    <layout>
      <root-layout width="640" height="480" />
      <region id="video_region" left="0" top="0" width="640" height="480" />
    </layout>
  </head>
  <body>
    <video src="rtsp://streaming.example.com:554/live/stream1.sdp" region="video_region" begin="0s" dur="60s" />
  </body>
</smil>

When the SMIL player encounters an rtsp:// URI, it initializes an RTSP client session to communicate with the target media server.

Protocol Division of Labor

SMIL, RTSP, and RTP operate across distinct layers of the media delivery architecture:

Handling Synchronization and Timing

A core strength of SMIL is synchronizing multiple streams inside <par> (parallel) and <seq> (sequential) containers.

When coordinating live or on-demand streams:

  1. Master vs. Slave Timing: SMIL allows authoring rules such as syncMaster="true", ensuring that subsidiary elements (like synchronized subtitles or secondary audio) follow the clock of the primary RTSP stream.
  2. Buffering Latency: Because network streams over RTP/RTSP experience variable latency, the SMIL engine relies on the media client's internal buffers before triggering the SMIL timeline.
  3. Session Termination: When a SMIL container ends or transitions to the next sequential element, the engine triggers an RTSP TEARDOWN request to free streaming server resources.

Dynamic Stream Adaptation

SMIL supports basic network condition and feature adaptation using the <switch> element. Authors can define alternative RTSP streams based on the client's available bandwidth, system language, or screen dimensions:

<switch>
  <video src="rtsp://streaming.example.com/stream_high.sdp" systemBitrate="1500000" />
  <video src="rtsp://streaming.example.com/stream_low.sdp" systemBitrate="300000" />
</switch>

The SMIL engine evaluates these attributes at runtime and opens an RTSP session only for the candidate stream that best matches the client environment.