Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.io.ioexception.Runtime.getRuntime().exec(). environment and working directory null error in android

File dir = new File("/mnt/sdcard");
Process process = Runtime.getRuntime().exec("ffmpeg -f image2 -i img%4d.png video.mp4", null, dir);

when i try this line in android,i get environment and working directory null error in android. But when i try that line in java,it worked perfectly.but in android,it has some problem.

like image 911
rams Avatar asked Jul 23 '26 02:07

rams


1 Answers

i get environment and working directory null

It will return null because there is not path like /mmt/sdcard instead use /mnt/sdcard.

enter image description here

It will be best if you use Environment.getExternalStorageDirectory().

like image 153
Mohammed Azharuddin Shaikh Avatar answered Jul 25 '26 16:07

Mohammed Azharuddin Shaikh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!