a914-gowtham / android-video-trimmer Goto Github PK
View Code? Open in Web Editor NEWHelps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
License: MIT License
Helps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
License: MIT License
when i try to directly upload Uri in Storage, its show me an error like this.
2020-10-15 12:52:31.545 21431-22778/com.magica_technology.icon E/StorageException: No content provider: /storage/emulated/0/VIDEO/trimmed_video_0.mp4 java.io.FileNotFoundException: No content provider: /storage/emulated/0/VIDEO/trimmed_video_0.mp4 at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1675) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1505) at android.content.ContentResolver.openInputStream(ContentResolver.java:1189) at com.google.firebase.storage.UploadTask.<init>(UploadTask.java:131) at com.google.firebase.storage.StorageReference.putFile(StorageReference.java:240)
My code uploading code
` reference= storage.getReference().child("VideoPost").child("1").child("video/"+ uuid+"."+getExtension());
reference.putFile(VUri)
.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@OverRide
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
if (taskSnapshot != null) {
reference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
video = uri.toString();
uploadCoverImage();
uploadInDatabase();
}
});
}
}
})`
Even after adding min, max values in EditText. It always taking min value as 0.
I want to trim video without providing UI for range selection. Is it possible? if yes how?
when i set destination path but not show this path.it is take a default path
Updated provider details in the manifest as well.
Am adding this project as library to main project, updated all the permissions and provider details too
Stack trace for the crash
com.gowtham.library.utils.TrimVideo$ActivityBuilder.getIntent (TrimVideo.java:135)
com.gowtham.library.utils.TrimVideo$ActivityBuilder.start (TrimVideo.java:98)
com.tingo.videotone.ui.feed.DiscoverActivity.resultLauncher$lambda-9 (DiscoverActivity.java:202)
com.tingo.videotone.ui.feed.DiscoverActivity.lambda$mpR488IrPcg5SyeaiGNXEyPojn0 (DiscoverActivity.java:34)
com.tingo.videotone.ui.feed.-$$Lambda$DiscoverActivity$mpR488IrPcg5SyeaiGNXEyPojn0.onActivityResult (-.java:34)
@a914-gowtham Could you please help me debug this crash?
W/System.err: java.lang.NullPointerException: uriString
at android.net.Uri$StringUri.(Uri.java:496)
at android.net.Uri$StringUri.(Uri.java:486)
at android.net.Uri.parse(Uri.java:458)
at com.gowtham.library.ui.ActVideoTrimmer.setDataInView(ActVideoTrimmer.java:173)
at com.gowtham.library.ui.ActVideoTrimmer.onPostCreate(ActVideoTrimmer.java:143)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1381)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3322)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7403)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
The video is not imported and I'm getting a blank player.
I have requirement like need to trimmed video to the server, It would be great help with a piece of code sending trimmed video to the API's.
Is there anyway to attach audio to the trimmed video, if any let me know info on this.
read me is not clear can you explain how to use it . and can you use it on path as string ??
Receiving permission denied error in Android 10 : java.io.IOException: Cannot run program "/data/user/0/com.gowtham.videotrimmer/files/ffmpeg": error=13, Permission denied.
But working fine in below version of android 10
Why I am getting this while building my project? Please help me!
I'm trying to trim some videos more than 200 mb but in my Pocophone F1 (Xiaomi) it never shows the preview, i always receive an error in the Exoplayer ->
E/ExoPlayerImplInternal: Playback error
com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/hevc, hvc1.1.6.H153.B0, -1, null, [3840, 2160, 59.947292], [-1, -1]), format_supported=YES
Any idea of what causing it and how to solve it?.
This is open source and you can see mrde people using it. It helps in reaching out to more audiences
It seems that the library needs some resources which can't be found.
LOG:
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not resolve com.crystal:crystalrangeseekbar:1.1.3.
Required by:
project :app > project :renderer > com.github.a914-gowtham:android-video-trimmer:1.7.0
> Could not resolve com.crystal:crystalrangeseekbar:1.1.3.
> Could not get resource 'https://dl.bintray.com/deeppatel13/maven/com/crystal/crystalrangeseekbar/1.1.3/crystalrangeseekbar-1.1.3.pom'.
> Could not HEAD 'https://dl.bintray.com/deeppatel13/maven/com/crystal/crystalrangeseekbar/1.1.3/crystalrangeseekbar-1.1.3.pom'. Received status code 403 from server: Forbidden
Could not resolve com.arthenica:mobile-ffmpeg-min:4.3.1.LTS.
Required by:
project :app > project :renderer > com.github.a914-gowtham:android-video-trimmer:1.7.0
> Could not resolve com.arthenica:mobile-ffmpeg-min:4.3.1.LTS.
> Could not get resource 'https://dl.bintray.com/deeppatel13/maven/com/arthenica/mobile-ffmpeg-min/4.3.1.LTS/mobile-ffmpeg-min-4.3.1.LTS.pom'.
> Could not HEAD 'https://dl.bintray.com/deeppatel13/maven/com/arthenica/mobile-ffmpeg-min/4.3.1.LTS/mobile-ffmpeg-min-4.3.1.LTS.pom'. Received status code 403 from server: Forbidden
BUILD FAILED in 10s
Hello, @a914-gowtham great work. Just one query or you can say update that there is no message on minGap like when users add video less than the required minGap.
Thanks for this work.
after trimming video, mime type of result video is null
Below error am facing after enabling proguard
java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.CompoundButton$SavedState proguard issue
Please give me the suggestion to this
ANR Occurs in Trimming a larger video file size of more than 100 Mb
Device - Google Pixel 2
OS - Android 11
E/ActivityManager: ANR in x.x.x (x.x.x/com.gowtham.library.ui.ActVideoTrimmer)
Reason: Input dispatching timed out (61e2e37 x.x.x/com.gowtham.library.ui.ActVideoTrimmer (server) is not responding. Waited 5001ms for FocusEvent(hasFocus=true))
Parent: x.x.x/com.gowtham.library.ui.ActVideoTrimmer
I facing a video stretch issue after trimming the video. It does not occur for all video files, only occurs on some videos. I found one thing for the issue, that is height and width of the video are interchanged, also rotation is changed, after executing the below lines.
I've attached a sample video file. The actual width and height are 352 and 640, after trimming the changed as 640 and 340. Please help to fix the issue.
`MediaMetadataRetriever metaRetriever = new MediaMetadataRetriever();
metaRetriever.setDataSource(String.valueOf(uri));
String height = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
String width = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH);
String rotation = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
int w = TrimmerUtils.clearNull(width).isEmpty() ? 0 : Integer.parseInt(width);
int h = Integer.parseInt(height);`
This shows failed to trim when I pick a video file with .webm extension and the compressOption. Without compressionOption it works fine.
I get a FastVideoView based on VideoView and it cannot restart video after TrimActivity.
I think the problem is the media player of your video holder is not released.
Sorry for my bad English.
Hi,
I encountered four errors.
1-) xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2" xmlns:ns2="http://schemas.android.com/tools"
2-) duplicate value for resource 'attr/position' with config ''.
3-) resource previously defined here.
4-) duplicate value for resource 'attr/data_type' with config ''.
ı used version is 1.5.2.
Help me :)
@a914-gowtham Library is working perfect upto android 9 but when i test it in android 10 or 11 my app crash.
Error report is given below
Device: Samsung Galaxy S10
OS version: Android 10 (SDK 29)
Stack trace:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.qboxus.musictok-TNRX9lFlXxLwdRoIlDqLqw==/base.apk"],nativeLibraryDirectories=[/data/app/com.qboxus.musictok-TNRX9lFlXxLwdRoIlDqLqw==/lib/x86, /data/app/com.qboxus.musictok-TNRX9lFlXxLwdRoIlDqLqw==/base.apk!/lib/x86, /system/lib, /system/product/lib, /system/vendor/lib]]] couldn't find "libavutil.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at Jni.FFmpegCmd.(FFmpegCmd.java:18)
at Jni.FFmpegCmd.exec(FFmpegCmd.java:77)
at com.gowtham.library.ui.ActVideoTrimmer.validateVideo(ActVideoTrimmer.java:449)
at com.gowtham.library.ui.ActVideoTrimmer.onOptionsItemSelected(ActVideoTrimmer.java:428)
at android.app.Activity.onMenuItemSelected(Activity.java:4156)
at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:384)
at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:219)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:64)
at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:207)
at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:781)
at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:840)
at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:991)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:981)
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:7259)
at android.view.View.performClickInternal(View.java:7236)
at android.view.View.access$3600(View.java:801)
at android.view.View$PerformClick.run(View.java:27892)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Hi, I am getting Fatal signal 6 (SIGABRT) error after I crop the video and click on tick button in TrimVideo Activity. Below is the log at the time of crash. Kindly look into the issue and revert as quickly as possible.
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] native: #11 pc 00000000000ac4d4 /system/framework/arm64/boot.oat (Java_java_lang_Runtime_nativeLoad__Ljava_lang_String_2Ljava_lang_ClassLoader_2Ljava_lang_String_2+228)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Runtime.nativeLoad(Native method)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Runtime.doLoad(Runtime.java:1099)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] - locked <0x0f928db3> (a java.lang.Runtime)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Runtime.loadLibrary0(Runtime.java:1014)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] - locked <0x0f928db3> (a java.lang.Runtime)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.System.loadLibrary(System.java:1657)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at com.arthenica.mobileffmpeg.Config.(:133)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at com.arthenica.mobileffmpeg.Config.b(:623)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at e.a.a.b.a(:54)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at e.a.a.b.doInBackground(:29)
2021-01-16 17:29:05.743 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at android.os.AsyncTask$2.call(AsyncTask.java:333)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516] at java.lang.Thread.run(Thread.java:764)
2021-01-16 17:29:05.744 12315-13269/igcoco.classtrak A/zygote64: runtime.cc:516]
--------- beginning of crash
2021-01-16 17:29:05.746 12315-13269/igcoco.classtrak A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 13269 (AsyncTask #3)
I am getting Failed to resolve: com.github.a914-gowtham:Android-video-trimmer:1.3.0 error when trying to use it in gradle
Hello,
This sdk is working fne. in debug mode and release mode.
But when we add proguard rules and set minifyEnabled = true App is crashing when we start trim process (trimmer view - click -> tick mark)
This crash is happening for all devices.
i already added the proguard rules {
-dontwarn com.gowtham.library**
-keep class com.gowtham.library** { ; }
-keep interface com.gowtham.library* { *; }
}
Crash catch in crash analytics
com.gowtham.library.ui.ActVideoTrimmer.getCompressionCommand
android.media.MediaMetadataRetriever.setDataSource (MediaMetadataRetriever.java:77)
com.gowtham.library.ui.ActVideoTrimmer.getCompressionCommand (ActVideoTrimmer.java:502)
com.gowtham.library.ui.ActVideoTrimmer.validateVideo (ActVideoTrimmer.java:485)
com.gowtham.library.ui.ActVideoTrimmer.onOptionsItemSelected (ActVideoTrimmer.java:456)
android.app.Activity.onMenuItemSelected (Activity.java:4137)
androidx.fragment.app.FragmentActivity.onMenuItemSelected (FragmentActivity.java:383)
androidx.appcompat.app.AppCompatActivity.onMenuItemSelected (AppCompatActivity.java:219)
androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected (WindowCallbackWrapper.java:109)
androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected (WindowCallbackWrapper.java:109)
androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick (ToolbarActionBar.java:64)
androidx.appcompat.widget.Toolbar$1.onMenuItemClick (Toolbar.java:207)
androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected (ActionMenuView.java:781)
androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected (MenuBuilder.java:840)
androidx.appcompat.view.menu.MenuItemImpl.invoke (MenuItemImpl.java:158)
androidx.appcompat.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:991)
androidx.appcompat.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:981)
androidx.appcompat.widget.ActionMenuView.invokeItem (ActionMenuView.java:625)
androidx.appcompat.view.menu.ActionMenuItemView.onClick (ActionMenuItemView.java:151)
android.view.View.performClick (View.java:7140)
android.view.View.performClickInternal (View.java:7117)
android.view.View.access$3500 (View.java:801)
android.view.View$PerformClick.run (View.java:27355)
android.os.Handler.handleCallback (Handler.java:883)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7397)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:935)
Hello,
Thanks for great lib. The lib doesn't work properly when I implement it in fragment. Do you have any idea about this issue?
Thanks
I can't trim the video because WRITE_STORAGE_PERMission always returns false.
I try to use fixed gap duration by 30 sec so that it can trim by 30 no matter where you seelect is not working.
In Samsung Galaxy M11 I'm getting this error. But not in all device. Same device working fine. But In one device app is crashing after triming :
here is log:
java.lang.NoClassDefFoundError:
at com.gowtham.library.ui.ActVideoTrimmer.lambda$execFFmpegBinary$7$ActVideoTrimmer (ActVideoTrimmer.java:552)
at com.gowtham.library.ui.-$$Lambda$ActVideoTrimmer$MCPO02d6SpT9CwOEpTbigIE9zLk.run (Unknown Source:6)
at java.lang.Thread.run (Thread.java:919)
Hello Good evening,
I have noticed that one Samsung device A41 is having that error ->
I know that you had an open issue before for this to be corrected on 1.6.4 but was close without an answer, can you cross-check that I'm using 1.6.5 for the trimmer and still with the error.
05-25 14:01:01.278 1000 5164 7708 E Parcel : Class not found when unmarshalling: com.gowtham.library.utils.TrimVideoOptions
05-25 14:01:01.278 1000 5164 7708 E Parcel : java.lang.ClassNotFoundException: com.gowtham.library.utils.TrimVideoOptions
05-25 14:01:01.278 1000 5164 7708 E Parcel : at java.lang.Class.classForName(Native Method)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at java.lang.Class.forName(Class.java:454)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.Parcel.readParcelableCreator(Parcel.java:3350)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.Parcel.readParcelable(Parcel.java:3284)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.Parcel.readValue(Parcel.java:3186)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.Parcel.readArrayMapInternal(Parcel.java:3579)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.BaseBundle.unparcel(BaseBundle.java:236)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.BaseBundle.getString(BaseBundle.java:1196)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.content.Intent.getStringExtra(Intent.java:8889)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1128)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:894)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1710)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1560)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at com.android.server.wm.ActivityTaskManagerService.startActivity(ActivityTaskManagerService.java:1512)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.app.IActivityTaskManager$Stub.onTransact(IActivityTaskManager.java:1663)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.Binder.execTransactInternal(Binder.java:1195)
05-25 14:01:01.278 1000 5164 7708 E Parcel : at android.os.Binder.execTransact(Binder.java:1159)
05-25 14:01:01.278 1000 5164 7708 E Parcel : Caused by: java.lang.ClassNotFoundException: com.gowtham.library.utils.TrimVideoOptions
05-25 14:01:01.278 1000 5164 7708 E Parcel : ... 18 more
05-25 14:01:01.279 1000 5164 7708 W Bundle : Failed to parse Bundle, but defusing quietly
05-25 14:01:01.279 1000 5164 7708 W Bundle : android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.gowtham.library.utils.TrimVideoOptions
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.Parcel.readParcelableCreator(Parcel.java:3376)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.Parcel.readParcelable(Parcel.java:3284)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.Parcel.readValue(Parcel.java:3186)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.Parcel.readArrayMapInternal(Parcel.java:3579)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.BaseBundle.initializeFromParcelLocked(BaseBundle.java:292)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.BaseBundle.unparcel(BaseBundle.java:236)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.BaseBundle.getString(BaseBundle.java:1196)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.content.Intent.getStringExtra(Intent.java:8889)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1128)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:894)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1710)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1560)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at com.android.server.wm.ActivityTaskManagerService.startActivity(ActivityTaskManagerService.java:1512)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.app.IActivityTaskManager$Stub.onTransact(IActivityTaskManager.java:1663)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.Binder.execTransactInternal(Binder.java:1195)
05-25 14:01:01.279 1000 5164 7708 W Bundle : at android.os.Binder.execTransact(Binder.java:1159)
-CreateMediaSource, ExoPlayerFactory Instance, DefaultEventListener are deprecated
Need an update with latest ExoPlayer(2.12.1)
when i tried to trim video from a fragment the result is not being returned to the fragment. Please do replay , i will be so happy if i get the replay back soon
My project is compileSdkVersion 30, minSdkVersion 23.
When I use your library, I get the following error.
java.lang.UnsatisfiedLinkError: dlopen failed: library "libavutil.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
at java.lang.System.loadLibrary(System.java:1664)
at Jni.FFmpegCmd.<clinit>(FFmpegCmd.java:18)
at Jni.FFmpegCmd.exec(FFmpegCmd.java:77)
at com.gowtham.library.ui.ActVideoTrimmer.validateVideo(ActVideoTrimmer.java:449)
at com.gowtham.library.ui.ActVideoTrimmer.onOptionsItemSelected(ActVideoTrimmer.java:428)
at android.app.Activity.onMenuItemSelected(Activity.java:4264)
at androidx.fragment.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:384)
at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:219)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.app.ToolbarActionBar$2.onMenuItemClick(ToolbarActionBar.java:64)
at androidx.appcompat.widget.Toolbar$1.onMenuItemClick(Toolbar.java:207)
at androidx.appcompat.widget.ActionMenuView$MenuBuilderCallback.onMenuItemSelected(ActionMenuView.java:781)
at androidx.appcompat.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:840)
at androidx.appcompat.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:991)
at androidx.appcompat.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:981)
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:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28296)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I have been using this library and found it as the best one for development and support from you guys. However, I have 1 change request.
My app is multilingual and when I build it in Japanese, the title of the video editor is still "Edit Vide" which is hardcoded in ActVideoTrimmer
class. Could you migrate the hardcoded texts to strings file so that I can add translations for other languages as well?
Hi, can you say when this pull request (Added Max Duration #27) will be released ?
And did i undesrstand it right. if i will set 10s max duration then users will be able to cut videos up to 10 sec and less ?
Here is a snip of my code. trim is a button that is clicked that triggers the new activity.
trim.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
TrimVideo.activity(String.valueOf(mVideoUri))
// .setCompressOption(new CompressOption()) //empty constructor for default compress option
.setDestination("/storage/emulated/0/DCIM/TESTFOLDER") //default output path /storage/emulated/0/DOWNLOADS
.start(getActivity());
}
});
Here is an image of what it looks like, and the play button does nothing
hello
tnx for this library because is the best
how can set max duration ?
implementation 'com.arthenica:ffmpeg-kit-full:4.4.LTS'
implementation 'com.github.a914-gowtham:android-video-trimmer:1.7.0'
when I use both of these I am getting the following error.
More than one file was found with OS independent path 'lib/armeabi-v7a/libavdevice.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
if I am only using a video trimmer it's working fine, but I need both implementations. help, please. thanks
if possible to add custom aspect ratios
I call:
TrimVideo.activity(String.valueOf(data.getData()))
.setTrimType(TrimType.MIN_MAX_DURATION)
.setMinToMax(5, 60).start(fragment);
after that my UI is freeze. in profiler i found that copyFileToInternalStorage() in method setDataInView() in ActVideoTrimmer.onPostCreate need do in background thread because it freeze UI Thread.
i think the best solution its dont copy video on start and save only cropped part to app folder.
Can we Customize the Title Bar ?
We need to start TrimVideo with fragment.activity
so it's not possible to get the result directly into the fragment, I think it requires an extra step to do just that, especially when we're working with Navigation Architecture Component. I would highly appreciate it if you can write another start method with fragment and do fragment.startActivityForResult
will work then. Thanks.
W/System.err: java.lang.NullPointerException: uriString
at android.net.Uri$StringUri.(Uri.java:496)
at android.net.Uri$StringUri.(Uri.java:486)
at android.net.Uri.parse(Uri.java:458)
at com.gowtham.library.ui.ActVideoTrimmer.setDataInView(ActVideoTrimmer.java:173)
at com.gowtham.library.ui.ActVideoTrimmer.onPostCreate(ActVideoTrimmer.java:143)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1381)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3322)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7403)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Hi you,
Please let me know, after compress video then not return rotate?
Possible to add/create separate lib for audio trimmer view
The frames are replaced by audio waveform and handles remain same
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.