Describe the bugparseProgress (here) returns the wrong duration depending of the order of multiple inputs.
For example, 2 input files are given to ffmpeg, if the 1st input has a duration, then this duration is returned by parseProgress. The bug happens when the 1st file is an image, the duration given by ffmpeg is 00:00:00:04, so the progress ratio calculation is based on 00:00:00:04.
To Reproduce
Steps to reproduce the behavior:
Set setProgress,
Run a command with 2 inputs: 1 image and 1 audio
Expected behaviorratio returned here is supposed to be float between 0 and 1 that gives the progress of the run.
Desktop (please complete the following information):
Describe the bug
parseProgress
(here) returns the wrong duration depending of the order of multiple inputs.For example, 2 input files are given to ffmpeg, if the 1st input has a duration, then this duration is returned by parseProgress. The bug happens when the 1st file is an image, the duration given by ffmpeg is 00:00:00:04, so the progress ratio calculation is based on 00:00:00:04.
To Reproduce Steps to reproduce the behavior:
setProgress
,Expected behavior
ratio
returned here is supposed to be float between 0 and 1 that gives the progress of the run.Desktop (please complete the following information):
Additional context Console logs Test app: https://image-plus-audio-9g1l4hk4p-sylvain-reynaud.vercel.app/ Code app: https://github.com/sylvain-reynaud/image-plus-audio/blob/b7329a1dcb12f07106a505268956ceaf089a28aa/src/routes/GenerateVideoButton.svelte#L12
Possible solution Check if
d >= 1
here to skip image durations.