4-pass or 5-pass encoding?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
hsanchia
Posts: 2
Joined: Wed Jan 27, 2010 6:15 am

4-pass or 5-pass encoding?

Post by hsanchia »

Hi,

I'm new to HandBrake, mainly compressing DVD movies, using h.264 codec,
into very high quality but small sized MKV files.

Typically about 700MB.

I was wondering if 4-pass or 5-pass encoding were possible with HandBrake?
Then I might be able to compress down to 500MB - 600MB, while still retaining high-quality video.

Thanks.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: 4-pass or 5-pass encoding?

Post by TedJ »

No, Handbrake currently only supports 2-pass ABR encoding.

One could ask why you'd want to compress a movie to an arbitrary size, and why 700MB... The general consensus is that Constant Quality is the way to go.
User avatar
Rodeo
HandBrake Team
Posts: 12578
Joined: Tue Mar 03, 2009 8:55 pm

Re: 4-pass or 5-pass encoding?

Post by Rodeo »

Well, x264 only supports up to 3 passes. You could do 3-pass encoding with HandBrake, by doing three single passes and specifying the pass number and stats file location in the x264 options string.

Anyway, with a good encoder like x264, a third pass will have little effect on quality - definitely not enough to go from 700 down to 600 MB while retaining the quality. And even if it were supported, I'm pretty sure a 4th or 5th pass would have even less effect.
mduell
Veteran User
Posts: 7194
Joined: Sat Apr 21, 2007 8:54 pm

Re: 4-pass or 5-pass encoding?

Post by mduell »

Since you don't have an exact target, why not use CRF encoding with a lot of the high quality/slow advanced x264 options?
hsanchia
Posts: 2
Joined: Wed Jan 27, 2010 6:15 am

Re: 4-pass or 5-pass encoding?

Post by hsanchia »

I'm very curious how far, or how small a DVD movie can go down to, while retaining almost the exact same visual quality.
Mainly to archive my DVD collection, sometimes to upload high-quality MKVs in as small a file size as possible.

Once got a 5000 MB movie down to about 600 MB, and it still looked very good.
Almost couldn't tell them apart.
Took my quad-core PC almost 40 hours to encode. Too long.

Back then I was using XVID4PSP, which had something like a "3-pass Highest quality/Smallest File size" setting.
Just set it and go.
And it will encode till it gets the highest quality at the smallest file size possible.
The only problem with that program was that my audio disappeared.

I'll try out your suggestions - CRF, 3 single passes, and the various x264 options.

Thanks for all the advice, guys.
mduell
Veteran User
Posts: 7194
Joined: Sat Apr 21, 2007 8:54 pm

Re: 4-pass or 5-pass encoding?

Post by mduell »

Multiple passes is only applicable to ABR encoding. With CRF there's only 1 pass.
creamyhorror
Regular User
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: 4-pass or 5-pass encoding?

Post by creamyhorror »

x264 does not rely on multiple passes to gain additional quality - not to any significant extent. It's not like Xvid. 3 passes is dumb, just use CRF with slow, high-quality options.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: 4-pass or 5-pass encoding?

Post by jbrjake »

Rodeo wrote:Well, x264 only supports up to 3 passes.
x264 supports unlimited passes. pass=3 does not mean the third pass, it's more like a flag. 1==write, 2==read, 1+2 == write+read

Pass 1: --pass=1: write original stats file
Pass 2: --pass=3: read stats file and write stats file
Pass 3: --pass=3: read stats file and write stats file
...
Pass N-1: --pass=3: read stats file and write stats file
Pass N: --pass=2: read stats file and write final video (could use pass 3 here too to save final encode frame stats)

It's just pointless to do so, since even 3 passes negligibly improves output over 2 passes.
Wetnap
Posts: 29
Joined: Thu Jun 05, 2008 8:31 am

Re: 4-pass or 5-pass encoding?

Post by Wetnap »

