Sandy
Sandy

Reputation: 14125

How to show progressbar for FFMPEG process in java

I am merging two files using FFMPEG command in java. I want to show a progressbar for the conversion process. How can I achieve this.

FFMpeg Command:

ffmpeg -i audioFile -i videoFile -sameq -vcodec libx264 -r10 -ar 44100 -y -async 1 -crf 30 -b 500K outputFile

I am using ProcessBuilder to execute this command in a separate thread. Everything is working fine. Now I just want to show the progressbar for this process.

Could someone please guide me on this.

Thanks.

Upvotes: 3

Views: 2765

Answers (1)

unholysampler
unholysampler

Reputation: 17321

Expanding on what you can find here: Can ffmpeg show a progress bar?

You should use process.getErrorStream() to get the stream and read in the progress information. When ever you see a progress message, you can make the respective change to your progress bar.

Upvotes: 1

Related Questions