ffmpeg-android-java icon indicating copy to clipboard operation
ffmpeg-android-java copied to clipboard

ffmpeg starts, but no progress

Open gabrielecastellano opened this issue 8 years ago • 5 comments

Hi, Until now i've used your library in a foreground service and anything worked well; now i've add a button on my activity to call ffmpeg, but THE SAME COMMANDS don't work!

The output is void, simply all is blocked after "D/FFmpeg: Running publishing updates method".

command is: -y -v debug -i /data/data/com.myapp/app_Voice/PTT-20160225-WA0018.m4a /data/data/myapp/app_Voice/PTT-20160225-WA0018.wav

input file exists. the same command with the same file works if called from the service. What i'm missing?

gabrielecastellano avatar Mar 05 '16 11:03 gabrielecastellano

I'm experiencing the same issue occasionally.

dan-dr avatar Mar 10 '16 20:03 dan-dr

i've discovered that when this appears, the output file is correctly created, but for some reasons the java interface is not updated...so in my final wait() i periodically check for the file, and if it is ready I simply stop to wait for him to finish and continue my job normally. Hope this could help someone.

gabrielecastellano avatar Mar 10 '16 23:03 gabrielecastellano

@gabrielecastellano could you show the code snippet ?

akashpopat avatar Apr 18 '16 11:04 akashpopat

I am having the same issue. My code is

// Progress update thread
new Thread() {
	ProgressCalculator pc = new ProgressCalculator(vkLogPath);
	public void run() {
		Log.i(LOG_TAG, "Progress update started");
		int progress = -1;
		try {
			while (true) {
				sleep(300);
				progress = pc.calcProgress();
				Log.i(LOG_TAG, "progress = " + progress);
                                    if (progress != 0 && progress < 100) {
				} else if (progress == 100) {
					Log.i(LOG_TAG, "==== progress is 100, exiting Progress update thread");
					break;
				}
			}

		} catch(Exception e) {
			Log.e(LOG_TAG,e.getMessage());
		}
	}
}.start();

Every single time the progress is printed out, I'm getting a 0 value unless the command completes, then I get 100. Seems like the ProgressCalculator isn't working properly.

mikewalkerjr avatar Apr 11 '17 22:04 mikewalkerjr

Maybe you need it: https://github.com/WritingMinds/ffmpeg-android-java/issues/100#issuecomment-307688886

thirtyyuan avatar Mar 07 '19 03:03 thirtyyuan