---
title: "CMFormatDescriptionGetMediaSubType(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmformatdescriptiongetmediasubtype(_:)"
---

# CMFormatDescriptionGetMediaSubType(_:)

Returns the media subtype of a format description.

## Declaration

```swift
func CMFormatDescriptionGetMediaSubType(_ desc: CMFormatDescription) -> FourCharCode
```

## Parameters

- `desc`: The CMFormatDescription to examine.

## Return Value

Return Value A media type that identifies the subtype of the CMFormatDescription.

## Discussion

Discussion For audio streams, the media subtype is the asbd.mFormatID. For video streams, the media subtype is the video codec type. For muxed streams, it’s the format of the muxed stream. For example, the function returns aac for a description of an AAC audio stream, avc1 for a description of an H.264 video stream, and mp2t for a description of an MPEG-2 transport (muxed) stream.  If a media stream doesn’t have subtypes, this API may return 0.

## See Also

### Inspecting Format Descriptions

- [CMFormatDescriptionGetMediaType(_:)](coremedia/cmformatdescriptiongetmediatype(_:).md)
- [CMFormatDescriptionGetExtension(_:extensionKey:)](coremedia/cmformatdescriptiongetextension(_:extensionkey:).md)
- [CMFormatDescriptionGetExtensions(_:)](coremedia/cmformatdescriptiongetextensions(_:).md)
- [CMFormatDescriptionGetTypeID()](coremedia/cmformatdescriptiongettypeid().md)
