Issue with creating a basic-ish .bat file (Win7 64bit)


Recommended Posts

Ok I can't for the life of me figure this out. I've asked a few others that deal with ffmpeg and they dont know either. Maybe we're all stupid. I haven't written a batch file in years. What I'm doing with ffmpeg is irrelevant. It's the fact that I can't figure out why the PAUSE command isn't working.

 a v

Ok, in the Control Panel , under the Environment Variables, user variables section, I have a variable called PATH, with the value as E:\FFMPEG , so i can run E:\FFMPEG\ffmpeg.bat wherever. I have, well had, several .flv files in the root E:\ directory, along with a .bat file I created. It's stated as follows:

 

@ECHO OFF
ffmpeg -i %~n1.flv -vcodec copy -acodec copy %~n1.mp4
PAUSE
 
That way I just dragged a file onto the .bat and it converted them one at a time. Worked fine,...'cept it wouldn't PAUSE. The CMD just shut down right after it was done so I couldn't read anything if I needed to. I've tried several different approaches but nothing works. What am I missing?

 

 

Link to comment
Share on other sites

Does the command "ffmpeg -i %~n1.flv -vcodec copy -acodec copy %~n1.mp4" acutally work, or give an error?

If it does work, try this:

@ECHO OFF
call ffmpeg -i %~n1.flv -vcodec copy -acodec copy %~n1.mp4
PAUSE
Link to comment
Share on other sites

No, the batch file itself works fine, I just can't get it to pause when it's done doing what it's doing. I'll try both and see what happens.

Link to comment
Share on other sites

Awesome. It was CALL. I've never used that before, but I looked it up and it makes sense. I'm running a script within a script with all those parameters for ffmpeg. Thanks!

Link to comment
Share on other sites

This topic is now closed to further replies.