Comments (6)
The second parameter is the destination directory, not the destination file path. Try something like this:
String sourceFilePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) + "/MyAppVideos/myVideo1.mp4";
String destinationDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) + "/MyAppVideos/";
String compressedFilePath = SiliCompressor.with(context).compressVideo(sourceFilePath, destinationDir);
from silicompressor.
I am also getting this error
any solution?
from silicompressor.
Thanks both of you ( @vvbhandare & @ArslanKathia) for using this library.
I'm very sorry for my late response. I was not feeling well and i have been off for some while.
I have look at this issue critically and i have found that the issue is not the application(library) but the parameters you passed.
The compressVideo(String videoFileUri, String destinationUri)
takes two parameters of type string which are actually Uris which have been converted to string using the toString method.
@vvbhandare the parameter you passed above is a path and not a uri, please use the method Uri.fromFile(new File("your-path-here"))
to make your parameter a fully qualified parameter. In your case you will use it as below
SiliCompressor.with(this).compressVideo(Uri.fromFile(new File("/storage/emulated/0/DCIM/Camera/VID_20170908_122018.mp4")).toString(), Uri.fromFile(new File("/storage/emulated/0/abc.mp4")).toString());
from silicompressor.
@ArslanKathia i hope the solution provided is also valid for you
from silicompressor.
I am also Getting same error while passing these as Argument for compress video .
URI content://com.android.providers.media.documents/document/video%3A4500
SAVED PATH /storage/emulated/0/MyFile/Media/Video/Temp1509006345128.mp4
from silicompressor.
In my case was thrown IllegalArgumentException without any messages and causes, because MediaMetadataRetriever couldn't create FileDescriptor.
In total, works for me when videoFilePath is:
/storage/emulated/0/DCIM/Camera/VID_20220226_160644.mp4
and not work when videoFilePath looks like this:
file:///storage/emulated/0/DCIM/Camera/VID_20220226_160446.mp4
from silicompressor.
Related Issues (20)
- Failed resolution of: Lcom/googlecode/mp4parser/util/Matrix; HOT 3
- Implementation error HOT 6
- The library I'm using, which compresses video on the phone, is fine. However, on the tablet, this is not possible, and there is an exception: start failed. Who can help me? Thank you HOT 1
- bug
- Directory issue HOT 1
- Documentation issue
- How long will it take to compress an mp4 file?
- 视频进度监听误差,有什么好的解决方案?
- Silicompressor compress video results with no sound HOT 5
- Can't play by ExoPlayer after compress (system video player can play but no sound) HOT 3
- ClassNotFoundException: com.googlecode.mp4parser.util.Matrix
- @ankitbatra11 library not working in exoplayer after upload to the server HOT 6
- How to set compress video size is less than 10mb HOT 1
- Change video resolution HOT 1
- Getting NumberFormatException in some cases HOT 1
- Crashing on Android 12 HOT 1
- ERROR : destination file path
- After video compression, the audio format from aac to mp4a-40-0. Chrome cannot play HOT 1
- 视频压缩完方向变了
- Screen recording video compression is damaged
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 silicompressor.