writeToFile
fails to save 4K video with 50 min recording in document directory
BOOL videoSuccess = [[NSData dataWithContentsOfURL:videoURL] writeToFile:videoPath atomically:YES];
So videoSuccess returns false
Video Url:
file:///private/var/mobile/Containers/Data/Application/5C6C1826-B1B9-4F8C-BEFA-8842166B38CC/tmp/output.mov
Video Path:
/var/mobile/Containers/Data/Application/5C6C1826-B1B9-4F8C-BEFA-8842166B38CC/Documents/20180808160025.mp4
Got solution:
Use moveItemAtPath
instead of writeToFile
or copyItemAtPath
[[NSFileManager defaultManager] moveItemAtPath:videoURL toPath:videoPath error:&error];