Batch ffmpeg auto convert

central10

Born

Posts: 3

3+ Months Ago

Hello everyone,

Over the past few days I have been trying to automate the ffmpeg conversion process to save my self some time.

I have a monitoring program that automatically executes/runs a program every time a video file is added to a folder. What I have done is created a bat file named “auto.bat” which is being run automatically by the program every time a file is added to the folder.

This bat file works if I drag and drop the avi file into it however this isn’t how I want it to function. I would like the batch file to automatically grab the new file in the folder and start ffmpeg. I’ve poked around on the Internet and can’t seem to find a solution. I’m new to writing batch files so I don’t have the expertise to finish this off. I’m wondering if someone can guide me in the right direction.

Any help would be greatly appreciated.Regards,Dave

joebert

Genius

Posts: 13511

Loc: Florida

3+ Months Ago

I didn't think of this when I responded to your PM before, but where are you entering the name of the *.bat file that your program executes ?

Does this program have some sort of argument tokens for the filename ?

I'm wondering if you could replace the %1 in that piece of code you have there, with whatever tokens your application would have you passing to the *.bat file, and then just point your monitoring application at that command instead of the *.bat file.

central10

Born

Posts: 3

3+ Months Ago

Hello,

I am entering the name of the “auto.bat” file in the required field in the program. This program doesn’t have any arguments for the file and simply runs any program upon addition of a new file. So I am unable to replace the %1 with any arguments that might allow me to “use” the newly added file.

Any other ideas?

joebert

Genius

Posts: 13511

Loc: Florida

3+ Months Ago

If your monitor doesn't pass the filename to the scheduled program in some way shape or form, you're going to need a different monitoring program.

central10

Born

Posts: 3

3+ Months Ago

Hello,

So I've almost got this batch file working now. The problem I am having is that the batch script is grabbing files in the folder based on the modification date. I need it to grab files based on it's creation date. For instance “fileone.avi” was modified on 5/12/2010 1:33 PM while “filetwo.avi” was modified on 5/11/2010 11:33 AM. Regardless if “filetwo.avi” was created after fileone.avi, fileone.avi will be taken by ffmpeg because it’s modification date was more recent.