Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th July 2012, 15:18   #1  |  Link
sirt
x264 fan
 
sirt's Avatar
 
Join Date: Feb 2011
Location: In the trap
Posts: 458
Multi pass encoding with x264

Hi,

Lately I've been doing many tests with x264 and another h264 encoders. You all know x264 allows you to use more than two pass to encode. I've tried to encode a video in 3 pass in order to compare te output with the corresponding one in 2 pass mode. Honestly I had not been able to pick up anything different from an output to another.

So what do you think of multi pass encoding ? Let's say I decide to encode in 10 pass, what will concretely happen ? As I've read the encoder - when doing the 2nd pass - relies on the data collected during the 1st pass ; but, when doing the 3rd pass, it is still unclear to me if it will adapt its work basing on previous 2 passes or only the second one.
sirt is offline   Reply With Quote
Old 27th July 2012, 15:33   #2  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
1/ Post your command line

2/ http://mewiki.project357.com/wiki/X264_Settings#pass
Kurtnoise is offline   Reply With Quote
Old 27th July 2012, 15:38   #3  |  Link
sirt
x264 fan
 
sirt's Avatar
 
Join Date: Feb 2011
Location: In the trap
Posts: 458
What command line would you like ? It's almost simple, what if I do this :

--preset slower --bitrate 2000 --pass 1
--preset slower --bitrate 2000 --pass 2
--preset slower --bitrate 2000 --pass 3

Or even :

--preset slower --bitrate 2000 --pass 1
--preset slower --bitrate 2000 --pass 2
--preset slower --bitrate 2000 --pass 3
--preset slower --bitrate 2000 --pass 4
--preset slower --bitrate 2000 --pass 5
--preset slower --bitrate 2000 --pass 6
sirt is offline   Reply With Quote
Old 27th July 2012, 15:42   #4  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Read the link he posted, you're doing it wrong.
sneaker_ger is offline   Reply With Quote
Old 27th July 2012, 16:08   #5  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,810
Quote:
What command line would you like ? It's almost simple, what if I do this :

--preset slower --bitrate 2000 --pass 1
--preset slower --bitrate 2000 --pass 2
--preset slower --bitrate 2000 --pass 3

Or even :

--preset slower --bitrate 2000 --pass 1
--preset slower --bitrate 2000 --pass 2
--preset slower --bitrate 2000 --pass 3
--preset slower --bitrate 2000 --pass 4
--preset slower --bitrate 2000 --pass 5
--preset slower --bitrate 2000 --pass 6
I would use
--preset slower --bitrate 2000 --pass infinite
Atak_Snajpera is offline   Reply With Quote
Old 27th July 2012, 16:17   #6  |  Link
SassBot
Guest
 
Posts: n/a
Quote:
Originally Posted by sirt View Post
So what do you think of multi pass encoding ?
It's a waste of time unless you need a tighter tolerance on the final size. That's about the only thing you'll get out of using more than 2 passes.

Quote:
Originally Posted by sirt View Post
Let's say I decide to encode in 10 pass, what will concretely happen ?
You'll be wasting lots of electricity and time that could be better spent on encoding something else.

Last edited by SassBot; 27th July 2012 at 16:20.
  Reply With Quote
Old 27th July 2012, 17:27   #7  |  Link
sirt
x264 fan
 
sirt's Avatar
 
Join Date: Feb 2011
Location: In the trap
Posts: 458
Quote:
Originally Posted by sneaker_ger View Post
Read the link he posted, you're doing it wrong.
I know, I simplified the comand lines to give an idea of what I intend to do.


Atak_Snajpera

Fortunately such settings doesn't exist..


Sassboot

Then I conclude it is completely useless because the "tolerance" you mention has no sence : I just tried an encode in 3 pass and there was a small difference of 2 MB between the 2 pass & 3 pass encode.
sirt is offline   Reply With Quote
Old 27th July 2012, 17:31   #8  |  Link
SassBot
Guest
 
Posts: n/a
Quote:
Originally Posted by sirt View Post
Then I conclude it is completely useless because the "tolerance" you mention has no sence : I just tried an encode in 3 pass and there was a small difference of 2 MB between the 2 pass & 3 pass encode.
I didn't say it would make a huge difference, but you do get slightly better ratecontrol with more passes. This was why I said explicitly "It's a waste of time" since that slight difference isn't worth wasting the electricity and time.
  Reply With Quote
Old 2nd June 2015, 22:39   #9  |  Link
kotuwa
Registered User
 
