|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||AVFoundation||MBS AVFoundation Plugin||13.2||Yes||No||No||Yes, macOS only||No|
dim t as new CMTimeMBS(1200, 600)
A CMTime is represented as a rational number, with a numerator (an int64 value), and a denominator (an int32 timescale). Conceptually, the timescale specifies the fraction of a second each unit in the numerator occupies. Thus if the timescale is 4, each unit represents a quarter of a second; if the timescale is 10, each unit represents a tenth of a second, and so on. In addition to a simple time value, a CMTime can represent non-numeric values: +infinity, -infinity, and indefinite. Using a flag CMTime indicates whether the time been rounded at some point.
CMTimes contain an epoch number, which is usually set to 0, but can be used to distinguish unrelated timelines: for example, it could be incremented each time through a presentation loop, to differentiate between time N in loop 0 from time N in loop 1.
Additional functions for managing dates and times are described in Time Utilities Reference. Note that CMTime is designed for media timelines whereas functions in Time Utilities Reference are designed for working with wall-clock time in Core Foundation framework; see also AV Foundation Constants Reference.
- 12 properties
- property Epoch as Int64
- property Flags as Integer
- property HasBeenRounded as Boolean
- property IsIndefinite as Boolean
- property IsInvalid as Boolean
- property IsNegativeInfinity as Boolean
- property IsNumeric as Boolean
- property IsPositiveInfinity as Boolean
- property IsValid as Boolean
- property Seconds as Double
- property Timescale as Integer
- property Value as Int64
- 10 methods
- method AbsoluteValue as CMTimeMBS
- method Add(other as CMTimeMBS) as CMTimeMBS
- method Compare(other as CMTimeMBS) as Integer
- method Constructor(Value as Int64, Timescale as Integer, Flags as Integer = 1, Epoch as Int64 = 0)
- method ConvertScale(newTimescale as Integer, RoundingMethod as Integer = 1) as CMTimeMBS
- method Description as string
- method Multiply(multiplier as Integer) as CMTimeMBS
- method MultiplyByFloat(multiplier as Double) as CMTimeMBS
- method Show
- method Subtract(other as CMTimeMBS) as CMTimeMBS
- 10 shared methods
- shared method kCMTimeIndefinite as CMTimeMBS
- shared method kCMTimeInvalid as CMTimeMBS
- shared method kCMTimeNegativeInfinity as CMTimeMBS
- shared method kCMTimePositiveInfinity as CMTimeMBS
- shared method kCMTimeZero as CMTimeMBS
- shared method Make(value as Int64, timescale as Integer) as CMTimeMBS
- shared method MakeWithEpoch(value as Int64, timescale as Integer, Epoch as Int64) as CMTimeMBS
- shared method MakeWithSeconds(seconds as Double, preferredTimeScale as Int32 = 600) as CMTimeMBS
- shared method Maximum(t1 as CMTimeMBS, t2 as CMTimeMBS) as CMTimeMBS
- shared method Minimum(t1 as CMTimeMBS, t2 as CMTimeMBS) as CMTimeMBS
- 14 constants
- const kCMTimeMaxTimescale = &h7fffffff
Indicates that the time has been rounded.
Indicates that the time is +infinity, -infinity, or indefinite.
Use this value with bitwiseAnd on the flags.
Indicates that the time is indefinite.
Indicates that the time is -infinity.
Indicates that the time is +infinity.
Indicates that the time is valid.
Synonym for kCMTimeRoundingMethod_RoundHalfAwayFromZero.
Use kCMTimeRoundingMethod_RoundTowardZero if converting from larger to smaller scale (that is, from more precision to less precision), but use kCMTimeRoundingMethod_RoundAwayFromZero if converting from smaller to larger scale (i.e. from less precision to more precision).
Also, never round a negative number down to 0; always return the smallest magnitude negative CMTime in this case (-1/newTimescale).
Round away from zero if abs(fraction) is > 0.
Round towards zero if abs(fraction) is < 0.5, away from 0 if abs(fraction) is >= 0.5.
Round towards -infinity if fraction is not 0.
Round towards +infinity if fraction is not 0.
Round towards zero if fraction is not 0.
This class has no sub classes.
Some methods using this class:
- AVAssetImageGeneratorMBS.CGImageAtTime(time as CMTimeMBS, byref actualTime as CMTimeMBS, byref error as NSErrorMBS) as Variant
- AVAssetImageGeneratorMBS.generateCGImagesAsynchronouslyForTimes(times() as CMTimeMBS, tag as Variant = nil)
- AVAssetMBS.duration as CMTimeMBS
- AVAssetTrackMBS.samplePresentationTimeForTrackTime(trackTime as CMTimeMBS) as CMTimeMBS
- AVAssetTrackMBS.segmentForTrackTime(trackTime as CMTimeMBS) as AVAssetTrackSegmentMBS
- AVAssetWriterInputPixelBufferAdaptorMBS.appendPicture(pic as picture, presentationTime as CMTimeMBS) as boolean
- AVAssetWriterInputPixelBufferAdaptorMBS.appendPixelBuffer(pixelBuffer as CVPixelBufferMBS, presentationTime as CMTimeMBS) as boolean
- AVAssetWriterMBS.endSessionAtSourceTime(endTime as CMTimeMBS)
- AVAssetWriterMBS.movieFragmentInterval as CMTimeMBS
- AVAssetWriterMBS.startSessionAtSourceTime(startTime as CMTimeMBS)
- AVAudioMixInputParametersMBS.getVolumeRampForTime(time as CMTimeMBS, byref startVolume as Double, byref endVolume as Double, byref timeRange as CMTimeRangeMBS) as boolean
- AVCaptureFileOutputMBS.recordedDuration as CMTimeMBS
- AVFrameRateRangeMBS.maxFrameDuration as CMTimeMBS
- AVFrameRateRangeMBS.minFrameDuration as CMTimeMBS
- AVMutableAudioMixInputParametersMBS.setVolume(volume as Double, atTime as CMTimeMBS)
- AVMutableCompositionMBS.insert(asset as AVAssetMBS, startTime as CMTimeMBS, byref error as NSErrorMBS) as boolean
- AVMutableCompositionMBS.insertTimeRange(timeRange as CMTimeRangeMBS, asset as AVAssetMBS, startTime as CMTimeMBS, byref error as NSErrorMBS) as boolean
- AVMutableCompositionMBS.scaleTimeRange(timeRange as CMTimeRangeMBS, duration as CMTimeMBS)
- AVMutableCompositionTrackMBS.insertTimeRange(timeRange as CMTimeRangeMBS, AssetTrack as AVAssetTrackMBS, startTime as CMTimeMBS, byref error as NSErrorMBS) as boolean
- AVMutableCompositionTrackMBS.insertTimeRanges(timeRanges() as CMTimeRangeMBS, tracks() as AVAssetTrackMBS, startTime as CMTimeMBS, byref error as NSErrorMBS) as boolean
- AVMutableCompositionTrackMBS.scaleTimeRange(timeRange as CMTimeRangeMBS, duration as CMTimeMBS)
Some properties using for this class:
- AVAsynchronousVideoCompositionRequestMBS.compositionTime as CMTimeMBS
- AVCaptureConnectionMBS.videoMaxFrameDuration as CMTimeMBS
- AVCaptureConnectionMBS.videoMinFrameDuration as CMTimeMBS
- AVCaptureDeviceMBS.activeVideoMaxFrameDuration as CMTimeMBS
- AVCaptureDeviceMBS.activeVideoMinFrameDuration as CMTimeMBS
- AVMetadataItemMBS.duration as CMTimeMBS
- AVMetadataItemMBS.time as CMTimeMBS
- AVMutableMovieMBS.interleavingPeriod as CMTimeMBS
- AVMutableMovieMBS.preferredTransform as CMTimeMBS
- AVMutableMovieTrackMBS.preferredMediaChunkDuration as CMTimeMBS
- AVPlayerItemMBS.currentTime as CMTimeMBS
- AVPlayerItemMBS.duration as CMTimeMBS
- AVPlayerItemMBS.forwardPlaybackEndTime as CMTimeMBS
- AVPlayerItemMBS.reversePlaybackEndTime as CMTimeMBS
- AVPlayerMBS.currentTime as CMTimeMBS
- AVTimeCodeMBS.duration as CMTimeMBS
- AVTimeCodeMBS.presentationTimeStamp as CMTimeMBS
- CMSampleBufferMBS.DecodeTimeStamp as CMTimeMBS
- CMSampleBufferMBS.Duration as CMTimeMBS
- CMSampleBufferMBS.OutputDecodeTimeStamp as CMTimeMBS
- CMSampleBufferMBS.OutputDuration as CMTimeMBS
Some events for this class:
- AVFoundationMBS.generateCGImagesAsynchronouslyForTimesCompleted(generator as AVAssetImageGeneratorMBS, requestedTime as CMTimeMBS, image as Variant, actualTime as CMTimeMBS, result as Integer, error as NSErrorMBS, tag as Variant)
- AVFoundationMBS.legibleOutputDidOutputAttributedStrings(output as AVPlayerItemLegibleOutputMBS, strings() as Variant, nativeSamples() as CMSampleBufferMBS, itemTime as CMTimeMBS)
- AVFoundationMBS.PeriodicTimeObserver(Player as AVPlayerMBS, time as CMTimeMBS, tag as Variant)
- AVFoundationMBS.playerItemSeekToTimeFinished(player as AVPlayerItemMBS, time as CMTimeMBS, toleranceBefore as CMTimeMBS, toleranceAfter as CMTimeMBS, finished as boolean, tag as Variant)
- AVFoundationMBS.playerSeekToTimeFinished(player as AVPlayerMBS, time as CMTimeMBS, toleranceBefore as CMTimeMBS, toleranceAfter as CMTimeMBS, finished as boolean, tag as Variant)
Some examples which use this class:
- /AVFoundation/Generate Thumbnails
- /AVFoundation/Make Video From Images
- /AVFoundation/Make Video From Images with transparency
- /AVFoundation/Merge and Crop Videos
- /AVFoundation/Merge Audio and Video
- /AVFoundation/Overlay video track with picture
- /AVFoundation/Simple Player
- /AVFoundation/Thumbnail sync
- /AVFoundation/Transcode batch
- /AVFoundation/Transcode parallel
The items on this page are in the following plugins: MBS AVFoundation Plugin.
MBS Xojo tutorial videos