Cordova Video Editor插件InvalidOutputFormatException

时间:2016-10-04 20:01:00

标签: android cordova video

我正在使用cordova-plugin-video-editor处理之前录制的视频。

插件开始转换,但由于任何原因它失败了:

Image of the video, the start conversion and the fail

我得到的错误是:

net.ypresto.androidtranscoder.engine.InvalidOutputFormatException: Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: 100

更深入地了解问题/插件,我已经考虑过可能的bug

下面我粘贴代码:

recordStory: function (callback) {

  var options = {
    limit: 1,
    duration: 60,
    quality: 0
  };

  document.addEventListener("deviceready", function () {
    $cordovaCapture.captureVideo(options).then(function (videoData) { // Success! Video data is here
      $timeout(function () {
        VideoEditor.transcodeVideo(function (success) {
          console.log(success);
        }, function (error) {
          console.log(error);
        }, {
          fileUri: videoData[0].fullPath, // the path to the video on the device
          outputFileName: 'encoded1', // the file name for the transcoded video
          outputFileType: VideoEditorOptions.OutputFileType.MPEG4,
          optimizeForNetworkUse: VideoEditorOptions.OptimizeForNetworkUse.YES,
          saveToLibrary: true,
          maintainAspectRatio: true,
          width: 640,
          height: 640,
          videoBitrate: 1000000, // 1 megabit
          audioChannels: 2,
          audioSampleRate: 44100,
          audioBitrate: 128000, // 128 kilobits
          progress: function (info) {
            console.log('transcodeVideo progress callback, info: ' + info);
          }
        });
        callback(null, videoData);
      }, 100);
    }, function (err) { // An error occurred. Show a message to the user
      callback(err);
    });
  }, false);
}

config.xml中

<platform name="android">
    <preference name="android-minSdkVersion" value="18" />
</platform>
<plugin name="cordova-plugin-video-editor" spec="~1.1.2" />
<engine name="android" spec="~5.2.2" />

有人可以帮忙吗?

感谢您的建议。

0 个答案:

没有答案