Supported Media Formats, Protocols, and Log Fields

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This topic describes the formats and protocols supported by the MediaElement object. It also describes the MediaElement object's support for streaming and stream selection.

This topic contains the following sections.

  • Supported Codecs, Containers, and Delivery Methods
  • Supported Protocols
  • Supported Fields of Windows Media Server Logs
  • Digital Rights Management (DRM)
  • Related Topics

Supported Codecs, Containers, and Delivery Methods

The following section covers the supported codecs, containers, and delivery methods.

Supported Codecs

Below is a rollup list of formats codecs supported by the MediaElement. These encodings are supported regardless of the file name extension.

Video

  • Raw Video

  • RGBA format

    • Uncompressed 32 bit Alpha Red, Green, Blue.

    • On Windows Phone 7, the alpha channel is ignored.

  • YV12 format- YCrCb(4:2:0)

    • Uncompressed YCrCb(4:2:0).

    • Not supported on Windows Phone 7.

  • RGBA - 32 bit Alpha Red, Green, Blue

  • Windows Media Video and VC-1 formatsWMV1: Windows Media Video 7

    • Supports Simple, Main, and Advanced Profiles.

    • Supports only progressive (non-interlaced) content.

  • WMV2: Windows Media Video 8

  • WMV3: Windows Media Video 9

    • Supports Simple and Main Profiles.

    • Supports only progressive (non-interlaced) content.

  • WMVA: Windows Media Video Advanced Profile, non-VC-1

  • WVC1: Windows Media Video Advanced Profile, VC-1

    • Supports Advanced Profile.

    • Supports only progressive (non-interlaced) content.

  • H264 (ITU-T H.264 / ISO MPEG-4 AVC) formats

    • Supports H.264 and MP43 codecs.

    • Supports Base, Main, and High Profiles.

    • Windows Phone 7 supports up to Level 3.0.

      Note that level 3.0 defines the maximum supported resolution for 30fps as 720x480. Other frame rates have different maximum supported resolutions.

    • Supports only progressive (non-interlaced) content.

    • Supports only 4:2:0 chroma subsampling profiles.

    • Desktop Silverlight only supports the Annex B NAL format (i.e. start codes).

      Note, that media libraries, such as the SmoothStreamingMediaElement, support the AVC NAL format by programmatically converting AVC NALs to Annex B NALs. As Silverlight supports partial encryption of H.264 samples, this conversion can occur on encrypted content as well if the NAL headers are not encrypted. The Annex B NAL format is described in MPEG-4 Part 10.

    • Supports PlayReady DRM with Mp4 (H264 and AAC-LC)

  • H.263 format

    • Not supported by desktop versions of Silverlight.

    • Not supported by the MediaStreamSource class in Windows Phone 7.

  • MPEG-4 Part 2 format

    • Supports Simple and Advanced Profiles.

Audio

  • PCM / WAV format"1". This is Linear 8 or 16 bit Pulse Code Modulation. Roughly speaking, this is WAV format.

    • This is Linear 8 or 16 bit Pulse Code Modulation. Roughly speaking, this is WAV format.
  • Microsoft Windows Media Audio Standard formats."353" - Microsoft Windows Media Audio v7, v8 and v9.x Standard (WMA Standard)

  • Microsoft Windows Media Audio Professional formats."354" - Microsoft Windows Media Audio v9.x and v10 Professional (WMA Professional)

    • Supports full fidelity decoding of WMA 10 Professional Low Bit Rate (LBR) modes in the 32-96 kbps range.

    • Multichannel (5.1 and 7.1 surround) audio content is automatically mixed down to stereo.

    • 24 bit audio will return silence.

    • Sampling Rates beyond 48000 return an invalid format error code in same-domain and a 4001 in cross-domain scenarios.

  • MP3 "85" -– (ISO MPEG-1 Layer III) format (MP3).

  • AAC"255" - (ISO Advanced Audio Coding) (AAC)format.

    • Supports Low Complexity (AAC-LC) decoding at full fidelity (up to 48 kHz).

    • High Efficiency (HE-AAC) encoded content. will decode only at half fidelity (up to 24 kHz).

      1. HE-AAC v1 (AAC+) and HE-AAC v2 (eAAC+) supported.

      2. Desktop Silverlight will decode only at half fidelity (up to 24 kHz).

    • Multichannel (5.1 surround) audio content is not supported.

  • AMR-NB (Adaptive Multi-Rate Narrow Band) format

    1. Not supported by desktop versions of Silverlight.

    2. Not supported by the MediaStreamSource class.

