Tuesday 15 July 2014

ios - GPUImage Video Recording -


I am trying to use the GPUImage library to record video from the camera, save it in filter and camera roll I am / P>

GPUImageMovieWriter is causing me some problems here. My code is:

  // Set GPUImageVideoCamera VideoKamra = GPUImageVideoCamera (SessionPreset: AVCaptureSessionPreset640x480, CameraPosition: Back) videoCamera.outputImageOrientation = .Portrait; VideoCamera.horizontallyMirrorFrontFacingCamera = True Video Camera.horizontallyMirrorRearFacingCamera = false // Create filter with visual filter = GPUImageFilter () filterView = GPUImageView (frame: self.view.frame) filterView.fillMode = kGPUImageFillModePreserveAspectRatioAndFill; Self.view.addSubview (filterView) pathToMovie = NSHome directory (). StringByAppendingPathComponent ("stream.mp4") Unlink (pathToMovie as NSString) .UTF8String) var movieURL = NSURL.fileURLWithPath (pathToMovie) movieWriter = GPUImageMovieWriter (movieURL: movieURL, Size: CGSizeMake (640, 480)) movieWriter.encodingLiveVideo = True // Attach targets VideoCamera.addTarget (filter) filter.addTarget (filterView) filter.addTarget (movieWriter) // Capture Video Camera Start. Camera Capture () movieWriter.startRecording () < 

[AVAssetWriter startWriting] When the situation is 3, then the method can not call / P>

Why is this going to happen? Why is the status of AVAssetWriter going? Is that fixed?

Note that all the variables are the qualities of my class.

get the same error It seems that movieURL is incorrectly created Occurs when the changed code is set for

  movie URL = NSURL.fileURLPath (NSHomeDirectory ()) .URLByAppendingPathComponent ("stream.mp4")! Unlink (movieURL.path!)  

No comments:

Post a Comment