1. #Script created by ocnlogan, as part of Logans Learnings #1: Scripting handbrake in windows.
  2. #Creating a variable to store the path to all of the source files that will be encoded.
  3. #Change the text below (inside the quotes) to reflect where your files are located
  4. $inputpath = "I:\S"
  5. #getting the output path for the movies. Change this to what you would like it to say.
  6. $outputpath = "I:\E"
  7. #grabbing the filenames of all of the movies in the folder you just provided.
  8. $movies = ls $inputpath
  9. #The actual logic of the script.
  10. #starting to loop through each movie in your list of movies
  11. foreach($movie in $movies){
  12. #getting the name of the movie, without the file type added to the end.
  13. $name = $movie.basename
  14. #checking to see if the current movie has already been converted, and is sitting in the output folder.
  15. #this allows you to run the script repeatedly, without it wasting time converting something that is already done.
  16. if(!(test-path -path "$outputpath\$name.mkv")){
  17. #the actual command used to start handbrake, and encode/compress a movie.
  18. #Adjust these settings as necessary.
  19. #These are what I use when encoding, but YMMV for your application
  20. 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 --
  21. decomb --loose-anamorphic -m -x rc-
  22. lookahead=30:ref=4:bframes=3:me=umh:subme=9:analyse=none:deblock=1:0:0:8x8dct=1
  23. }
  24. }
  25. </pre> </code>
  26. So, the whole process of automation goes to null.
  27. *HandBrake* has exited.
  28. Have you any suggestions?