Comments (15)
thanks @gifandadelasty you made day. I have fixed this and added some fixes for android 13 in v1.7.14
from android-video-trimmer.
Getting same issue.
from android-video-trimmer.
@Narendrakumar-Vanamala @hsinha76 Could you share the device detail and library version?
from android-video-trimmer.
Am checking Samsung Galaxy- A30S - Android 11 Version
from android-video-trimmer.
this issue had been fixed in 1.7.0. Could you share the library version?
from android-video-trimmer.
Xioami Note 4
Android version 7.0
from android-video-trimmer.
this issue had been fixed in 1.7.0. Could you share the library version
Am using 1.7.0 version and yesterday i debug here are the obsevation
Library working demo i verified it am getting file path as content://media/external/video/media/1583 but my application returns some different path as /storage/emulated/0/Android/data/packagename/cache/test.mp4.
Please suggest and help me for the above fix.
from android-video-trimmer.
Before, 1.5.11 there was an option to store video files in the storage folder wherever we want. In 1.5.11 I removed write permission due to the android 11 storage changes.
Demo app uses an older version than 1.5.11.
Now Trimmed videos are stored as a cache file because it doesn't need any write permission, won't be showing in the gallery as a video file and I thought it would be fine. since most use cases will be just uploading the trimmed video file to the server.
from android-video-trimmer.
Before, 1.5.11 there was an option to store video files in the storage folder wherever we want. In 1.5.11 I removed write permission due to the android 11 storage changes.
Demo app uses an older version than 1.5.11.
Now Trimmed videos are stored as a cache file because it doesn't need any write permission, won't be showing in the gallery as a video file and I thought it would be fine. since most use cases will be just uploading the trimmed video file to the server.
I checked latest version too, am getting the same issue. shall I change the video save location ? Please suggest on this.
It would be great help me on how to store video file location in Android-11 and i need to pass that location to TrimActivity.
from android-video-trimmer.
You can't change video location.
- Do you still get getRealPath null issue?
- Share your use case I will try to find a workaround
from android-video-trimmer.
Yes, am getting null
Here is the my usecase
We have two options one is record a video and trim the video and other one is pick video from gallery and trim.
Now am passing video storage URLto openTrimActivity(), after that am getting null from getRealPath() method.
Here the below format am passing storage URL to openTrimActivity()
ex: /storage/emulated/0/Android/data/packagename/cache/test.mp4.
Let me know any other details if required.
from android-video-trimmer.
@Narendrakumar-Vanamala Can try passing uri string instead of filepath
from android-video-trimmer.
from android-video-trimmer.
Hello..
I'm getting same issue.. I'm developing app that allow user to take video or pick from gallery, but after video taken and video saved in storage Video Trimmer facing error with this details :
java.lang.NullPointerException: Attempt to invoke interface method 'int
android.database.Cursor.getColumnIndexOrThrow(java.lang.String)' on a null object reference
at com.gowtham.library.utils.FileUtils.getRealPath(FileUtils.java:26)
at com.gowtham.library.ui.ActVideoTrimmer.lambda$setDataInView$4$com-gowtham-library-ui-ActVideoTrimmer(ActVideoTrimmer.java:217)
at com.gowtham.library.ui.ActVideoTrimmer$$ExternalSyntheticLambda11.run(Unknown Source:2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
This is code in CreatorActivity.kt :
// --- START TRIM VIDEO ---
TrimVideo.activity(videoUri.toString())
.setCompressOption(CompressOption(30, "1M", 480, 640))
.setTrimType(TrimType.MIN_MAX_DURATION)
.setMinToMax(10, 120)
.start(this, startTrimVideoForResult)
videoUri
is an Uri, and it converted to string with toString()
to become:
"/storage/emulated/0/AppName/Camera/video_2023Jun24_2209.mp4"
I have try using Uri.fromFile() that suggested by @Narendrakumar-Vanamala , but still getting this NullException..
Thanks for your help..
from android-video-trimmer.
Hi bro..
I have solved this.. This library needs Content Uri instead of File Path. So, if the video come from CameraActivity.kt first its need to converted to content Uri before calling TrimVideo activity..
Before : "/storage/emulated/0/AppName/Camera/video_2023Jun24_2209.mp4" (getRealPath getting Null)
Converting to Content Uri:
[ KOTLIN ]
val videoFile = File("/storage/emulated/0/VideoPath/example_video.mp4")
val projection = arrayOf(videoFile.absolutePath)
MediaScannerConnection.scanFile(context, projection, null) { path, contentUri ->
// --- TrimVideo.activity(contentUri.toString()) ---
}
[ JAVA ]
File videoFile = new File("/storage/emulated/0/VideoPath/example_video.mp4");
String[] projection = { videoFile.getAbsolutePath() };
MediaScannerConnection.scanFile(context, projection, null,
new MediaScannerConnection.OnScanCompletedListener() {
public void onScanCompleted(String path, Uri contentUri) {
// --- TrimVideo.activity(contentUri.toString()) ---
}
});
After : "content://media/external/video/media/####" (Its WORKED)
Thank you for the great library @a914-gowtham 👍
Reference : https://stackoverflow.com/a/53349110/18410044
from android-video-trimmer.
Related Issues (20)
- import com.gowtham.library.utils.TrimVideo HOT 1
- TrimVideo class is not found HOT 1
- Could not find com.crystal:crystalrangeseekbar:1.1.3. HOT 2
- Please add this trimmer as Separate entity, Make a copy of this trimmer without FFmpeg
- Getting this error after adding the dependenecy HOT 1
- problem with jniLibs and CMake; HOT 3
- Error after adding library
- Linking error when adding the library HOT 2
- app size is 45 MB HOT 1
- Crash on all android version HOT 2
- Fatal Exception: java.lang.IllegalArgumentException HOT 1
- HOW TO USE THIS LIB WITHOUT PICKING VIDEO FROM GALLERY HOT 2
- I am suresh, while I taken video from internalstorage video and start to edit but getting crash.please help me HOT 9
- Minor issue, facing error if video file name contains '?' or '#' HOT 1
- How do we set the output destination?
- android 13 cant trim video permission denied.WRITE_EXTERNAL_SORAGE -> READ_EXTERNAL_VIDEO HOT 7
- allow setDestination to Cache directory HOT 2
- protocol not found. "failed to trim" HOT 5
- Not able to see the video in Chrome web browser after trimming. HOT 5
- minify enabled app crashes HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-video-trimmer.