Additional Restrictions

  • The following codec formats are not supported on any Silverlight platform:

    • Windows Media Screen

    • Windows Media Audio Professional Lossless

    • Windows Media Voice

  • Windows Phone 7 does not support dynamic changes in video frame size

Supported Containers

The following table lists the container formats that are natively supported by Silverlight. Note that items marked with an * are only supported on Silverlight for Windows Phone.

Container

Supported Codecs

MP3

MP3

ASF

Audio: WMA Standard and WMA Professional

Video: WMV and VC-1

MP4

Audio: AAC-LC, HE-AAC v1 (AAC+), HE-AAC v2 (eAAC+), MPEG-4 Part 2*

Video: H.264

3GP*, 3G2*

Audio: AAC-LC, HE-AAC v1 (AAC+), HE-AAC v2 (eAAC+), AMR-NR

Video: H.264, H.263

Important noteImportant Note:

Items marked with an * are only supported on Silverlight for Windows Phone

In most cases, the container format can be determined from the byte stream, regardless of the file name extension. XAPs can support non-native container formats via the MediaStreamSource class or via replacement MediaElement classes such as the SmoothStreamingMediaElement.

Supported Delivery Technologies

The following table lists the delivery technologies that are natively supported by Silverlight. Note that items marked with an * are not supported on Silverlight for Windows Phone.

Delivery Technology

Supported Containers

Progressive Download

ASF (WMV/WMA), MP4, MP3

Windows Media Streaming over HTTP*

ASF, MP4, ASX

SSPL (Server Side Play Lists)*

ASF, MP4, ASX

SSPL (Server Side Play Lists)*

ASF

Caution noteCaution:

Items marked with an * are not supported on Silverlight for Windows Phone

For more information on playlists, see the Server-Side Playlists topic and the Playlists section of this topic.

XAPs can support additional delivery technologies via the MediaStreamSource class or via replacement MediaElement classes such as the SmoothStreamingMediaElement.

For more information about the differences between streaming and progressive downloading, see Key Concepts in Windows Media Technologies topic. For more information on smooth streaming, see IIS Smooth Streaming.

Caution noteCaution:

For information specific to the use of media on Windows Phone, see Media in Silverlight for Windows Phone.

Supported Protocols

The following Web protocols/schemes are supported (see also URL Access Restrictions in Silverlight):

  • http

  • https

  • ms-wmsp

    The media Uniform Resource Identifier (URI) can specify an mms, rtsp, or ms-wmsp moniker. If the URI specifies the mms scheme, the MediaElement attempts to stream the file first. If the file cannot be streamed, it downloads the file progressively. If the media URI specifies another scheme, such as http or https, the MediaElement attempts a progressive download first. If that fails, the MediaElement attempts to stream the file. Note that live streaming media cannot be paused; calling the Pause method has no effect.

  • UNC (e.g. \\computer_name\share_location).

    Note that you cannot set MediaElement.Source = UNC. What you have to do instead is get a Stream open to the UNC and then use MediaElement.SetSource(stream) where stream is the stream opened from that UNC. Also note that you may experience performance issues if you attempt to play large files over a UNC because the entire file must be downloaded before playback can begin.

Playlists

A server-side playlist (SSPL), as it is available for Silverlight, is a sequence of media elements (either audio or video) that allows server administrators to control the sequence of streaming media viewed by the user as well as other behaviors. This playlist can be created statically or dynamically. A server-side playlist can be used to serve media for either on-demand or broadcast streams. For more information, see Server-Side Playlists.

