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

# CMTimeMapping

A structure that maps a segment of a source time range to a target time range.

## Topics

### Creating Time Mappings

[`func CMTimeMappingMake(source: CMTimeRange, target: CMTimeRange) -> CMTimeMapping`](/documentation/CoreMedia/CMTimeMappingMake(source:target:))

Creates a time mapping with a source and target time range.

[`func CMTimeMappingMakeEmpty(target: CMTimeRange) -> CMTimeMapping`](/documentation/CoreMedia/CMTimeMappingMakeEmpty(target:))

Creates a valid time mapping with an empty source.

[`func CMTimeMappingMakeFromDictionary(CFDictionary) -> CMTimeMapping`](/documentation/CoreMedia/CMTimeMappingMakeFromDictionary(_:))

Creates a time mapping from a dictionary representation.

### Representing Time Mappings

[`func CMTimeMappingCopyAsDictionary(CMTimeMapping, allocator: CFAllocator?) -> CFDictionary?`](/documentation/CoreMedia/CMTimeMappingCopyAsDictionary(_:allocator:))

Returns a dictionary representation of a time mapping.

[`func CMTimeMappingCopyDescription(allocator: CFAllocator?, mapping: CMTimeMapping) -> CFString?`](/documentation/CoreMedia/CMTimeMappingCopyDescription(allocator:mapping:))

Copies a string description of a time mapping.

[`func CMTimeMappingShow(CMTimeMapping)`](/documentation/CoreMedia/CMTimeMappingShow(_:))

Prints a description of a time mapping to standard output.

### Data Types

[`struct CMTimeMapping`](/documentation/CoreMedia/CMTimeMapping)

A structure that maps a segment of a source time range to a target time range.

### Constants

[`static let invalid: CMTimeMapping`](/documentation/CoreMedia/CMTimeMapping/invalid)

An invalid time mapping.

[`let kCMTimeMappingSourceKey: CFString`](/documentation/CoreMedia/kCMTimeMappingSourceKey)

A dictionary key for a source time range.

[`let kCMTimeMappingTargetKey: CFString`](/documentation/CoreMedia/kCMTimeMappingTargetKey)

A dictionary key for a target time range.



---

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)