Open dhavalagile opened 7 years ago
What happens when you try to record? What errors do you get?
Using above code finishRecording successfully but when i check file the file contain only gray scale 0 sec video it don't process video .
Hello. I ran into the same problem and got it working with the following code changes.
Firstly, the problem was that while the MovieOutput instance needs to have its finishRecording() method called in order to close the file, calling .finishRecording() immediately after the asynchronous invocation of the MovieInput start method would result in the output being closed prior to the full data set being completed (hence the zero length file).
Also, there was no way to tell when that process chain had completed.
So, I added a completion callback as a parameter in the MovieInput start method.
MovieInput now invokes this callback when all input has been processed (or in case of failure, etc.).
The MovieOutput finishRecording() method can now be called at the correct time, e.g.:
let videoOutput = try EVGPUImage2.MovieOutput( URL: destinationUrl, size: movieSize )
let movieInput = try EVGPUImage2.MovieInput( url: videoUrl, playAtActualSpeed: false )
// let's test the chain by running a good old desaturation filter
let filter = EVGPUImage2.SaturationAdjustment()
filter.saturation = 0.1
// build the process chain
movieInput --> filter --> videoOutput
videoOutput.startRecording()
movieInput.start( completionCallback: {
videoOutput.finishRecording( completionCallback: {
cleanup()
})
})
Please find my diff for the MovieInput class attached. Thx!
The method does not render in sync
i am create videofilter demo, i am apply video filter sucessfully while video is play but i am unable to save video to local path.
let finalpath = "(FileManager.default.finalCompositions)/composition(getTimeStamp).mp4" let finalUrl = URL(fileURLWithPath: finalpath) print("Final url :: (finalUrl)")