0

i am new to batch file scripting.i want to convert multiple .flv files to .mp4 using a third party tool ex handbrake. steps i should follow are 1. Keep the .flv files in a folder 2. Let the batch file call the folder and the convert it(using third party tool) and push back with .mp4 format.

1 Answer 1

1

First you should take a look at this website: https://trac.handbrake.fr/wiki/CLIGuide

There you can find how to communicate with your tool using the command line to select encoding, input and output file and so on. So your first task is to find out how to convert one file and store it in the desired directory. So till now there is nothing about batch scripting but about using the command line tool of handbrake. I can't help you with that so you will have to read and find out on your own.

Now let's get to the actual batch scripting part this scetion is about: You will have to iterate over all .flv files in a folder and perform an operation on each of them. Here's how you can do it:

FOR %%i IN (PATH\TO\YOUR\FOLDER\*.flv) DO ( REM put the handbrake specific command line in here to convert yout files REM you can use %%i to access the filename ) 

So your batch file migh look something like this:

@ECHO OFF FOR %%i IN (C:\Users\XXX\Desktop\Videos\*.flv) DO ( C:\HandBrake\HandBrakeCLI.exe -i %%i -o %%i.mp4 -e x264 -q 20 -B 160 ) 

I'm not sure about the HandBrakeCLI command line. Didn't try it, just guessed it from the guide website.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.