Home > Blockchain >  Ffmpeg-kit not detecting my vidoe file (iOS Development, Swift) but the actual application does
Ffmpeg-kit not detecting my vidoe file (iOS Development, Swift) but the actual application does

Time:06-20

I have a video file in the project folder that is detected by the app as VideoPlayer(player: AVPlayer(url: url)) does make use of it and play it on the iPhone screen, I have the video path of simply videoURL = Bundle.main.url(forResource: "Earth_Zoom_In", withExtension: "mov")

Now, a kind gentleman gave me this code just yesterday:

func syncCommand() {
    guard let session = FFmpegKit.execute("-i Earth_Zoom_In.mov -c:v file1.mp4") else {
        print("!! Failed to create session")
        return
    }
    let returnCode = session.getReturnCode()
    if ReturnCode.isSuccess(returnCode) {
        print("COOOOL");
    } else if ReturnCode.isCancel(returnCode) {
        print("CANCELED???? WHAT?????");
    } else {
        print("Command failed with state \(FFmpegKitConfig.sessionState(toString: session.getState()) ?? "Unknown") and rc \(returnCode?.description ?? "Unknown").\(session.getFailStackTrace() ?? "Unknown")")
    }
}

But Ffmpeg seems to not find the file as when the function is executed I get ERROR: Earth_Zoom_In.mov: No such file or directory

But it is on the directory...

Can anyone help me with that?

  • Related