Ask Your Question

Revision history [back]

When you run your app, all file locations are with respect to the app bundle and not your computer's file system. The way you are passing the video name is with respect to your computer's file system which is not the same as your app's file system. You need to first find the location of the video in your app's file system, then pass it as a NSString to your OpenCV wrapper.

You may do something like this in Swift

let videoFileURL = Bundle.main.url(forResource: "spaceMinimal", withExtension: "mp4")

Then pass videoFileURL.path into your OpenCV wrapper as an NSString. This is what consists of the video path relative to the app and should be the parameter inside cap.