Join Date: May 2012
Posts: 66
Quote:
Originally Posted by sirt View Post
What command line would you like ? It's almost simple, what if I do this :

--preset slower --bitrate 2000 --pass 1
--preset slower --bitrate 2000 --pass 2
--preset slower --bitrate 2000 --pass 3

Or even :

--preset slower --bitrate 2000 --pass 1
--preset slower --bitrate 2000 --pass 2
--preset slower --bitrate 2000 --pass 3
--preset slower --bitrate 2000 --pass 4
--preset slower --bitrate 2000 --pass 5
--preset slower --bitrate 2000 --pass 6
Quote:
Originally Posted by sneaker_ger View Post
Read the link he posted, you're doing it wrong.
Quote:
Originally Posted by sirt View Post
I know, I simplified the comand lines to give an idea of what I intend to do.
I think it is not the other options, the switch for the 3 pass is wrong, as i know...
I have no idea above would work or not...
Of cource it would give an output, but I think it won't give what 3 pass gives if you used first 3 lines...
There the 2nd line is wasted as --pass 2 does not update the stat file, and the 3rd line would work as the 2nd pass of a 3 pass encode...

As I know the 3 pass would be like

--preset veryslow --bitrate 2000 --pass 1
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3

It does not have 2 in it... 2nd pass is also 3... Nth pass is also 3...

--preset veryslow --bitrate 2000 --pass 1
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3
etc....

Correct me if I am wrong...
!
kotuwa is offline   Reply With Quote
Old 3rd June 2015, 00:43   #10  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
Three pass can also be done:

--preset veryslow --bitrate 2000 --pass 1
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 2

or:
--preset veryslow --bitrate 2000 --pass 1
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 2

note: this thread is/was ~3 years old.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 3rd June 2015, 09:11   #11  |  Link
kotuwa
Registered User
 
Join Date: May 2012
Posts: 66
Does

--preset veryslow --bitrate 2000 --pass 1
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 2

is better than

--preset veryslow --bitrate 2000 --pass 1
--preset veryslow --bitrate 2000 --pass 3
--preset veryslow --bitrate 2000 --pass 3

!?
If no further passes are going to happen, then using --pass 2 for the 3rd line would be better than using --pass 3
!?
kotuwa is offline   Reply With Quote
Old 3rd June 2015, 09:17   #12  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,316
It's in the help :
Code:
  -p, --pass <integer>        Enable multipass ratecontrol
                                  - 1: First pass, creates stats file
                                  - 2: Last pass, does not overwrite stats file
                                  - 3: Nth pass, overwrites stats file
I personnaly think it should en with 2.
jpsdr is offline   Reply With Quote
Old 3rd June 2015, 10:12   #13  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Every single pass can be --pass 3 and it would make zip zero difference. --pass 3 is just the general case, while --pass 1 doesn't output video and --pass 2 doesn't output new stats.

Good luck seeing any difference for more than 2 passes, though.
foxyshadis is offline   Reply With Quote
Old 3rd June 2015, 17:51   #14  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by foxyshadis View Post
Every single pass can be --pass 3 and it would make zip zero difference. --pass 3 is just the general case, while --pass 1 doesn't output video
No, --pass 3 will try to read a stats file and error out if it does not exist. The first pass always has to be --pass 1. (And --pass 1 does output video)
sneaker_ger is offline   Reply With Quote
Old 4th June 2015, 00:43   #15  |  Link
kotuwa
Registered User
 
Join Date: May 2012
Posts: 66
Quote:
Originally Posted by sneaker_ger View Post
No, --pass 3 will try to read a stats file and error out if it does not exist. The first pass always has to be --pass 1. (And --pass 1 does output video)
If an output is specified, it gives....
If the output name is NUL, then it does not...
If --slow-firstpass is not used, that output is nothing but trouble...
I saw one guy uploaded a tv show using that file.... without even looking/playing... lol
Even though --slow-firstpass used, average bitrate is still not good enough....
In any case (rare cases, like this OP) someone need to use the first pass file, then --crf firstpass with --slow-firstpass would be better....
kotuwa is offline   Reply With Quote
Old 4th June 2015, 18:17   #16  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
I've seen a 3rd pass help quality some when there's a big ratio between abr and pbr, particularly if it's a fast first pass. But the delta hasn't been big enough for me to bother to do it except for some very high profile files with extreme variance in complexity within the source file and a very low target ABR. Basically cases where I'm already using Placebo because, why not. When a file is going to get >100K downloads, shaving off 5% of file size can be well worth spending 10x more time encoding.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:38.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.