Progress dialog closes early

I have a few custom commands in a menu button that runs ffmpeg on selected files, for instance:

cd {destpath$}
C:\Users\BobM\bin\ffmpeg.exe -i "{filepath$}" -codec:a libvorbis -q 6.0 -vn "{file|noext}.ogg"

When I select a bunch of files and run this, I get the progress bar dialog showing me what file it's working on, but it always closes before the last file. If I select 10 files, after the 9th finishes processing the progress bar disappears at the start of the 10th file as if the batch is done. In this case since I'm running a process that takes some time, ffmpeg is really still running working on the 10th file, and I just have to figure it out myself when it's done (by CPU usage, or seeing the destination file size stop changing, etc)

Any way to make the progress show me the last file and stay up until the command actually finishes and exits?

Try prefixing the line with @sync:

@sync:C:\Users\BobM\bin\ffmpeg.exe ....

Also note that the progress dialog in that situation will tell you:

  • The name of the file it's currently waiting for the other program to process.
  • A bar showing the percentage of files done out of the total.

Once the last file is done, the progress dialog will close instantly, so you'll never see it reach 100%.

To put it another way, the progress bar tells you how many files have finished, not how many have started.

@sync: may still affect if the progress dialog stays around for the final file, and can also be required for non-command-line tools that detach by default.

1 Like