<!--
{
  "documentType" : "article",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/cmtag-api",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CMTag"
}
-->

# CMTag

Types and interfaces for working with Core Media tags.

## Topics

### Creating Tags

[`extern CMTag CMTagMakeFromDictionary(CFDictionaryRef dict);`](/documentation/CoreMedia/CMTagMakeFromDictionary)

Create a new tag from a dictionary object.

[`extern CMTag CMTagMakeWithFlagsValue(CMTagCategory category, uint64_t flagsForTag);`](/documentation/CoreMedia/CMTagMakeWithFlagsValue)

Creates a new tag with a given category and a value interpreted as a 64-bit flag field.

[`extern CMTag CMTagMakeWithFloat64Value(CMTagCategory category, Float64 value);`](/documentation/CoreMedia/CMTagMakeWithFloat64Value)

Creates a new tag with a given category and a 64-bit floating point value.

[`extern CMTag CMTagMakeWithOSTypeValue(CMTagCategory category, OSType value);`](/documentation/CoreMedia/CMTagMakeWithOSTypeValue)

Creates a new tag with a given category and a 64-bit value for use by the framework.

[`extern CMTag CMTagMakeWithSInt64Value(CMTagCategory category, int64_t value);`](/documentation/CoreMedia/CMTagMakeWithSInt64Value)

Creates a new tag with a given category and a 64-bit signed integer.

### Tag Categories

[`enum CMTagCategory : FourCharCode;`](/documentation/CoreMedia/CMTagCategory)

A 64-bit representation of a tag’s category.

### Tag Data Types

[`enum CMTagDataType : uint32_t;`](/documentation/CoreMedia/CMTagDataType)

The data type of a tag’s value.

### Inspecting Tags

[`extern CFStringRefCMTagCopyDescription(CFAllocatorRef allocator, CMTag tag);`](/documentation/CoreMedia/CMTagCopyDescription)

Copies the description of a tag to a new string.

[`static Boolean CMTagIsValid(CMTag tag);`](/documentation/CoreMedia/CMTagIsValid)

Whether the provided tag is valid.

[`static CMTagCategory CMTagGetCategory(CMTag tag);`](/documentation/CoreMedia/CMTagGetCategory)

Retrieves the category of a tag.

[`extern CMTagDataType CMTagGetValueDataType(CMTag tag);`](/documentation/CoreMedia/CMTagGetValueDataType)

Retrieves the data type of a tag.

[`static Boolean CMTagHasCategory(CMTag tag, CMTagCategory category);`](/documentation/CoreMedia/CMTagHasCategory)

Checks if a tag contains a specific category.

[`extern Boolean CMTagHasFlagsValue(CMTag tag);`](/documentation/CoreMedia/CMTagHasFlagsValue)

Whether a given tag contains a value for a 64-bit flag field.

[`extern Boolean CMTagHasFloat64Value(CMTag tag);`](/documentation/CoreMedia/CMTagHasFloat64Value)

Whether a given tag contains a value for a 64-bit floating point number.

[`extern Boolean CMTagHasOSTypeValue(CMTag tag);`](/documentation/CoreMedia/CMTagHasOSTypeValue)

Whether a given tag contains a value for use by the operating system.

[`extern Boolean CMTagHasSInt64Value(CMTag tag);`](/documentation/CoreMedia/CMTagHasSInt64Value)

Whether a given tag contains a value for a signed 64-bit integer.

### Retrieving Tag Values

[`extern CFDictionaryRefCMTagCopyAsDictionary(CMTag tag, CFAllocatorRef allocator);`](/documentation/CoreMedia/CMTagCopyAsDictionary)

Copies an existing tag to a new dictionary object.

[`extern uint64_t CMTagGetFlagsValue(CMTag tag);`](/documentation/CoreMedia/CMTagGetFlagsValue)

Retrieves a tag’s value as a 64-bit field flag.

[`extern Float64 CMTagGetFloat64Value(CMTag tag);`](/documentation/CoreMedia/CMTagGetFloat64Value)

Retrieves a tag’s value as a 64-bit floating point number.

[`extern OSType CMTagGetOSTypeValue(CMTag tag);`](/documentation/CoreMedia/CMTagGetOSTypeValue)

Retrieves a tag’s value for use by the operating system.

[`extern int64_t CMTagGetSInt64Value(CMTag tag);`](/documentation/CoreMedia/CMTagGetSInt64Value)

Retrieves a tag’s value as a signed 64-bit integer.

[`static CMTagValue CMTagGetValue(CMTag tag);`](/documentation/CoreMedia/CMTagGetValue)

Retrieves a tag’s value as an uninterpreted 64-bit wide unsigned integer.

### Comparison and Equality

[`extern Boolean CMTagEqualToTag(CMTag tag1, CMTag tag2);`](/documentation/CoreMedia/CMTagEqualToTag)

Compares two tags for strict equality.

[`extern CFComparisonResult CMTagCompare(CMTag tag1, CMTag tag2);`](/documentation/CoreMedia/CMTagCompare)

Compares two tags in terms of partial equality.

[`static Boolean CMTagCategoryEqualToTagCategory(CMTag tag1, CMTag tag2);`](/documentation/CoreMedia/CMTagCategoryEqualToTagCategory)

Compares two tags’s categories for equality.

[`static Boolean CMTagCategoryValueEqualToValue(CMTag tag1, CMTag tag2);`](/documentation/CoreMedia/CMTagCategoryValueEqualToValue)

Compares two tags’s values for equality.

[`extern CFHashCode CMTagHash(CMTag tag);`](/documentation/CoreMedia/CMTagHash)

Generates a hash identifier for a tag.

### Types

[`struct CMTag;`](/documentation/CoreMedia/CMTag-c.struct)

A tag representing additional metadata on tagged media buffers.

[`class CMTag`](/documentation/CoreMedia/CMTag-swift.class)

A tag to set additional metadata on media buffers.

[`typedef uint64_t CMTagValue;`](/documentation/CoreMedia/CMTagValue)

The type used to represent tag values.

### Constants

[`extern CFStringRef const kCMTagCategoryKey;`](/documentation/CoreMedia/kCMTagCategoryKey)

A constant for use as a key during tag creation from a dictionary, whose value is the tag’s category.

[`extern CFStringRef const kCMTagDataTypeKey;`](/documentation/CoreMedia/kCMTagDataTypeKey)

A constant for use as a key during tag creation from a dictionary, whose value is the tag’s data type.

[`extern CFStringRef const kCMTagValueKey;`](/documentation/CoreMedia/kCMTagValueKey)

A constant for use as a key during tag creation from a dictionary, whose value is the tag’s contained value.

[`extern const CMTag kCMTagInvalid;`](/documentation/CoreMedia/kCMTagInvalid)

A constant representing an invalid tag.

[Tag Values](/documentation/CoreMedia/tag-values)

### Errors

[`enum CMTagError : OSStatus;`](/documentation/CoreMedia/CMTagError)

Core media tagging errors reported by the framework.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)