jbavari / cordova-plugin-video-editor

A cordova plugin to edit videos.
Other
289 stars 235 forks source link

Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: 100 #175

Open Rodrigo4ever opened 3 years ago

Rodrigo4ever commented 3 years ago
captureVideo2(){
    this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE)
        .then(status => {
            if (status.hasPermission) 
            {
              this.captureVideoOther();
            } 
            else 
            {
              this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE)
              .then(status =>{
                if(status.hasPermission) {
                  this.captureVideoOther();
                }                          
              });
            }
        })
        .catch((error) => { console.log(error)})     
  }
captureVideoOther(){
    console.log("captureVideoOther");
    let options: CaptureVideoOptions = {limit: 1, quality: 1, duration: 30 };

      this.mediaCapture.captureVideo(options)
          .then( 
                (data: MediaFile[]) => {               
                console.log(data);
                this.editVideoCaptured(data);            
                this.videoGravado = true;
            },
            (err: CaptureError) => console.error(err)
          )
          .catch((error:any) => console.log('erro', error))   

  }
editVideoCaptured(urlvideo){
    this.videoEditor.transcodeVideo({
      fileUri: urlvideo[0].fullPath,
      outputFileName: 'output-mobile',
      outputFileType: this.videoEditor.OutputFileType.MPEG4,
      saveToLibrary: false,
      deleteInputFile: true,    
      maintainAspectRatio: true,
      width: 640,                 
      height: 360,             
    })
    .then((fileUri: string) => console.log('Video Transcode success', fileUri))
    .catch((error:any) => console.log('video transcode erro', error))   
  }

My Config.xml

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
            <application android:requestLegacyExternalStorage="true" />
        </edit-config>

<preference name="android-minSdkVersion" value="22" />

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

gbrits commented 1 year ago

Did you ever get around this @Rodrigo4ever ? I am facing the same issue.