Forums > Tutorials > Advanced x264 Encoding Guide (New Version)

#417783 by parent5446Donor (Elite) [ Jan 19 2012, 09:27 ] - [Quote] [Report Post]  
Default avatar
Note: The arcsoft decoder is no longer needed with the new version of eac3to.

Preface and License: Show

0. Setting Up the Encoding Environment
This section only needs to be followed once.
: Show

1. Ripping the Source
If you don't have a physical disc, i.e., you downloaded the DVD/Blu-ray from somewhere, skip this section.
: Show

2. Demuxing the Source
: Show

3. Transcoding Lossless Audio

This is only if your Blu-ray/concert DVD has lossless audio (PCM/DTS MA-HD/TrueHD) and you want the final encode to have wither AC3 or DTS audio.

: Show

4. Transcoding Commentary Audio
: Show

5. Preparing the Video:
: Show

6. x264 Settings:
: Show

7. Test Encodes:
: Show

8. Encoding the Entire Movie:
: Show

9. Extracting Chapter Markers:
: Show

10. Ripping Subtitles
: Show

11. Muxing Everything Together
: Show

Last but not least, play your file. If it's a good movie, consider watching the whole thing. Just make sure no problems occurred and that the movie looks like it is supposed to.

To Do: Show
Last edited by Nuked [ Apr 29 2016, 19:15 ]
#417822 by Ruinpeople (Torrent King) (Now Benson, I'm going to have to turn you into a dog for a while) [ Jan 19 2012, 13:30 ] - [Quote] [Report Post]  
Ruinpeople's avatar
This looks Great !

Will give it a try someday.
#417839 by brownt0wn (Stalky Stalkerton) (Gettin my ass whooped by Fluffles on the reg.) [ Jan 19 2012, 14:58 ] - [Quote] [Report Post]  
brownt0wn's avatar
lol at the license.
#417914 by stachio (Power User) [ Jan 19 2012, 17:05 ] - [Quote] [Report Post]  
Default avatar
A few clarifications,
parent5446 wrote:

The video is telecined (2 out of 5 frames looks interlaced).:
Add the following line to your script TFM().TDecimate().

The video is interlaced: Use
QTGMC()
SelectEven()


In the guide written by echohead it was mentioned to add TFM().TDecimate() if the source was NTSC, as it reduces fps from 29.97 to 23.97, maybe you could add this to remove any ambiguity and confusion to newbies. My reasoning is that most of the people trying their hand first time might not know what the terms telecine or interlaced mean or not know how to detect it.


I use YADIFMod(edeint=NNEDI3()) for interlaced sources, is there any difference/ which one is better if given an option?
Also, are you planning to provide a rough template regarding various parameters to be used for Film, Animation, CGI, Rotoscopic sources etc..?

Thanks for rewriting the guide to combine DVD and Blu-ray encoding processes in a single place


Edit: As Mushhead mentioned below, is resizing required in AvSP?
Last edited by stachio [ Jan 19 2012, 17:27 ]
#417918 by mushheadDonor (salty suck my balls) (DENMARK) [ Jan 19 2012, 17:16 ] - [Quote] [Report Post]  
mushhead's avatar
stachio wrote: View Post
A few clarifications,
parent5446 wrote:

The video is telecined (2 out of 5 frames looks interlaced).:
Add the following line to your script TFM().TDecimate().

The video is interlaced: Use
QTGMC()
SelectEven()


In the guide written by echohead it was mentioned to add TFM().TDecimate() if the source was NTSC, as it reduces fps from 29.97 to 23.97, maybe you could add this to remove any ambiguity and confusion to newbies. My reasoning is that most of the people trying their hand first time might not know what the terms telecine or interlaced mean or not know how to detect it.


I use YADIFMod(edeint=NNEDI3()) for interlaced sources, is there any difference/ which one is better if given an option?
Also, are you planning to provide a rough template regarding various parameters to be used for Film, Animation, CGI, Rotoscopic sources etc..?

Thanks for rewriting the guide to combine DVD and Blu-ray encoding processes in a single place

I also use NNEDI3 for deinterlacing and I'd have to agree that your description of telecining needs some expansion/explanation.
I also don't use the resize in AvsP
#417960 by parent5446Donor (Elite) [ Jan 19 2012, 19:25 ] - [Quote] [Report Post]  
Default avatar
stachio wrote: View Post
A few clarifications,
parent5446 wrote:

The video is telecined (2 out of 5 frames looks interlaced).:
Add the following line to your script TFM().TDecimate().

The video is interlaced: Use
QTGMC()
SelectEven()


In the guide written by echohead it was mentioned to add TFM().TDecimate() if the source was NTSC, as it reduces fps from 29.97 to 23.97, maybe you could add this to remove any ambiguity and confusion to newbies. My reasoning is that most of the people trying their hand first time might not know what the terms telecine or interlaced mean or not know how to detect it.


I use YADIFMod(edeint=NNEDI3()) for interlaced sources, is there any difference/ which one is better if given an option?
Also, are you planning to provide a rough template regarding various parameters to be used for Film, Animation, CGI, Rotoscopic sources etc..?

