Running commands from bash scripts 50% slower than running them directly?

Viewed 20

Windows 11 here. Running ffmpeg transcodes from Cygwin. If I just run them from the command prompt, I get 100% cpu utilization, but if I just put it in a bash script I get ~50% cpu utilization.

So I chained a multi-line command and that works but I need to transcode hundreds of clips and it's cumbersome to use.

I also tried Perl and have the same slowdown.

I tried forcing the number of threads ffmpeg should use, but it did not make a difference.

Any suggestions?

1 Answers

Turns out it was a conflict with paths, I have two versions of ffmpeg installed, and depending on how it was called it would run a different version.

eg.

perl -e "`ffmpeg`"

Will run the updated version.

perl -e "foreach(0 .. 5){`ffmpeg`}"

Would run the outdated version.

Running ffmpeg straight in the console would use the new version, running it from a bash script would run the outdated one.

Related