android-video-trimmer icon indicating copy to clipboard operation
android-video-trimmer copied to clipboard

Not able to see the video in Chrome web browser after trimming.

Open kartheek222 opened this issue 2 years ago • 6 comments

We are not able to see the video in web browsers after trimming the video with this library. The video shows completely black screen, but able to hear the audio for the trimmed video. This might be because the codec is not compatible with the browsers. Version : 1.7.14

Capture

kartheek222 avatar Jul 06 '23 13:07 kartheek222

Same Issue Here

rahat14 avatar Oct 04 '23 12:10 rahat14

@rahat14 did you upload the video file to server and used the url in the browser? or else could u share the reproduction steps?

a914-gowtham avatar Oct 04 '23 18:10 a914-gowtham

@a914-gowtham I uploaded in my bucket and it does not play via link only audio comes. After debugging I found to play a video over Chrome or Mozilla it needs to have an x264 encoder, so I downloaded the library and changed the FFmpeg version to GPL, and added x264 encoder to the execution code now it's working. if u want i can share the code

rahat14 avatar Oct 04 '23 18:10 rahat14

yes @rahat14 . that would be great

a914-gowtham avatar Oct 04 '23 18:10 a914-gowtham

I followed details given by @rahat14 , below is the code changes, in library build gradle file change implementation 'com.arthenica:mobile-ffmpeg-min:4.4.LTS' to implementation 'com.arthenica:mobile-ffmpeg-min-gpl:4.4.LTS'

In ActVideoTrimmer class file, search for "mpeg4" and replace it with "h264".

That's it, hope it helps somebody

Thanks @rahat14, @a914-gowtham

praveenb avatar May 23 '24 07:05 praveenb

@rahat14 @praveenb can you help me. when I am using this
implementation 'com.arthenica:mobile-ffmpeg-min-gpl:4.4.LTS. my app is crashing on videotrimmer activity (ActVideoTrimmer ).

java.lang.Error: FFmpegKit failed to start on brand: Redmi, model: 21061119AG, device: selene, api level: 33, abis: arm64-v8a armeabi-v7a armeabi, 32bit abis: armeabi-v7a armeabi, 64bit abis: arm64-v8a. at com.arthenica.ffmpegkit.NativeLoader.loadLibrary(NativeLoader.java:50) at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKitAbiDetect(NativeLoader.java:130) at com.arthenica.ffmpegkit.AbiDetect.(AbiDetect.java:30) at com.arthenica.ffmpegkit.NativeLoader.loadNativeAbi(NativeLoader.java:65) at com.arthenica.ffmpegkit.NativeLoader.loadFFmpegKit(NativeLoader.java:173) at com.arthenica.ffmpegkit.FFmpegKitConfig.(FFmpegKitConfig.java:145) at com.arthenica.ffmpegkit.FFmpegSession.create(FFmpegSession.java:68) at com.arthenica.ffmpegkit.FFmpegKit.executeWithArgumentsAsync(FFmpegKit.java:78) at com.gowtham.library.ui.ActVideoTrimmer.execFFmpegBinary(ActVideoTrimmer.java:610) at com.gowtham.library.ui.ActVideoTrimmer.trimVideo(ActVideoTrimmer.java:540) at com.gowtham.library.ui.ActVideoTrimmer.onOptionsItemSelected(ActVideoTrimmer.java:509) at android.app.Activity.onMenuItemSelected(Activity.java:4555) at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:352) at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:264) at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109) at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:66) at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:221) at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:781) at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:834) at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:985) at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:975) at androidx.appcompat.widget.ActionMenuView.invokeItem(ActionMenuView.java:625) at androidx.appcompat.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:151) at android.view.View.performClick(View.java:7575) at android.view.View.performClickInternal(View.java:7548) at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0) at android.view.View$PerformClick.run(View.java:29848) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8294) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028) Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libffmpegkit_abidetect.so" not found at java.lang.Runtime.loadLibrary0(Runtime.java:1082) at java.lang.Runtime.loadLibrary0(Runtime.java:1003) at java.lang.System.loadLibrary(System.java:1661)

HafizHamza19 avatar Aug 02 '24 14:08 HafizHamza19