ffmpeg-progressbar-cli
ffmpeg-progressbar-cli copied to clipboard
Cannot execute ffmpeg command
So, I've created a windows batch file to encode multiple files....for testing purpose I have renamed the files to video1.mp4 and video2.mp4.
- In ffmpeg the progress works as intended, it processes
video1.mp42 times (it is ment to do so), and then continues withvideo2.mp4 - in ffmpeg-bar it processes
video1.mp41 time, and then gives me this error
video1.mp4: No such file or directory
and then gives me this error for video2.mp4
video2.mp4: No such file or directory
It seems like a strange bug, given that using pure ffmpeg works just fine...
Show us the script. I've seen this before when concatenating a command in various parts by feeding parts of it into variables and then stringing them all together at the end.
eg:
cmd1="ffmpeg-bar -i $input"
cmd2=" -foo bar"
cmd3=" -f mp4 $exportName"
${cmd1}${cmd2}${cmd3}
...fails with your error (iirc)
bash -c "${cmd1}${cmd2}${cmd3}"
works...but
eval "${cmd1}${cmd2}${cmd3}"
is slightly more elegant
Not sure if your error relates to ffmpeg-bar in your case, but sometimes the way you structure the command requires that you execute it as above....so it might be your issue. ...Show us the actual script.
in my case I'm actually running a .bat script from my computer. The script is very long, but I think the issue arrises from the fact that I use CALL :playlist to start a function reusable function...using ffmpeg-bar without this statement or ffmpeg with the statement works...but using ffmpeg-bar with this statement does not work...giving me the error Invalid attempt to call batch label outside a batch script
Testing
I've made a simplified scripts that has the same issue.
To test, you have to create a .bat eg. test.bat file with this contents, have 2x .mp4 in the same folder, i've called them video1.mp4 and video2.mp4. You can use any video files, but smaller files takes shorter time to test with. I used the 1.5MB file from https://file-examples.com/index.php/sample-video-files/sample-mp4-files/
The Script
@ECHO OFF
FOR /f "tokens=*" %%f IN ('DIR /B /A-D /O:N *.mp4') DO (
ffmpeg-bar -i "%%f" "%%~nf_output.mp4"
PAUSE
CALL :playlist
PAUSE
)
PAUSE
:playlist
ECHO playlistMethod
EXIT /B 0
Folder Preview

I was wrong, this is not the issue....the issue arrises from the fact that I need to write CALL in front of ffmpeg-bar in order for this to work. And then, if you use % to use an ffmpeg-variable template it stopps working...and writing %% to escape the variable does not work...even though it should work
example
CALL ffmpeg-bar (...) -segment_format hls "stream%05.ts"
So replacing that with "stream%%05.ts" should work, but because of the call statement it does not.