StaxRip 10bitHEVC


I have been getting asked almost daily: "How do you encode 10bit color?", "What settings do you use exactly in StaxRip?". I am surprised and flattered. I will try to write this up here. This will be my settings with screen shots that I use for TV Shows and Movies. 

This is not a place to debate whether or not my settings are correct. This is to answer those folks who like my settings and want to know how. Please do not comment or argue about my settings. Thank you.


Be warned. My encodes take a lot of time. StaxRip is more comprehensive and does more steps than encoders like Handbrake, and thus takes longer. It takes both more of your time setting up and more time encoding. An upside is that StaxRip makes the components separately in a temp folder and then mux's those together, this can allow recovery or piecing together files later. My settings run at about 12fps on a i7 @ 3.7GHz and 3fps on a i5 @ 2.5GHz. That comes out to 5 to 6 hours or more to encode a movie on the i7.

A much simpler software is Handbrake. If this seems overwhelming I recommend trying that. I made a tutorial: How to Encode in Handbrake Like JoyBell (x265/HEVC)


Software:
StaxRip
https://github.com/stax76/st...tag/StaxRip_x64_1.3.1.7_beta

That's it!
Install StaxRip, and let's get started. It includes all the needed other softwares.

Short Version:
2 pass x265 @ 1500kbs Medium setting
HE-AAC 5.1 256kbs

Long Version (aka The Index)
Lessons broken up into tasks. Start with HEVC Template and then TWD Example!
Create a Basic HEVC Template
Encoding TWD Example
Batch Encoding a TV Season
Encode an Entire Blu-ray Disk
Muxing in More Content wi...lNix (Subs & Tracks)
Encoding Extras from a Blu-ray

 

Let's start by setting up a basic template. 

Open StaxRip with no source selected. 
For the filter section set Source to Automatic.
In the right center pane click the encoder to x265.
image
In the Encoder Options, selection Depth 10bit, Mode 2 Pass. Click OK to close.
image
Now Left Click on x265 which is underlined and bring up video encoder profiles.
image
Click Add, leave Current Project, Click OK, enter "x265 2 pass 10bit", Click Ok, and Ok again to close the panels.
image
Now on to setting up audio. To the right of "AAC VBR 2.0 ~ 115 Kbps" click Edit.
Set all your settings to match the ones in the picture below. Encoder qaaq. Channels 6 (5.1), Normalize, Constrained VBR, High, Check High Efficiency.
image
The Audio should now read "AAC 5.1 192 Kbps", left click on it, then click edit profile. Click Add, Current Project, OK, Edit the Name to "HE-AAC 5.1 192 Kbps", OK.
image
Now we will click on the second audio box "AAC VBR 2.0 ~ 115 Kpbs" edit button. 
Select encoder automatic, channels 2, check Normalize, Stereo Downmix DPL II, Bitrate 64.
Note: If the bitrate box is grayed out, go one box down and put Quality 0.21
image
Make a profile like above, save as "HE-AAC Commentary"
Set Video Bitrate to 900. At this point your StaxRip should look like this.
Note: StaxRip templates always ignore the Video Bitrate and go based off of the File Size, you always need to set them.
image
Time to go to Options, Subtitles, check Convert Sup to Sub. Change Auto load subtitles to "all". This will save time an space later. Converting all PGS subs from 20-50MB files to 50-100KB files and including them in your rips. Click Ok
image
Time to save all this as a Template. Go to Project, Save as Template, enter "x265 10bit 2 Pass", check Load template on startup, click OK.
image

All of that just to make your basic starter template.
 Next we will make our fist encode.

 

Encoding an episode of The Walking Dead
This lesson assumes you completed Create a Basic HEVC Template


Time for our first encode. 
I have a request to fix an old episode of The Walking Dead so we'll work with that. This will be an example of how to encode a grainy source.

The files is:
the.walking.dead.s05e06.1080p.bluray.x264-rovers.mkv (3.27GB)

Normal settings for basic TV shows are 900kbs. However, grain is noise, noise is unpredictable, thus hard to compress. TWD is a near worse case scenario. The settings we will be using to make a half decent TWD episode (I really hate encoding this show) are: 1500kbs video, with degrain filter and grain tune settings.

