Giter Club home page Giter Club logo

Comments (6)

aminefilali1 avatar aminefilali1 commented on July 27, 2024 4

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.

ArslanKathia avatar ArslanKathia commented on July 27, 2024

I am also getting this error
any solution?

from silicompressor.

Tourenathan-G5organisation avatar Tourenathan-G5organisation commented on July 27, 2024

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.

Tourenathan-G5organisation avatar Tourenathan-G5organisation commented on July 27, 2024

@ArslanKathia i hope the solution provided is also valid for you

from silicompressor.

varun7952 avatar varun7952 commented on July 27, 2024

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.

kirkaDev avatar kirkaDev commented on July 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.