hsanchia wrote:I'm very curious how far, or how small a DVD movie can go down to, while retaining almost the exact same visual quality.
Mainly to archive my DVD collection, sometimes to upload high-quality MKVs in as small a file size as possible.

Once got a 5000 MB movie down to about 600 MB, and it still looked very good.
Almost couldn't tell them apart.
Took my quad-core PC almost 40 hours to encode. Too long.

Back then I was using XVID4PSP, which had something like a "3-pass Highest quality/Smallest File size" setting.
Just set it and go.
And it will encode till it gets the highest quality at the smallest file size possible.
The only problem with that program was that my audio disappeared.

I'll try out your suggestions - CRF, 3 single passes, and the various x264 options.

Thanks for all the advice, guys.
quad core doing a dvd for 40 hours, its probably using a buttload of electricity. consider that cost vs the size you are trying to gain. using high profile and the extras like pyramidal b frames and sometimes other upped settings i rarely get a dvd that really will compress below 1gb and retain quality at 60cqr setting. at 600mb you are most certainly losing quality. perhaps you don't notice on a small screen.
User avatar
Rodeo
HandBrake Team
Posts: 12578
Joined: Tue Mar 03, 2009 8:55 pm

Re: 4-pass or 5-pass encoding?

Post by Rodeo »

hsanchia wrote:Back then I was using XVID4PSP, which had something like a "3-pass Highest quality/Smallest File size" setting.
x264 is not Xvid.

This was being discussed on IRC a while ago. Dark_Shikari pointed out that rather than adding a third, fourth or fifth pass, using slower settings had a much greater impact on quality; e.g. using 2.5x slower settings with the same number of passes will improve quality much more than going from 2->5 passes using the same settings.

Of course you can always do 5 passes using placebo ("maxed out") settings. To give you an idea of how slow this can be: on my 2.66 GHz Core 2 Duo iMac this would probably take at least 75 hours per DVD movie.
gersey
Posts: 13
Joined: Sat Feb 19, 2011 1:29 pm

Re: Pass=1?

Post by gersey »

jbrjake wrote: x264 supports unlimited passes. pass=3 does not mean the third pass, it's more like a flag. 1==write, 2==read, 1+2 == write+read

Pass 1: --pass=1: write original stats file
Pass 2: --pass=3: read stats file and write stats file
Pass 3: --pass=3: read stats file and write stats file
...
Pass N-1: --pass=3: read stats file and write stats file
Pass N: --pass=2: read stats file and write final video (could use pass 3 here too to save final encode frame stats)
Just finished a long two pass encode then noticed that the second pass was set to pass=1.
Ha, ha back where I was at the end of the first pass.

[1st pass=1] work: average encoding speed for job is 0.333056 fps
[2nd pass=1] work: average encoding speed for job is 0.514178 fps

The thing is, second first pass encoded much faster than first first pass. I think x264 is taking advantage of the stats file even for pass=1.

I wonder if

Code: Select all

Pass 1: --pass=1: write original stats file
should be amended to

Code: Select all

Pass 1: --pass=1: read stats file write original stats file
Maybe there are times when it could be useful reuse a stats file for a first pass.
MisterPINK
Posts: 8
Joined: Mon Jan 10, 2011 8:39 am

Re: 4-pass or 5-pass encoding?

Post by MisterPINK »

Something strange.... if handbrake doesnt support 3pass+
then why is it that im right now encoding in 3rd pass.....

whats the settings for the 3rd pass?
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: 4-pass or 5-pass encoding?

Post by TedJ »

Did you do an initial subtitle scan, by any chance?
MisterPINK
Posts: 8
Joined: Mon Jan 10, 2011 8:39 am

Re: 4-pass or 5-pass encoding?

Post by MisterPINK »

TedJ wrote:Did you do an initial subtitle scan, by any chance?
if you were talking to me....
id answer... : i have no idea of what that is, so i guess i didn't :?
Post Reply