MobileFFMPeg不将mkv转换为Mp4

时间:2020-05-07 16:16:23

标签: swift ffmpeg

我当前正在设备上运行以下代码,以将目录中的所有mkv文件转换为mp4。但是由于某种原因,没有文件被转换。我仔细检查了目录名称,它是正确的,我的语法有问题吗?

let path = self.documentsDir()
let url = URL(string: path.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)
     var rc = MobileFFmpeg.execute("-i jellyfish.mkv -c:v libx264 -preset -slow -crf 22 -c:a copy youroutput.mp4")
          if (rc == RETURN_CODE_SUCCESS) {
               print("Command execution completed successfully.\n");
                } 
          else if (rc == RETURN_CODE_CANCEL) {
                print("Command execution cancelled by user.\n");
                } 
           else {
                print("Command execution failed with rc=%d and output=%@.\n", rc, MobileFFmpegConfig.getLastCommandOutput);
                }
2020-05-07 13:36:02.782150-0400 WebmBrowser[8025:138754] ERROR: /Users/jlee/Library/Developer/CoreSimulator/Devices/8CD81B87-9E27-4F3C-8601-C76945FAD4D8/data/Containers/Data/Application/B7A0D956-3BAB-4203-82EE-5FDBF38B2F13/Documents/jellyfish.mkv: Invalid data found when processing input

Command execution failed with rc=%d and output=%@.

0 个答案:

没有答案