java.lang.IllegalArgumentException
See original GitHub issueI am getting below error when I pass
SiliCompressor.with(this).compressVideo("/storage/emulated/0/DCIM/Camera/VID_20170908_122018.mp4", "/storage/emulated/0/abc.mp4");
java.lang.IllegalArgumentException
at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:64)
at com.iceteck.silicompressorr.videocompression.MediaController.convertVideo(MediaController.java:252)
at com.iceteck.silicompressorr.SiliCompressor.compressVideo(SiliCompressor.java:300)
at com.xxx.farwide.coreview.activity.s3filehandling.S3FileTransactionActivity$1.run(S3FileTransactionActivity.java:74)
at java.lang.Thread.run(Thread.java:764)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
IllegalArgumentException (Java Platform SE 8 )
Constructs a new exception with the specified detail message and cause. Note that the detail message associated with cause is not automatically incorporated...
Read more >How to solve an IllegalArgumentException in Java?
An IllegalArgumentException is thrown in order to indicate that a method has been passed an illegal argument. This exception extends the ...
Read more >Error: java.lang.IllegalArgumentException - Stack Overflow
It rises explicitly by API Developer or Programmer to indicate that a method has invoked with illegal argument. example: Thread t = new...
Read more >How to Solve IllegalArgumentException in Java?
The IllegalArgumentException is a subclass of java.lang.RuntimeException. RuntimeException, as the name suggests, occurs when the program is ...
Read more >How to Throw IllegalArgumentException in Java - Rollbar
The IllegalArgumentException is an unchecked exception in Java that is thrown to indicate an illegal or unsuitable argument passed to a ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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);
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