- #Script created by ocnlogan, as part of Logans Learnings #1: Scripting handbrake in windows.
- #Creating a variable to store the path to all of the source files that will be encoded.
- #Change the text below (inside the quotes) to reflect where your files are located
- $inputpath = "I:\S"
- #getting the output path for the movies. Change this to what you would like it to say.
- $outputpath = "I:\E"
- #grabbing the filenames of all of the movies in the folder you just provided.
- $movies = ls $inputpath
- #The actual logic of the script.
- #starting to loop through each movie in your list of movies
- foreach($movie in $movies){
- #getting the name of the movie, without the file type added to the end.
- $name = $movie.basename
- #checking to see if the current movie has already been converted, and is sitting in the output folder.
- #this allows you to run the script repeatedly, without it wasting time converting something that is already done.
- if(!(test-path -path "$outputpath\$name.mkv")){
- #the actual command used to start handbrake, and encode/compress a movie.
- #Adjust these settings as necessary.
- #These are what I use when encoding, but YMMV for your application
- C:\"Program Files"\handbrake\HandBrakeCLI.exe -i "$inputpath\$movie" -o "$outputpath\$name.mkv"-e x264 -b 1000 -2 -T -a 1,1 -E mp3 -B 112 --mixdown stereo -f mkv --detelecine --
- decomb --loose-anamorphic -m -x rc-
- lookahead=30:ref=4:bframes=3:me=umh:subme=9:analyse=none:deblock=1:0:0:8x8dct=1
- }
- }
- </pre> </code>
- So, the whole process of automation goes to null.
- *HandBrake* has exited.
- Have you any suggestions?