Thanks for rewriting the guide to combine DVD and Blu-ray encoding processes in a single place


Edit: As Mushhead mentioned below, is resizing required in AvSP?


You can use Yadifmod with NNEDI3, and I will add it in as an option. QTGMC is just a lot more intense and higher quality deinterlacer. I just figured since Yadif is what Handbrake uses we should be stepping up our game a little bit.

As for the telecine explanation, I totally see what you mean and will expand upon that promptly.

And for the resizing part, it was not mentioned in echohead's guide, but it is crucial that the final storage resolution of the video right before encoding is mod16. It generally does not affect quality, but when the resolution is not mod16, x264 will pad the video with its own data to get it to mod16, which usually results in a loss of compression. If you guys really feel that mod16 isn't worth it, I can make it optional or something, but it is something to think about as it does affect the final encode.
#417967 by mushheadDonor (salty suck my balls) (DENMARK) [ Jan 19 2012, 19:37 ] - [Quote] [Report Post]  
mushhead's avatar
I'm all for increasing quality but I was just using the settings agreed upon. If the consensus is to implement these additions then I'm all for it but what is the consequence as far as encoding time etc? As far as I'm aware there are only 3 of us with really powerful computers in the group that will remain able to do any encodes in a reasonable time with all of the higher settings.
I'm not sure if any of the changes will increase the time taken but it must be a consideration
#417973 by rik81h (Elite) (https://i.ibb.co/XyLNXjF/3z1ycx.gif) [ Jan 19 2012, 19:57 ] - [Quote] [Report Post]  
rik81h's avatar
Well i've just used:- QTGMC() SelectEven()on a 22 minute clip and only got like just under 4fps, normally i'd get just under 7-8fps with yadifmod. I run an amd b55 @3.6ghz for ref.
#417977 by parent5446Donor (Elite) [ Jan 19 2012, 20:01 ] - [Quote] [Report Post]  
Default avatar
Just a quite note: I removed the "--engage keep_bitstream_ar_info" from the MKVMerge CLI options. It seems from version 2.7.0 on that this has been changed to the default functionality and is no longer necessary.

rik81h wrote: View Post
Well i've just used:- QTGMC() SelectEven()on a 22 minute clip and only got like just under 4fps, normally i'd get just under 7-8fps with yadifmod. I run an amd b55 @3.6ghz for ref.


Try running Preset="Ultra Fast" (this actually causes QTGMC to use yadif as its deinterlacer )
Last edited by parent5446 [ Jan 19 2012, 20:31 ]
#418064 by mushheadDonor (salty suck my balls) (DENMARK) [ Jan 19 2012, 22:41 ] - [Quote] [Report Post]  
mushhead's avatar
I've just run through a few test encodes with the resize in place and when I play the outputs they are all stretched. That can't be right so obviously this doesn't work for me
#418282 by parent5446Donor (Elite) [ Jan 20 2012, 05:46 ] - [Quote] [Report Post]  
Default avatar
mushhead wrote: View Post
I've just run through a few test encodes with the resize in place and when I play the outputs they are all stretched. That can't be right so obviously this doesn't work for me


It has to do with a small mistake in the guide that I forgot to fix when copying stuff from my rewrite of the HD encoding guide. For DVD-sourced encodes, you have to one of two things: 1) change the target PAR in the resize calculator configuration so it resizes to the same SAR or 2) don't use the --sar option in x264. The difference is whether you want to convert the DVD to square pixels, though from what I'm found it is unnecessary and misleading to do so, so I put the first method in the guide. The guide now has the correct instructions.
#418832 by MailCook (Power User) (I'm calm.) [ Jan 21 2012, 12:32 ] - [Quote] [Report Post]  
MailCook's avatar
I think this yadifmod thing should be eyes only test.
If picture looks interlaced then it should be applied.
Even on NTSC sources decimating filter is enough most of the time.
Really, DGIndex is almost never correct about interlaced source.
Most of the time there's no need for yadifmod.
I applied it on my 20000 leagues encode as DGIndex showed it was interlaced on a batch of test frames.
And it ruined the picture when the shiny treasure was shown. It looked like it interlaced(yes, interlaced) the picture which wasn't interlaced.
Last edited by MailCook [ Jan 21 2012, 12:32 ]
#418877 by rik81h (Elite) (https://i.ibb.co/XyLNXjF/3z1ycx.gif) [ Jan 21 2012, 16:30 ] - [Quote] [Report Post]  
rik81h's avatar
@mailcook I have since taken your advice about visually checking instead of just believing dg index and it is apparent on some of the material i've been doing-extras and concerts
#418911 by parent5446Donor (Elite) [ Jan 21 2012, 17:59 ] - [Quote] [Report Post]  
Default avatar
MailCook wrote: View Post
I think this yadifmod thing should be eyes only test.
If picture looks interlaced then it should be applied.
Even on NTSC sources decimating filter is enough most of the time.
Really, DGIndex is almost never correct about interlaced source.
Most of the time there's no need for yadifmod.
I applied it on my 20000 leagues encode as DGIndex showed it was interlaced on a batch of test frames.
And it ruined the picture when the shiny treasure was shown. It looked like it interlaced(yes, interlaced) the picture which wasn't interlaced.


