avfoundation

Playing an AVMutableComposition with AVPlayer audio gets out of sync

女生的网名这么多〃 提交于 2020-08-24 07:16:11
问题 I have an AVMutableComposition with 2 audio tracks and one video track. I'm using the composition to string about 40 different video clips from .mov files, putting the video content of each clip in the video track of my composition and the audio in the audio track. The second audio track I use for music. I also have a synchronized layer for titles graphics. When I play this composition using an AVPlayer, the audio slowly gets out of sync. It takes about 4 minutes to start becoming noticeable.

Starting video recording immediately with AVCaptureMovieFileOutput

孤街浪徒 提交于 2020-08-23 21:33:41
问题 I was trying to use AVCaptureMovieFileOutput to record the device camera to a video file when my app starts. To my great frustration, I could not get it to work: I could view the video feed using a AVCaptureVideoPreviewLayer just fine, so my session was wired up properly. The file to which it would output did not already exist, and was in a writable directory. No errors were returned from API calls or via AVCaptureSessionRuntimeError notifications. My AVCaptureFileOutputRecordingDelegate

iOS Delegate method not called in NSObject class

£可爱£侵袭症+ 提交于 2020-08-10 19:21:13
问题 I want to capture a picture from the camera with no preview. Though I am able to do that with a UIViewController with the help of AVFoundation framework. But now I have to do the same without the ViewController. #Issue When I trying to do the same with a NSObject class the AVCapturePhotoCaptureDelegate is not called. TestingCamera.h #import <AVFoundation/AVFoundation.h> NS_ASSUME_NONNULL_BEGIN @interface TestingCamera : NSObject <AVCapturePhotoCaptureDelegate> { AVCaptureSession

Failed to get video thumbnail from AVPlayer using Fairplay HLS

只愿长相守 提交于 2020-08-06 06:27:53
问题 I'm trying to build a custom progress bar for a video player app in tvOS, and would like to show thumbnails of the video while the user scans the video. I'm using AVPlayer and Fairplay HLS to play remote video files. I've tried to do this using 2 methods. One with AVAssetImageGenerator 's copyCGImage , and the other with AVPlayerItemVideoOutput 's copyPixelBuffer method. Both return nil. When I tried with a local video file, the first method worked. Method 1: let imageGenerator =

Does setting the AVPlayerItem after creating the AVPlayer increase efficiency in iOS 13?

删除回忆录丶 提交于 2020-06-29 04:45:34
问题 In a WWDC 2016 video, Apple says create the AVPlayer without an AVPlayerItem, create the AVPlayerLayer, and then assign the AVPlayerItem to the AVPlayer. I got the above code from @matt's Programming iOS 10 book. In it he says: Apparently there is some sort of efficiency if you do things in this order. The reason, it turns out, is that when an AVPlayerItem is assigned to an AVPlayer that doesn't have and associated AVPlayerLayer, the AVPlayer assumes that only the audio track of the AVAssest