tizisdeepan / VideoEditor

FFmpeg is a powerful multimedia framework which allows us to decode, encode, transcode, stream, filter and play most of the media content available now. With the help of these tools, you can develop and application that can manipulate any form of media to the desired output. Sky is not the limit when using FFmpeg. I prefer FFmpeg-all which is a Bible for FFmpeg but it is difficult to read if you do not know what you are looking for. To make it easy, I will summarise the basics of video manipulations using FFmpeg which, then you can use in your own applications or libraries that you are working on. I have developed a simple library that enables you to trim and crop a video, additionally you can compress any video and convert it into any format that you desire.
MIT License
214 stars 57 forks source link

Fmpeg: Exception while trying to run: [Ljava.lang.String;@237d618 #5

Closed kartheek222 closed 4 years ago

kartheek222 commented 4 years ago

Getting the below exception when trimming the video

 java.io.IOException: Cannot run program "/data/user/0/***/files/ffmpeg": error=13, Permission denied
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)
        at java.lang.Runtime.exec(Runtime.java:698)
        at java.lang.Runtime.exec(Runtime.java:563)
        at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10)
        at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)
        at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)
        at android.os.AsyncTask$3.call(AsyncTask.java:378)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
        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:919)
     Caused by: java.io.IOException: error=13, Permission denied
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)
        at java.lang.ProcessImpl.start(ProcessImpl.java:141)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        at java.lang.Runtime.exec(Runtime.java:698) 
        at java.lang.Runtime.exec(Runtime.java:563) 
        at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10) 
        at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38) 
        at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10) 
        at android.os.AsyncTask$3.call(AsyncTask.java:378) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289) 
        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:919) 
E/VideoOptions: onProgress: CANNOT LINK EXECUTABLE "/data/user/0/***/files/ffmpeg": "/data/data/***/files/ffmpeg" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
 E/VideoTrimmingActivity: onError CANNOT LINK EXECUTABLE "/data/user/0/***/files/ffmpeg": "/data/data/***/files/ffmpeg" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
 E/VideoOptions: onFailure: CANNOT LINK EXECUTABLE "/data/user/0/***/files/ffmpeg": "/data/data/***/files/ffmpeg" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
        videoTrimmer.setTextTimeSelectionTypeface(mediumTypeface)
                .setOnTrimVideoListener(this)
                .setOnVideoListener(this)
                .setVideoURI(Uri.parse(videoPath))
                .setVideoInformationVisibility(true)
                .setMaxDuration(30)
//                .setMinDuration(2)
                .setDestinationPath(destVideoPath);

Device Details Android Version : v10.0

DineshSonagra commented 4 years ago

The same issue is in Android Q is there any update?

tizisdeepan commented 4 years ago

This library doesn't support android Q as of now, Google has avoided the mandatory scoped storage usage for FFMPEG, so do the necessary permission changes in the library directly. I kinda stopped support for the library way long back due to lack of time, hope you understand :/