Question

on assets from library i.e: assets-library://asset/asset.mov?id=0399CB6D-D3D9-4F4C-82B9-AC93CCE2FB16&ext=mov

[UIVideoEditorController canEditVideoAtPath:videoPath] returns always NO

i see this error in the console: <Warning>: Video assets-library://asset/asset.mov?id=0399CB6D-D3D9-4F4C-82B9-AC93CCE2FB16&ext=mov cannot be saved to the saved photos album: Error Domain=NSOSStatusErrorDomain Code=2 "This movie could not be played." UserInfo=0x6f7b90 {NSLocalizedDescription=This movie could not be played.}

help?

Was it helpful?

Solution

apparently there is no way to edit library assets with UIVideoEditController. i ended up copying the file using AVAssetWriter to the app sandbox and then i was able to use UIVideoEditController.

OTHER TIPS

I am able to write video tracks successfully.I am able to save that file to gallery as well.Video gets played with all the quality of original file .But not able to copy audio bufers and hence video gets played without sound.

But if I try to write audio track first and then video track then the writing fails for video buffers .That is BOOL appended = [assetWriterInput appendSampleBuffer:buffer]; fails by returning NO .

Buffers get appended while writing audio track.Then I cancel reader for audio track and start wrting reading video track.Appending the video buffers fails.For both writtes I am setting startSessionAtSourceTime:KCMTimeZero .

If I write only video buffers then video gets played without audio.

I want to make it possible to copy that .MOV file present inside gallery with all audio+video tracks inside it.

***Purpoose : Finally I want to edit the file copied using UIVideoEditorController.We can not directly edit file inside gallery.Hence I am first copying it inside sandbox and then editing it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top