3

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.

Sandeep Kumar
  • 13,202
  • 19
  • 67
  • 103

1 Answers1

1

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.

Community
  • 1
  • 1
unholysampler
  • 16,667
  • 6
  • 46
  • 63