This is how to encode a workraw in 2 [or more] threads without needing any scripts or avisynth



• Create wr2.bat, type in:

x264 --video-filter resize:640,360,method=bilinear --qp 35 --preset ultrafast --scenecut 98 --min-keyint 1 --keyint 600 --seek %2 --frames 20000 -o %1_wr%2.mkv %1


• Create wraw.bat, type in:

start wr2 %1_premux.mkv 0
start wr2 %1_premux.mkv 20000
@pause
start /wait mkvmerge -o %1_wrv.mkv -A %1_premux.mkv_wr0.mkv -A +%1_premux.mkv_wr20000.mkv


• Have wr2.bat, wraw.bat, x264.exe [8-bit] and ??????_premux.mkv in the same folder


• open cmd.exe, type "wraw ??????"

2 encoding processes will start, first window will show "press any key to continue..."

• wait for both processes to finish & then press any key in the first window. done.




?????? is the episode name/number in standard Commie premux naming,
for example for shana20_premux.mkw you type wraw shana20
I do this to avoid having to type/copypaste the _premux.mkv part
this can, of course, be modified to suit your needs [if you understand how it works]



_______________________________________________________________________________________________


How it works...

wr2.bat says
"encode 20000 frames of this premux, starting from a specified frame"

wraw.bat says
"use wr2.bat to encode premux starting on frame 0, same starting on frame 20000; merge them with mkvmerge"

2 encoding processes start simultaneously, one encodes 20000 frames from frame 0, the other from frame 20000
an episode usually has somewhere between 35000 and 38000 frames, so this is designed for that length
you could probably do well with the split point at 19000 instead of 20000, this is just in case

encoding speed totally depends on your CPU, but just for comparison...
my regular wr settings take 10 minutes to encode. the fastest settings [the ones used here but in 1 thread] get it down to 8 minutes. with 2 threads it's between 5 and 6 minutes. 1 thread alone uses about 60% of my CPU, which is why 2 threads don't double the speed.

if 1 thread takes 90% of your CPU, it's of little use to run 2 threads. [your PC just sucks. deal with it.]
if it's under 40%, you can make use of more than 2 threads.

for example if you want to use 4 threads, you'll modify like this:

in wr2.bat change --frames 20000 to --frames 10000

wraw.bat will be:

start wr2 %1_premux.mkv 0
start wr2 %1_premux.mkv 10000
start wr2 %1_premux.mkv 20000
start wr2 %1_premux.mkv 30000
@pause
start /wait mkvmerge -o %1_wrv.mkv -A %1_premux.mkv_wr0.mkv -A +%1_premux.mkv_wr10000.mkv -A %1_premux.mkv_wr20000.mkv -A +%1_premux.mkv_wr30000.mkv



if you need to work with differently named premuxes, change the first lines in wraw.bat to "start wr2 %1 0" etc, mkvmerge lines to "-A %1_wr0.mkv", and use "wraw wholefilename.mkv" as a command line
[in other words remove all _premux.mkv from wraw.bat] [don't change anything in wr2.bat]
[if there are spaces in the filename, you have to use quotation marks: wraw "whole file name.mkv"]

I hope this is detailed enough so that even people more technically challenged than me can get it