Filter: Misc|Remove Grain
This will remove grain from the source before passing it on to the encoder. Of course this will make the file look smoother and loose some detail.

 

Video Encoder: Tune|Grain
This takes in all the grain from the source, and attempts to adjust the encoder to handle the grain in the encode it self.



Start by opening up StaxRip to our basic HEVC template. Left-click on Source -> Single File -> select your file to recode -> Click Open.
image
Note: StaxRip often bumps up against file name limits and folders within folders makes it that much worse. If you get an error, move to less folder depth or shorten the file/folder names.
If you are selecting a remote file like I am, you will get a message to select a local temp folder. Do so if needed.

Now we see the Demuxing dialog. This file only has one audio stream and no subs. We will just take it and click Ok.
image
StaxRip now demuxes the file into separate streams for audio and video and does some preliminary work. This will probably take a few minutes up to 10 for large files on slow hard drives.
image
When completed we are greeted with the image below. Notice how thanks to our default template from my first StaxRip Lesson, most of what we want is selected and filled out for us. Go us, go default on start-up templates!
image
Check Misc|Remove Grain.
Click on Tune under x265 and select Grain.
Click on Video Bitrate box and type in 1500.
image

Rovers didn't include any subs for this one. Let's take care of that by downloading and adding English subs.
I just go to http://subscene.com/ and searched for my title in this case "The Walking Dead"
image
Just scroll until you find what you are looking for. In this case Season 5. Click on that.
The art to finding subs is to try and find ones that best match your given source. Ideally I would find English subs for a Rovers Blu-ray. Baring that I would try any Blu-ray subs for that season. Baring that I would try web-dl subs. 
Today we are lucky and find, what we are looking for.
image
Clicking on that link brings me to a short description and a link to download the zipped files. I save them to the same folder as my source file and uncompress them into a folder.
Back to StaxRip, click on Container Options in the center right pane.
image
Now click Add and select your sub file.
StaxRip won't usually detect the language so choose English from the drop down menu.
image
Click OK.

Almost done. 
Click Target and select a destination and new file name.
image
Click Next in the bottom right corner and the job will be added to the queue.
image

Click Start and the encoding will begin with a text log.
image

Now in about 2H30M or so I will have an recode of that Rovers TWD episode, with added English Subs.

Results, Let's see how we did.
Source:
the.walking.dead.s05e06.1080p.bluray.x264-rovers (3270MB)
Encode:
The Walking Dead S05E06 Consumed (1080p x265 10bit Joy) (518MB)
My encode is only 15.8% the size of the Source. Let's see if we kept more than 15% of the quality.

3 Screenshots Rover's vs Joy's

imageimageimageimageimageimage

 

 

Batch Encoding a TV Season
This lesson assumes you completed Create a Basic HEVC Template & Encoding TWD Example

This is an extra lesson on how to batch encode files. As you have noticed just setting up StaxRip takes significant time as one has to wait for the initial demuxing before setting up the encode.
If a TV series isn't all over the place on episode lengths we can attempt to best guess what file size they should be for a given video bitrate plus audio. Remember StaxRip ignores the template video bitrate and goes off of the file size.

I am going to set up a batch encode for Terminator: The Sarah Connor Chronicles Season 2.

My Source:
Terminator.The.Sarah.Connor.Chronicles.2009.S02.BluRay.Remux.1080p.VC-1.DD.5.1-BMF (134 GB)

Open up StaxRip and your "x265 10bit 2 Pass" starter template should load up.
We are only going to need to change a few settings in the main panel.
With no source selected StaxRip has a base length of 90 minutes assumed. Since StaxRip ignores video bitrates we will have to use that to guess. We can estimate our average "Hour Long" TV show is going to be less than 45 minutes. Half of 90 minutes, this should be easy math.
image
Oh! But look. It is also showing an audio bitrate of zero right now. We will need to estimate the 192kbs as well. Just adding that 192 to the 900 gives us 1092 in the video bitrate field. Staxrip says a 90 minute show would be 707MB. Ok. Half that for 45 minutes gives 353MB, reasonable enough. I want a little wiggle room and I decide on 375MB for the file size and enter that into the Size field.
I also know that the Blu-ray for Sarah Connor has a bit of grain but not crazy amounts. I have two basic tools in StaxRip.

