fahimfarhan / SimpleVideoEditor

A very simple free and open-source android video editor made with Mp4Composer that allows you to crop, trim and apply filters :)
MIT License
48 stars 14 forks source link

Crop fail with aspect ratio 16 : 9 #6

Open anonym2 opened 3 years ago

anonym2 commented 3 years ago

The crop method make crash your demo if you use 16 : 9 as aspect ratio with the Simplecropview in the setAspectRatio method

Here the Logcat

2021-01-06 05:43:59.168 18227-18227/app.fahimfarhan.start E/MainActivity: path = /storage/emulated/0/DCIM/Camera/8409335596234021ecba141032ee78ec.mp4 2021-01-06 05:43:59.810 18227-18227/app.fahimfarhan.start E/VideoEditorFragment2: onViewCreated 2021-01-06 05:43:59.810 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: VideoEditorPresenter#displayTrimmerView() 2021-01-06 05:43:59.820 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: getRealPathFromMediaData() path = /storage/emulated/0/DCIM/Camera/8409335596234021ecba141032ee78ec.mp4 2021-01-06 05:43:59.820 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: filePath = /storage/emulated/0/DCIM/Camera/8409335596234021ecba141032ee78ec.mp4 2021-01-06 05:43:59.847 18227-18227/app.fahimfarhan.start E/VideoEditorFragment2: start = 0 end = 8500 2021-01-06 05:44:00.148 18227-18458/app.fahimfarhan.start E/ACodec: [OMX.hisi.video.decoder.avc] setPortMode on output to DynamicANWBuffer failed w/ err -2147483648 2021-01-06 05:44:00.149 18227-18458/app.fahimfarhan.start E/libc: Access denied finding property "ro.kirin.product.platform" 2021-01-06 05:44:00.149 18227-18458/app.fahimfarhan.start E/HwExtendedCodec: mime: video/avc matching compontent failed! 2021-01-06 05:44:00.288 18227-18439/app.fahimfarhan.start E/AudioTrack: StreamType not music do not upload bigdata 2021-01-06 05:44:00.610 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: path = /storage/emulated/0/DCIM/Camera/8409335596234021ecba141032ee78ec.mp4 2021-01-06 05:44:02.245 18227-18227/app.fahimfarhan.start E/EditOptionsAdapter: click detected! 1 2021-01-06 05:44:03.672 18227-18227/app.fahimfarhan.start E/VideoEditorFragment2: ivPortrait clicked! 2021-01-06 05:44:09.007 18227-18227/app.fahimfarhan.start E/VideoEditorFragment2: ivLandScape clicked! 2021-01-06 05:44:11.354 18227-18227/app.fahimfarhan.start E/VideoEditorFragment2: ivPortrait clicked! 2021-01-06 05:44:14.373 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: translateX = -0.0014388489 translateY = -0.0014388489 2021-01-06 05:44:14.374 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: resolution.width = 576 resolution.getHeight = 1024 2021-01-06 05:44:14.397 18227-18227/app.fahimfarhan.start E/VideoEditorPresenter: currentGlFilter is null 2021-01-06 05:44:14.526 18227-18595/app.fahimfarhan.start E/libc: Access denied finding property "ro.kirin.product.platform" 2021-01-06 05:44:14.526 18227-18595/app.fahimfarhan.start E/HwExtendedCodec: mime: video/3gpp matching compontent failed! 2021-01-06 05:44:14.564 18227-18597/app.fahimfarhan.start E/ACodec: [OMX.google.h263.encoder] ERROR(0x80001001) 2021-01-06 05:44:14.564 18227-18597/app.fahimfarhan.start E/ACodec: signalError(omxError 0x80001001, internalError -2147483648) 2021-01-06 05:44:14.564 18227-18596/app.fahimfarhan.start E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6 2021-01-06 05:44:14.577 18227-18595/app.fahimfarhan.start E/libc: Access denied finding property "ro.kirin.product.platform" 2021-01-06 05:44:14.577 18227-18595/app.fahimfarhan.start E/HwExtendedCodec: mime: video/avc matching compontent failed! 2021-01-06 05:44:14.585 18227-18605/app.fahimfarhan.start E/ACodec: [OMX.hisi.video.decoder.avc] setPortMode on output to DynamicANWBuffer failed w/ err -2147483648 2021-01-06 05:44:14.631 18227-18605/app.fahimfarhan.start E/BufferQueueProducer: [SurfaceTexture-1-18227-2] cancelBuffer: BufferQueue has been abandoned 2021-01-06 05:44:14.663 18227-18595/app.fahimfarhan.start E/Mp4ComposerEngine: Message: Could not shutdown mediaExtractor, codecs and mediaMuxer pipeline.. Error: null 2021-01-06 05:44:14.663 18227-18595/app.fahimfarhan.start E/Mp4Composer: Message: Unable to compose the engine. Error: null 2021-01-06 05:44:14.664 18227-18595/app.fahimfarhan.start E/VideoEditorPresenter: onFailed() java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2705) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.VideoComposer.drainEncoder(VideoComposer.java:233) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.VideoComposer.stepPipeline(VideoComposer.java:123) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.Mp4ComposerEngine.runPipelines(Mp4ComposerEngine.java:279) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:142) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:299) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784) 2021-01-06 05:44:14.666 18227-18595/app.fahimfarhan.start E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1 Process: app.fahimfarhan.start, PID: 18227 java.lang.RuntimeException: Can't toast on a thread that has not called Looper.prepare() at android.widget.Toast$TN.<init>(Toast.java:393) at android.widget.Toast.<init>(Toast.java:117) at android.widget.Toast.makeText(Toast.java:280) at android.widget.Toast.makeText(Toast.java:270) at com.fahimfarhan.simplevideoeditor.videoeditor.VideoEditorPresenter$2.onFailed(VideoEditorPresenter.java:217) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.Mp4Composer.notifyListenerOfFailureAndShutdown(Mp4Composer.java:351) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.Mp4Composer.access$000(Mp4Composer.java:36) at com.fahimfarhan.simplevideoeditor.mp4composer.mp4compose.composer.Mp4Composer$2.run(Mp4Composer.java:330) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784)

anonym2 commented 3 years ago

If that can Help you I tried add yoru library in my app and the logcat is a little diffrent here what I got 2021-01-06 05:56:13.275 20202-21391/aftercorp.final_flash E/Mp4ComposerEngine: Message: Could not shutdown mediaExtractor, codecs and mediaMuxer pipeline.. Error: null 2021-01-06 05:56:13.276 20202-21391/aftercorp.final_flash E/Mp4Composer: Message: Unable to compose the engine. Error: null 2021-01-06 05:56:13.277 20202-21391/aftercorp.final_flash E/MainActivity: onFailed() java.lang.IllegalStateException at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method) at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2705) at aftercorp.final_flash.EditPostFile.VideoComposer.drainEncoder(VideoComposer.java:227) at aftercorp.final_flash.EditPostFile.VideoComposer.stepPipeline(VideoComposer.java:117) at aftercorp.final_flash.EditPostFile.Mp4ComposerEngine.runPipelines(Mp4ComposerEngine.java:270) at aftercorp.final_flash.EditPostFile.Mp4ComposerEngine.compose(Mp4ComposerEngine.java:133) at aftercorp.final_flash.EditPostFile.Mp4Composer$2.run(Mp4Composer.java:287) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784)

ooyellow58 commented 2 years ago

Same issue, wonder whether the author intends to solve it or not?