Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot execute ffmpeg command #7

Open
ghost opened this issue Sep 7, 2019 · 3 comments
Open

Cannot execute ffmpeg command #7

ghost opened this issue Sep 7, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 7, 2019

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.mp4 2 times (it is ment to do so), and then continues with video2.mp4
  • in ffmpeg-bar it processes video1.mp4 1 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...

@BETLOG
Copy link

BETLOG commented Aug 11, 2020

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.

@ghost
Copy link
Author

ghost commented Aug 11, 2020

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

image

@ghost
Copy link
Author

ghost commented Aug 11, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant