Lathe
13th March 2019, 05:58
Okay, I promise I've been searching and trying to find a simple script just to take a bunch of tele episodes that I want to reduce in size and re-encode them all. It's been about 2 hrs and I keep coming upon stuff that is WAY more complex than I need.
Here is the simple script I want to use for all the MKV files in a folder that are roughly about 500 megs each and I wish to reduce them to anywhere around 50-150 megs, which this script has been generating for the individual files:
F:\EXECUTABLES\BD-RBV05023\BD_Rebuilder\Tools\x264L.exe "C:\x\00000.mkv" --preset veryfast --crf 24 --output "C:\x\Encode.mkv"
I'm just using the x264.exe that JDobbs has in his BDRB folder.
Now, the closest I got was some guy gave a script similar to this to 'automate' it so that it would encode all the files in a folder and place the resulting files in another folder. I tried running it, but since I do not understand all the commands, of course I got errors. here is what he posted, or something like this:
FOR /R "C:\input-folder" %%i IN ("*.*") DO "C:\Program Files\HandBrake\HandBrakeCLI.exe" -i "C:\input-folder\%%~ni.avi" -t 1 -c 1 -o "D:\output-folder\%%~ni.mkv" -f mkv --strict-anamorphic -e x264 -S 160 -2 -a 1 -E lame -6 stereo -R Auto -B 112 -D 0.0 -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1
Now, he is using Handbrake, which I don't need, so I substituted my 264.exe file instead. I also did not need all those encoding parameters, so I TRIED to take what I THOUGHT was unneeded out (clearly I didn't do it right :)) I sort of ended up with this:
FOR /R "D:\x" %% IN ("*.*") DO "F:\EXECUTABLES\BD-RBV05023\BD_Rebuilder\Tools\x264L.exe" "D:\x\%%~ni.mkv" --output "D:\output-folder\%%~ni.mkv" --preset veryfast --crf 24 -v 1
But, of course it didn't work. The first error listed in the CMD line was it didn't recognize %%. And, then it couldn't open the input MKVs as listed. And, I have NO bloody idea what that command is and I do NOT know what the 'v 1' at the end it either, but I left it in because it was after the encode parameters he was using.
So, all I really need is a VERY VERY simple way to take the extremely simple re-encode script that I am using above and be able to re-encode all the MKV files in one folder and output the re-encoded MKV files to another folder.
That's it!
There HAS to be a LOT easier way than this :)
Now, if there is an EASY way for the existing audio to be remuxed with the re-encoded file as it processes, well, that would be nice. Otherwise I will simply manually remux the audio of each file when the video re-encodes are done using MKVMerge. But, IF that can easily be automated too, then great! As long as it doesn't get too complicated for me...
I very much appreciate the help! A batch file would be fine that I could simple click on after dumping whatever MKV files into the input folder that I want to re-encode.
Thanks kindly! http://lathe-of-heaven.com/tiphat.gif
Here is the simple script I want to use for all the MKV files in a folder that are roughly about 500 megs each and I wish to reduce them to anywhere around 50-150 megs, which this script has been generating for the individual files:
F:\EXECUTABLES\BD-RBV05023\BD_Rebuilder\Tools\x264L.exe "C:\x\00000.mkv" --preset veryfast --crf 24 --output "C:\x\Encode.mkv"
I'm just using the x264.exe that JDobbs has in his BDRB folder.
Now, the closest I got was some guy gave a script similar to this to 'automate' it so that it would encode all the files in a folder and place the resulting files in another folder. I tried running it, but since I do not understand all the commands, of course I got errors. here is what he posted, or something like this:
FOR /R "C:\input-folder" %%i IN ("*.*") DO "C:\Program Files\HandBrake\HandBrakeCLI.exe" -i "C:\input-folder\%%~ni.avi" -t 1 -c 1 -o "D:\output-folder\%%~ni.mkv" -f mkv --strict-anamorphic -e x264 -S 160 -2 -a 1 -E lame -6 stereo -R Auto -B 112 -D 0.0 -x ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 -v 1
Now, he is using Handbrake, which I don't need, so I substituted my 264.exe file instead. I also did not need all those encoding parameters, so I TRIED to take what I THOUGHT was unneeded out (clearly I didn't do it right :)) I sort of ended up with this:
FOR /R "D:\x" %% IN ("*.*") DO "F:\EXECUTABLES\BD-RBV05023\BD_Rebuilder\Tools\x264L.exe" "D:\x\%%~ni.mkv" --output "D:\output-folder\%%~ni.mkv" --preset veryfast --crf 24 -v 1
But, of course it didn't work. The first error listed in the CMD line was it didn't recognize %%. And, then it couldn't open the input MKVs as listed. And, I have NO bloody idea what that command is and I do NOT know what the 'v 1' at the end it either, but I left it in because it was after the encode parameters he was using.
So, all I really need is a VERY VERY simple way to take the extremely simple re-encode script that I am using above and be able to re-encode all the MKV files in one folder and output the re-encoded MKV files to another folder.
That's it!
There HAS to be a LOT easier way than this :)
Now, if there is an EASY way for the existing audio to be remuxed with the re-encoded file as it processes, well, that would be nice. Otherwise I will simply manually remux the audio of each file when the video re-encodes are done using MKVMerge. But, IF that can easily be automated too, then great! As long as it doesn't get too complicated for me...
I very much appreciate the help! A batch file would be fine that I could simple click on after dumping whatever MKV files into the input folder that I want to re-encode.
Thanks kindly! http://lathe-of-heaven.com/tiphat.gif