Filter: Misc|Remove Grain
This will remove grain from the source before passing it on to the encoder. Of course this will make the file look smoother and loose some detail.

 

Video Encoder: Tune|Grain
This takes in all the grain from the source, and attempts to adjust the encoder to handle the grain in the encode it self.


These blu-rays don't have a ton of grain, so I just choose Tune Grain this time.
We now have our StaxRip window looking like so.
image
Got to Project->Save as Template and name it "x265 Hour Show" or something.
Let's batch encode!
Select Source -> File Batch
image
Click Add -> Add Folders
image
Select your sources folder.
You will now see the file batch screen. Click OK.
image
... and I get the dreaded file name length error!
image
I now take a minute to move the files around and short the names.
... and I want to move it to my laptop from the server, and the 135GB is too big to toss on my SSD based ultra book.
... I take half the files and shorten the file names.
... it still takes 45 minutes to copy despite the Wireless AC.
image
I try again from the local folder. And it works this time. A moment to process and then we have the batch of jobs listed ready to go. If no jobs are running you can click Start. Or if you are like me I already have that TWD job running and I don't need to click anything as the jobs list will continue through the list.
image

 

Encode an Entire Blu-ray Disk
This lesson assumes you completed Create a Basic HEVC Template & Encoding TWD Example

This lesson will cover how to encode from a Blu-ray (physical, ISO, BDMV folder). The title movie with all tracks and subs, as well as the important extras.

Today, I have a downloaded torrent of a Blu-ray folder to work with: 
Torrent: Pan 2015 1080p BluRay AVC TrueHD 7 1 Atmos-RARBG 

Let's open this up in StaxRip: Click Source --> Blu-Ray Folder.
This will work on Blu-ray Folders as well as decrypted physical Blu-ray disks. Blu-ray disks can be decrypted with software such as Any DVD.
image
We are greeted with which Blu-ray play list to select. By default they seem to be sorted by length in StaxRip ignoring short tracks. I select the main movie.
image
A dialog box pops up asking if we want to change the name of movie, I usually shorten it to avoid the long file names issue. This will also be the name of the created temp folders.
image
If networked, you will be asked to choose a local folder for temp files.
Some processing will occur and then we will be presented with the list of audio and sub tracks to demux from the blu-rays movie.
Look, we have 7.1 Atmos audio! This audio can sometimes give us trouble so let us select output-->FLAC for that one. I have found doing so can help bridge encoding components.
Click All for the audio and Subs should already all be selected from out templates settings.
image
Click Ok. StaxRip will be busy for several minutes demuxing the content of the Blu-ray as well as making conversions of the PNG subs to IDX (from the templates settings).
When Done we are greeted with this StaxRip Screen. Almost every setting will need to be adjusted. No worries.
image
First thing with a movie to always remember to do is to check to see if it needs to be cropped. 
Click Crop from the top menu bar and an interface will open up. Seek to an image than does not have black on the edges of the frame. Click Menu in the bottom right corner, then Auto Crop, then hit Escape after it crops an area with pink bars to close the interface. 
image
In StaxRip, a check box in the left pane will now be on Crop. Also the image height shown in the center will be less.

Let us quickly do the Subs. Click on Container Options. 
For full blu-ray encodes, I like to use the actual PGS subs for the English track and left the rest the much smaller IDX (which our template settings automatically converted from the PSGs for us). Click the Add button and find the "Pan.2015 ID9 English.sup" file, click OK to add that to our subs.
image
We now have both the SUB and VobSub (IDX) versions of the ID9 English. Click the check box on the IDX one to remove the duplicate. Click OK to close the container panel.

