Help me understand CMTime in AVAssetWriter
I'm having a hard time understanding how to convert a stream of motion JPEG at 30fps using the AVAssetWriter to a video file. The part I'm not getting is the [adaptor appendPixelBuffer:buffer withPresentationTimeresentTime] method. How do I calculate the withPresentationTime value if I want to output 30fps mpeg4 video? The video source is a camera that streams 30fps motion JPEG in real time. Appreciate any idea. Thanks Steve McFarlin You will need to generate a CMTime structure using CMTimeMake. You will need to increment the time by 1/30 of a second for each frame. Here is a sketch: CMTime