OT: Can someone pls help with a small batch file?

NickHope wrote on 4/20/2008, 12:28 AM
I have the following files in a folder:

mp4creatorqtf.exe
mp4box.exe
video.264
audio.mp4

I want to run this command:

mp4creatorqtf -c video.264 -rate=25 -qtw=853 -qth=480 video-qtf.mp4


...and then use the output in this command:

mp4box -add "video-qtf.mp4"#1 -add "audio.mp4"#1 -new "video-qtf-bufferfix.mp4"


Anyone of you DOS types know what the syntax of the batch file should be? I can't get it working but I've not done much with batch files before. The 2 individual lines work but I have a lot of files to do and I keep making typing mistakes.

Thanks!

Comments

farss wrote on 4/20/2008, 1:02 AM
If you put each line in it's own batch file would get you started.
Have you tried doing that, if so what happens?

This page here:
http://www.computerhope.com/sethlp.htm#04

might be of some help.
I assume you want one batch file that you can run with just the name of the file to process and have it do the whole process for you.

If I wasn't so rusty on this I could probably help you write a batch file that'd simply process all the files in one folder and send the output to another folder.

Probably one of the Johns can help you better than I can but they're probably deservedly asleep.

Bob.
NickHope wrote on 4/20/2008, 2:44 AM
I tried a few things bob and it just bombs out. Command window flashes up and disappears and no new files are created.

Maybe I need to pipe the output of the first command into the 2nd command or something. I read a couple of batch file tutorials but this sort of thing wasn't covered.

I'm experimenting with anamorphic PAR1.333 x264 H.264 in Flash and I'll only need this batch file if I decide to go with it instead of square pixels. But at the moment there are drawbacks and I'm struggling to see a quality benefit.

I expect that batch file will be child's play to someone here.
Terje wrote on 4/20/2008, 4:24 AM
Command window flashes up and disappears and no new files are created.

Don't run the command file by double clicking on it, run it from the command line, then you will be able to see any error messages.
TheHappyFriar wrote on 4/20/2008, 4:43 AM
or put a "pause" after each command is run:


mp4creatorqtf -c video.264 -rate=25 -qtw=853 -qth=480 video-qtf.mp4
pause
mp4box -add "video-qtf.mp4"#1 -add "audio.mp4"#1 -new "video-qtf-bufferfix.mp4"
pause


but the program may not support long file names, so you'd need to re-name your videos to 8 letters or less + extension.

plus you need to make sure the batch file (whatever.bat OR whatever.cmd, but .cmd can't be run via command line I think), video files & programs files are all in the same directory, unless you specify paths.
johnmeyer wrote on 4/20/2008, 9:51 AM
Go to the Run command in the Start button, and type "CMD" and press Enter. Run your batch file directly from the command line. That way, if there are error messages you can read them.

While there are dozens of "tricks" for writing batch files (FOR loops, branching, variables using the "%" sign, etc.), it looks to me as though you just trying to pass some fixed parameters to two programs. Now, it also looks like you have quite a few basic syntax errors, so if you run the batch file directly from the program file as I suggest, hopefully those will become evident. In particular, you probably need to have a space before each dash character (which you don't) and also, I don't know what the "#" charcter is used for, unless it is something specifically required by the mp4box probram. Finally, you have to be careful about how quotes are used. I'm not saying that they aren't needed, but they may not be.