Time to work on all these audio tracks we got from the Blu-ray.
Right click on the top of the two audio boxes and then select the ID3 English.flac file. This should be the main audio track.
We can check this track by right clicking the track name and selecting MediaInfo from the menu.
imageimage
Great, the Flac rip reports that it kept all 8 audio channels!
Click Edit to the right of that audio track.
We need to adjust some settings for the 7.1 Audio. Change the bitrate to 320, name the Stream to "English 7.1". If you click on the Channels menu, you will notice no option for more than 5.1. Don't worry. It works anyway. smile
image
If you like you can left click on "HE-AAC 5.1 192kbs" and select Edit Profile-->Add-->Current Project-->Ok. Name it "HE-AAC 7.1 320 Kbps" and click OK. This will save the 7.1 settings as a audio profile.
image
On to the rest of the audio tracks. Left click on the second audio track box. I see that the next track ID4 is also English. We should check to see what that is before we encode it.
image
Left click on the ID4 English Track to select it in the 2nd Audio Box. To check the track right click on it to bring up the menu and select Play Audio & Video. This will play the movie with that track. I do so, and learn it's the "English for Visually Impaired" Track. I choose not to include that in this encode. Glad I checked!
Left Click on the Second audio box. Select ID5 French. I choose to encode the foreign language tracks in stereo to save space. Click Edit and change the Encoder to Eac3to and the quality to 0.30 (the template should of had the commentary settings populated). This makes a decent stereo track which is only 70MB for this length of movie.
image
Now let's go to the 3rd audio box and set that up. Wait a tick! There is no 3rd audio box. How are we going to add all these audio tracks like you promised?!?
I will show you how I do it.
Right click on the French audio track and select Execute from the drop down menu. This will encode that audio with your settings.This is AWESOME. Why? It lets you check your audio settings with out spending all day encoding the whole movie. It also lets you encode the rest of these audio tracks.
image
Once that is done encoding the French Track, let's do the same settings and execute the Spanish and Portuguese tracks.

The last track is an English Commentary Track. Select the Commentary profile for that one.

Go to the Video Bitrate and type in 1500.
Note: You need to always file in the bit-rate, or you will get the default absolute file size!
Click on Target and rename the path and file, I choose: "Pan 2015 (1080p x265 10bit Joy)", as I am me.

Now StaxRip looks like this.
image

Time to click Next and start encoding this movie.

The encoding took about 7 hours to complete. Now we need to mux in those lost audio tracks. Go to the section below, and then when done come back here.
Muxing in More Content with MKVToolNix

We have our Pan movie with muxed in 3 extra audio tracks and more subs.

I did promise to encode the whole Blu-ray. Next steps are in the link below:
Encoding Extras from a Blu-ray
Do those and come on back for the results.

 

Encoding Extras from a Blu-ray
This lesson assumes you completed Encode an Entire Blu-ray Disk
For this tutorial we will need a new piece of software MakeMKV. A very useful tool for ripping blu-rays, it muxes the titles into MKV files losslessly. Download and install.