MediaElement also supports playlists in the form of Advanced Stream Redirector (ASX) files, also known as Windows Media metafiles. Although the file name extension does not matter, these files typically have the .asx, .wax, .wvx, .wmx, or .wpl extension. For more information about these file types, see Windows Media Metafiles.

NoteNote:

The following features of ASX files are not supported in Silverlight.

ASX feature

Description

PreviewMode Attribute

This attribute is found on the root ASX object. It is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ATTRIBUTE.

BannerBar Attribute

This attribute is found on the root ASX object. It is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ATTRIBUTE.

SkipIfRef

This attribute is found on the root ENTRY object. It is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ATTRIBUTE.

REPEAT Element

This is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ELEMENT.

EVENT Element

This is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ELEMENT.

STARTMARKER Element

This is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ELEMENT.

ENDMARKER Element

This is not supported and will raise a MediaError with AG_E_ASX_UNSUPPORTED_ELEMENT.

Invalid content

If a valid ASX tag has content that is not accepted (for example, a MOREINFO tag contains a REF tag), a MediaFailed error is raised.

Fallback URLs

If an ENTRY tag has multiple REF children, only the first one is read. Unlike WMP, Silverlight will not attempt to open additional REF URLs in case the first one fails, and a MediaFailed error is raised.

For more information on ASX elements, see ASX Elements Reference.

Supported Fields of Windows Media Server Logs

A server administrator might want to get information about Silverlight client connections to their servers, particularly related to streaming media. This can be done by accessing logs on the server; however, the information in these logs is determined by what information the Silverlight client sends to the server. The following table shows the supported log fields reported by Silverlight.

NoteNote:

To learn more about server logs, see Logging Model for Windows Media Services on the Windows Media site.

Field name

By

When

Unit & length

Description

Sample value

c-ip

Server

Begin

IP Address

50 chars

The source IP address of the connected socket. This may end up being the IP of a proxy server or firewall.

157.100.200.300 (server)

Date

Server

Begin

Date

10 chars

The server’s date when the client connected to the stream. This is either in UTC or local time depending upon the plug-in configuration. Refer to the log file’s headers to determine if this value is based on UTC or local time.

1997-10-09 (server)

Time

Server

Begin

Time

8 chars

The server’s time when the client connected to the stream. This is either in UTC or local time depending upon the plug-in configuration.

15:30:30 (server)

cs-uri-stem

Client

Begin

URL path

4096 chars

The path to what the client requested. This is the requested URL without the schema, host, port number, or query string.

/test/sample.asf

x-duration

Client

End

Seconds

10 chars

Time (in seconds, no fractions) that the client has been rendering received data. Time buffering data is not included in this value.

31

c-status

Client

Dynamic

HTTP Result

8 chars

Codes that describe the client's status. Mapped to http/rtsp status codes. Silverlight should always return 200.

200

c-playerid

Client

Begin

GUID

38 chars

GUID for the client’s player. Silverlight always returns an anonymous GUID of the form {3300AD50-2C39-46c0-AE0A-xxxxxxxxxxxx}, where x is the server’s session id (refer to the s-sessionid field).

{3300AD50-2C39-46c0-AE0A-70B64F321A80}

c-playerversion

Client

Begin

String

64 chars

The player version number. Silverlight will always return the version of NetSource being used.

11.08.005.0000 or similar.

cs(User-Agent)

Client

Begin

String

256 chars

If the player was embedded in a browser, this field refers to the browser type that was used, appended by the version of NetSource used, and the version of Silverlight installed on the system.

Mozilla/4.0_(compatible;_MSIE_4.01;_Windows_98)_NSPlayer/6.4.1.2_Silverlight/1.0.20926.0

cs(Referer)

Client

Begin

URL

4096 chars

URL to the Web page that the player was embedded within (if the player was embedded).

https://www.contoso.com/default.htm

c-os

Client

Begin

String

64 chars

Client computer's operating system (for example, Windows 95, Windows NT/2000/XP, Apple Macintosh).

One of: Windows_2000, Windows_XP, Windows_Vista, MacOS.

