Manevolent / ffmpeg4j

A Java OOP FFmpeg wrapper around the JavaCPP FFmpeg native library bindings
Apache License 2.0
105 stars 15 forks source link

Retrieval of total position/progress ratio in transcoder #17

Open das-kaesebrot opened 1 year ago

das-kaesebrot commented 1 year ago

Hi! Thank you for this library, it provides almost all of the features I'm looking for!

As I've noticed, it would be helpful to be able to retrieve the total position across all source streams to be able to calculate a transcoding progress ratio. Or, even better, a way to retrieve the current progress from the transcoder either via passing a callback method or a getter.

I've tried my luck at implementing a simple getter method for the position. During testing I divided it by the sum of all packet durations to get a total progress ratio, which seemed to work out fine.

Unfortunately, I am not as familiar with the whole library (or JavaCV) yet - would it somehow be possible to retrieve the total duration of all streams before handling the packets inside the transcoder class?