Oh I totally agree. And it's not just DGIndex. There was a Blu-ray (yes Blu-ray, as in a BD50), where eac3to said the video was interlaced, yet when you bring it into Avisynth, it's perfectly progressive. XD
#419054 by dot_commieDonor (Power User) [ Jan 21 2012, 23:33 ] - [Quote] [Report Post]  
dot_commie's avatar
Crossposting from a TBB thread:

Here's just one comparison between yadifmod(edeint=NNEDI3()) and QTGMC()

You decide:
Nothing vs QTGMC: http://screenshotcomparison.com/comparison/104102
Nothing vs YADIF: http://screenshotcomparison.com/comparison/104104
QTGMC vs YADIF: http://screenshotcomparison.com/comparison/104105
#419247 by parent5446Donor (Elite) [ Jan 22 2012, 06:51 ] - [Quote] [Report Post]  
Default avatar
Note: I've changed the resizing section. Lately I've been reading that the mod16 resolution, while it does provide better compression, is not worth the scaling artifacts caused by resizing. I've kept information about resizing for those making HD-sourced SD encodes, but it is no longer part of every encode.
#419253 by zaplinaki (Torrent Master) (I don't know how to hat) [ Jan 22 2012, 07:03 ] - [Quote] [Report Post]  
zaplinaki's avatar
this looks great, thanks parent5446. Can we have a seperate guide for SD and HD, this might confuse loads of people.
Last edited by zaplinaki [ Jan 22 2012, 07:05 ]
#419258 by parent5446Donor (Elite) [ Jan 22 2012, 07:22 ] - [Quote] [Report Post]  
Default avatar
zaplinaki wrote: View Post
this looks great, thanks parent5446. Can we have a seperate guide for SD and HD, this might confuse loads of people.


Honestly, I think the idea of a combined guide is better. The problem with the two separate encoding guides is that people were only reading the one applicable to them, and then getting confused and asking questions that could have been answered by content included in the opposite guide. By having one central guide, information is centralized and standardized. Also, having two guides is a little redundant since 70% of the encoding process is exactly the same for SD and HD encodes.

If PTP really does want two separate guides, though, it shouldn't be hard. It would just mean copying and pasting this guide twice and then removing anything not necessary for the respective guide.
#419264 by mushheadDonor (salty suck my balls) (DENMARK) [ Jan 22 2012, 07:31 ] - [Quote] [Report Post]  
mushhead's avatar
I think it may be better to have two separate guides. You can always link to each other in the OP.

mushedit: Spelling!
Last edited by mushhead [ Jan 22 2012, 07:32 ]
#419362 by rik81h (Elite) (https://i.ibb.co/XyLNXjF/3z1ycx.gif) [ Jan 22 2012, 14:49 ] - [Quote] [Report Post]  
rik81h's avatar
My first thoughts (being someone who is learning this lot) was to have it separate, but then i worked through it all and to be honest it does flow properly when you're actually applying what you're reading. So my vote is one guide.....to rule them all lol
#419433 by pledgewiseDonorBanned (Torrent King) (You can't hurt me, not with my cheese helmet! ) [ Jan 22 2012, 17:46 ] - [Quote] [Report Post]  
pledgewise's avatar
Nice guide. Thanks
Typo: TFM().TDecimate().
correction: TFM().TDecimate()

#419461 by Voltaire (Legend) (Put out to pasture) [ Jan 22 2012, 18:28 ] - [Quote] [Report Post]  
Voltaire's avatar
I was just mentioning how we could use an updated guide, and lo and behold you've already written it! Great work parent5446. It looks fantastic. Well laid out, and informative.
#419504 by parent5446Donor (Elite) [ Jan 22 2012, 19:50 ] - [Quote] [Report Post]  
Default avatar
pledgewise wrote: View Post
Nice guide. Thanks
Typo: TFM().TDecimate().
correction: TFM().TDecimate()


Fixed.

Voltaire wrote: View Post
I was just mentioning how we could use an updated guide, and lo and behold you've already written it! Great work parent5446. It looks fantastic. Well laid out, and informative.


Thanks. Hopefully we'll end up with less confused encoders with this guide.
#419513 by dot_commieDonor (Power User) [ Jan 22 2012, 20:18 ] - [Quote] [Report Post]  
dot_commie's avatar
Can you explain more about sar? How to find it, what values to put in, etc. How does this relate to the ITU/Non-ITU as listed in echohead's tutorial?
#419523 by jmanrobDonor (Member) [ Jan 22 2012, 20:48 ] - [Quote] [Report Post]  
Default avatar
First off nice guide, lord mulders launcher works great on both 32-bit and 64-bits OS. I prefer using this over cmd .bat encoding.

--rc-lookahead 250

I've read somewhere, maybe Doom9... Setting this too high can be potentially bad, it provides basically zero benefit besides making you feel better.

maybe keep this at the default of 60


Thx for the guides

Forums > Tutorials > Advanced x264 Encoding Guide (New Version)