filelength

Server

Begin

Seconds

10 chars

Length of the ASF file (in seconds) for on-demand and broadcast streams sourced from a file. For a live broadcast stream, this value is undefined and represented as zero (0).

60

filesize

Server

Begin

Bytes

10 chars

Size of the ASF file (in bytes) for on-demand and broadcast streams sourced from a file. For a live broadcast stream, this value is undefined and represented as zero (0).

86000

Avgbandwidth

Server

End

Bits per second

10 chars

Average bandwidth (in bits/sec) at which the client was connected to the server. This is the average across the entire duration of the connection.

102585

protocol

Server

Begin

String

16 chars

The protocol used to access the stream. Silverlight should always return http or https for this field, because it’s the only currently supported protocol.

http

transport

Server

Begin

String

16 chars

The transport used to deliver the stream, either UDP, TCP, or multicast. Silverlight should always return TCP.

TCP

sc-bytes

Server

End

Bytes

Total number of data bytes the server sent to the client. This does not include any TCP/IP or other overhead that is added by the network stack.

1188557

c-bytes

Client

End

Bytes

10 chars

Number of bytes received by the client from the server. This does not include any TCP/IP or other overhead that is added by the network stack.

28000

s-pkts-sent

Server

End

ASF Packets

10 chars

Number of packets sent by the server. This value represents the number of ASF data packets (not TCP or UDP packets).

55

c-quality

Client

End

Percent (%)

3 chars

The measure of how well the stream was received by the client (on a scale from 0 to 100%). This is reported by NetSource.

89

s-ip

Server

Begin

IP Address

35 chars

Upstream server IP address. This is the server that received the log.

155.12.1.234

s-dns

Server

Begin

DSN addr.

255 chars

Upstream server DNS. This is the server that received the log.

wmt.contoso.com

s-totalclients

Server

End

Connected clients

10 chars

Number of clients connected to the upstream server at the time of the logging event.

201

s-cpu-util

Server

End

Percentage

3 chars

CPU load on the upstream server (0-100%) at the time of the logging event.

40

cs-user-name

Server

Begin

String

256 chars

This is the user name that the client provides the server during authentication.

Empty

s-session-id

Server

Begin

Session

10 chars

This is an internal session ID that the server uses to track a given client session. This is important to track multiple log entries to the same session. Using the client GUID to track a session across multiple log entries is not manageable because it is possible to have multiple instances of a client running on a machine at one time (the GUID for each log entry may be identical).

123456

s-content-path

Server

Begin

URL

4096 chars

This is the actual content object that was streamed to the client. A plug-in may resolve a requested path to a path differently than what a client requested.

https://www.contoso.com/speech.wma

cs-url

Client

Begin

URL

4096 chars

The actual URL requested by the client.

mms://contoso.com/some/content.asf

cs-media-name

Client

End

String

256 chars

The name of the stream the client was playing, without the full path.

myVideoFile.wmv

s-proxied

Server

End

Boolean

1 char

Indicates whether the connection was made through a cache/proxy server or not. This value is 0 if there was no cache/proxy server involved. The value is 1 if a cache/proxy server was involved.

Even if a cache/proxy server downloads content into cache, this value will be 1 because a cache/proxy server was involved with the connection. This value is triggered by the existence of a "Via" protocol header. This enables HTTP based (non-streaming) proxy servers to be identified.

Note that any remote client log will have a 1 value for this field. However a client that has locally cached content may propagate the remote log directly to the origin server without passing through a cache/proxy server. In this case, the value will be 0.

0

Digital Rights Management (DRM)

Integrating Digital Rights Management into your Silverlight applications helps you to protect and securely deliver streaming or progressive download content for cross-platform playback. Silverlight 4 supports PlayReady protected WMA and WMV content via the MediaElement or MediaStreamSource classes and supports PlayReady protected H264 and AAC content via the MediaStreamSource class. Silverlight 4 also supports the use of existing WM-DRM content libraries with PlayReady license servers. For more information, see Digital Rights Management (DRM).