MakeMKV Webpage
Open up MakeMKV and click File --> Open Files
image
Go to the Blu-ray folder and the BDMV folder and select the index file. MakeMKV will read the info and populate the titles longer than 2 minutes by default (adjustable in a setting).
Let us select the titles other than the main movie (PAN - 12 Chapter(s), 28.0GB)
image
Select the output folder you want MakeMKV to rip too, and then click the Make MKV button to the right of the Output Folder.
MakeMKV will start processing. Should take a few minutes depending on your set up.
image
When that's done, go to the output folder and we have perfect MKV files.
Unfortunately they are just labeled by number. It is up to you to watch them and come up with names for them. Often most of them will be junk. It's usually a bit of work finding the content from what MKV spits out from a Blu-ray. Pan is being pretty nice, no garbage at all.
Often with in the first minute of an extra they will show a title on the screen. If not, just name the best you can.
I came up with these.
image
Now I have a few options on how to encode these.
I usually just use Handbrake. But this is a StaxRip tutorial.
Currently these are bigger than our encoded Pan movie. We need to shirk them down enough to be just nice little extras.
My normal two thoughts are:
Q28 Slow, HE-AAC 64kbs Stereo
or
600kbs 2 pass, HE-AAC 64kbs Stereo
The Q28 slow, will handle any situation but will always look kinda blah. (Ran @ 2.7 FSP on my machine taking forever!)
The 600kbs, will look great for the interviews, but probably pretty bad for the action movie trailer. (Usually runs at 17 FPS but takes two passes, still much faster than Q28 Slow)
Today, I choose the Two Pass 600kbs method.
Let's open up StaxRip with no source selected.
Click Options under x265 pane.
Set up the following: Preset Fast, Tune Grain, Mode 2 Pass.
image
Click OK to close that window.
Under filters check Field|TDeint (often extras are interlaced)
For the first Audio box choose the audio commentary preset.
For the second Audio box choose no audio.
Your StaxRip should be looking like this.
image
Click on Project --> Save as Template --> "Call it x265 Extras 600kbs" --> Click Ok
imageimage
Click Source --> File Batch --> Add Folder --> Add --> Your folder with the MakeMKV output --> OK.
image
Note: For me it asked for a local folder for every file in the batch. Recommend doing batch encodes from local files.
You should have those Extras added to you Jobs now.
Unfortunately StaxRip, doesn't handle batch encoding with 2 pass with varied file lengths. We need to load each file one at a time and set the video bitrate to 600kbs and then add the job back to the list with the Next Button.
It wouldn't take much more time and might be easier to just set up the extras one file at a time.

Encode those files.

Update: I gave up on the Q28 and decided to do them all 600kbs 2 Pass. Q28 would of allowed easy batch encoding, but took 6 hours just for the extras. Personally don't have time for that.

Finished files:
image

I did one of the extras both 600kbs and Q28.
Never Grow Up - The Ledgend of Pan Q28.mkv (128MB)
imageimage
Never Grow Up- The Ledgend of Pan.mkv (57.7MB)
imageimage

The Q28 looks better but took way too long and with Extra I want them small and quick. Maybe if I had hardware GPU encoding I would do them Q30 or something.

So with this technique I was able to include the Extras for only 192MBs.

Of course some times it's good to tweak the settings; for example when encoding a Music Video or a Movie Short.

 

 Muxing in More Content with MKVToolNix
This lesson is a section of
Encode an Entire Blu-ray Disk

This is part of my Tutorial where I encoded the Pan 2015 Blu-ray. I reference Pan files, I worked with. However, the instructions work generally for adding more audio and sub tracks to a encoded mkv file.

We need a tool called MKVToolNix. Here is the download link.
https://mkvtoolnix.download/

Install and open up MKVToolNix.
Drag and drop your encoded Pan movie, into MKVToolNix.
Next go to your temp folder and find the Spanish_out, French_out and Portuguese_out that we made earlier using the Audio Execute function. 
Drag and drop those into MKVToonNix.
image
For each of the files added find them in the bottom left pane. Select. Then we have to go to the right pane and select the correct language and "Default Track Flag" --> No. 
Note: Always check to make sure any added tracks are set to "Default Track Flag" --> No, else they will be defaulted.
I went to SubScene.com and downloaded more subs for Pan. Save them, unRAR them. Then we can drag them in just like the audio tracks.
image
Make sure to select the language in the right pane, select the default no. The latin character languages are easy and should work with the default character set. Other languages are trickier. Here I am adding Arabic subs. Scroll the right Properties pane down to Subtitles and Chapter Properties. Click the character button to open up select character set window. In the case of Arabic (also Persian) we select the Arabic character set.
image
Add any more subs you like, following the steps.

When done, click Start Muxing, to make your file with all your new content.

Last update:
30-03-2016 10:15
Author:
Karl Hudgell
Revision:
1.1
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Latest FAQs RSS

  1. Custom Button Card (23-11-2020 10:02)
  2. NodeJS on Raspberry Pi Zero (12-10-2020 12:47)
  3. Useful Notes (13-11-2019 12:51)
  4. Dockerized Download VM (30-01-2019 20:26)
  5. Jmeter + Performance Plugin + Jenkins Pipeline (16-02-2018 12:49)