a914-gowtham / android-video-trimmer

Helps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
Other
362 stars 115 forks source link

Failed to trim issue #15

Closed sumonshil closed 3 years ago

sumonshil commented 3 years ago

Screenshot_20201005-213947 When click on done button for trim result ,it always show me failed to trim . please give me a solution

a914-gowtham commented 3 years ago

Could you please send error log

a914-gowtham commented 3 years ago

and share the code for opening the trimming screen

sumonshil commented 3 years ago

// log error..................... 2020-10-06 14:08:56.530 2915-7681/com.magica_technology.icon E/mobile-ffmpeg: /storage/emulated/0/Download/trimmed_video_0.mp4: Permission denied 2020-10-06 14:08:56.561 2915-7681/com.magica_technology.icon E/mobile-ffmpeg: /storage/emulated/0/Download/trimmed_video_0.mp4: Permission denied 2020-10-06 14:08:56.568 1231-3841/? E/InputDispatcher: Window handle Window{43f7d54 u0 com.magica_technology.icon/com.gowtham.library.ui.ActVideoTrimmer} has no registered input channel 2020-10-06 14:08:56.585 1231-3841/? E/InputDispatcher: Window handle Window{43f7d54 u0 com.magica_technology.icon/com.gowtham.library.ui.ActVideoTrimmer} has no registered input channel

//code..........................................

`

@Override

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_post_video); init(); storage= FirebaseStorage.getInstance(); storageReference = storage.getReference();

    vUri =getIntent().getStringExtra("Uri");
    TrimVideo.activity(vUri)
            .setTrimType(TrimType.MIN_MAX_DURATION)
            .setAccurateCut(true)
            .setCompressOption(new CompressOption())
            .setMinToMax(10, 180)  //seconds
            .start(PostVideoActivity.this);

}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == TrimVideo.VIDEO_TRIMMER_REQ_CODE && data != null) {
        Uri uri = Uri.parse(TrimVideo.getTrimmedVideoPath(data));
    }
}

`

a914-gowtham commented 3 years ago

Have you given android:requestLegacyExternalStorage="true" this AndroidManifest.class inside application tag.and you have to use file provider in your manifest REFER THIS

sumonshil commented 3 years ago

Thank you Problem solved