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 1st January 2009, 04:20   #1  |  Link
Chengbin
Registered User
 
Join Date: Oct 2007
Posts: 1,059
Pure quality, CRF or 2 pass?

If I want the highest quality encodes without time limit, is CRF better or 2 pass? Suppose I encode a video using CRF x, and it output a video that is 800MB, now I use 2 pass, and specify the size to 800, which way of encoding would provide higher quality?
Chengbin is offline   Reply With Quote
Old 1st January 2009, 04:21   #2  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by Chengbin View Post
which way of encoding would provide higher quality?
Neither.
Dark Shikari is offline   Reply With Quote
Old 1st January 2009, 04:23   #3  |  Link
Chengbin
Registered User
 
Join Date: Oct 2007
Posts: 1,059
Oops, let me change that to which way of encoding between the 2 would create a better encode?
Chengbin is offline   Reply With Quote
Old 1st January 2009, 04:26   #4  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by Chengbin View Post
Oops, let me change that to which way of encoding between the 2 would create a better encode?
Neither.
Dark Shikari is offline   Reply With Quote
Old 1st January 2009, 04:32   #5  |  Link
Chengbin
Registered User
 
Join Date: Oct 2007
Posts: 1,059
So they're the same? 2 pass is only to hit a specific file size? I thought the first pass is to analyze the video file to see where to distribute the bits or something like that.
Chengbin is offline   Reply With Quote
Old 1st January 2009, 04:37   #6  |  Link
Esurnir
Registered User
 
Join Date: Jun 2008
Posts: 143
Quote:
Originally Posted by Chengbin View Post
So they're the same? 2 pass is only to hit a specific file size? I thought the first pass is to analyze the video file to see where to distribute the bits or something like that.
Their goals are different, CRF permit you to reach a certain "quality" (I do my encode with CRF-20, CRF-18 is considered as transparent) but ignoring what will be the final size, while bitrate permit you to reach a certain size (for the quality, you don't have a clue before seeing the result)
Esurnir is offline   Reply With Quote
Old 1st January 2009, 04:37   #7  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by Chengbin View Post
So they're the same? 2 pass is only to hit a specific file size? I thought the first pass is to analyze the video file to see where to distribute the bits or something like that.
CRF, 1pass, and 2pass all use the same bit distribution algorithm. 2-pass tries to approximate CRF by using the information from the first pass to decide on a constant quality factor. 1-pass tries to approximate CRF by guessing a quality factor over time and varying it to reach the target bitrate.
Dark Shikari is offline   Reply With Quote
Old 1st January 2009, 04:56   #8  |  Link
AntiJw
Banned
 
Join Date: Jun 2008
Location: Too north/cold
Posts: 63
Quote:
Originally Posted by Chengbin View Post
So they're the same? 2 pass is only to hit a specific file size? I thought the first pass is to analyze the video file to see where to distribute the bits or something like that.
+if using VBV, then 2-pass is more VBV-accurate.

Last edited by AntiJw; 1st January 2009 at 07:09. Reason: changed "when" to "if"
AntiJw is offline   Reply With Quote
Old 1st January 2009, 05:01   #9  |  Link
Chengbin
Registered User
 
Join Date: Oct 2007
Posts: 1,059
I'm sorry, I'm a bit noob to x264. What is VBV?

There was a guide to all of x264's setting, in Wikipedia style. I can't find that link, can anyone post it, thanks a lot.
Chengbin is offline   Reply With Quote
Old 1st January 2009, 05:01   #10  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by Chengbin View Post
I'm sorry, I'm a bit noob to x264. What is VBV?

There was a guide to all of x264's setting, in Wikipedia style. I can't find that link, can anyone post it, thanks a lot.
If you don't know what VBV is, you probably aren't using it.
Dark Shikari is offline   Reply With Quote
Old 1st January 2009, 05:54   #11  |  Link
flebber
Practising Schemer
 
Join Date: Feb 2008
Location: Newcastle, Australia
Posts: 791
My preference is to use CRF 16 if I am not concerned about filesize and to use 2 pass to acheive a given size output.

here are lnks explaining options.

http://www.digital-digest.com/articl...ons_page1.html

http://www.mplayerhq.hu/DOCS/HTML/en...feat-x264.html

I really haven't seemed to need to understand vbv(Video Buffer Verifier) - maybe I should, this is what I have found.

Good Link http://rob.opendot.cl/index.php/usef...es-and-levels/

Quote:
vbv bufsize is the amount of memory a constant bitrate decoder needs to
allocate to buffering the incoming compressed bitstream. You don't
calculate it. There are 4 possible cases:
* You want to target a specific hardware deocder, and its documentation
says what bufsize it uses. Copy that size.
* You want to target a specific hardware deocder, and its documentation
doesn't say what bufsize it uses. You're screwed.
* You want to stream to a generic software player. Any bufsize works, but
the end user needs to specify the same (or larger) bufsize when playing.
It's a tradeoff between quality and latency, and there are no rules for
choosing an optimal value, any more than there are rules for choosing an
optimal bitrate.
* You aren't streaming nor targetting a hardware decoder. Don't use
constant bitrate.

--Loren Merritt
from http://lists.mplayerhq.hu/pipermail/...er/007612.html


Last edited by flebber; 1st January 2009 at 06:04.
flebber is offline   Reply With Quote
Old 1st January 2009, 09:02   #12  |  Link
ni9ht_5ta1k3r
Registered User
 
Join Date: Jun 2007
Location: Sydney, Australia
Posts: 21
I use 2-pass because it's something I understand easily from encoding in divx/xvid.
ni9ht_5ta1k3r is offline   Reply With Quote
Old 1st January 2009, 09:03   #13  |  Link
buzzqw
HDConvertToX author
 
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
pure quality ?

use lossless mode

BHH
__________________
HDConvertToX: your tool for BD backup
MultiX264: The quick gui for x264
AutoMen: The Mencoder GUI
AutoWebM: supporting WebM/VP8
buzzqw is offline   Reply With Quote
Old 1st January 2009, 15:10   #14  |  Link
cogman
The Crazy Idahoan
 
Join Date: Jun 2007
Location: Idaho
Posts: 233
Quote:
Originally Posted by buzzqw View Post
pure quality ?

use lossless mode

BHH
Aye, the best quality is to either not encode at all, or encode using lossless mode.
cogman is offline   Reply With Quote
Old 1st January 2009, 16:01   #15  |  Link
Esurnir
Registered User
 
Join Date: Jun 2008
Posts: 143
vbv is not usefull for computer playback (save maybe with dxva).

It permit to create a stream that "can" be broadcasted on a capped bitrate interface (the net, a slow disk, etc.)
Esurnir is offline   Reply With Quote
Old 1st January 2009, 18:37   #16  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,039
Quote:
Originally Posted by Chengbin View Post
Suppose I encode a video using CRF x, and it output a video that is 800MB, now I use 2 pass, and specify the size to 800, which way of encoding would provide higher quality?
As far as I know if you create two files of the same size, one with CRF (1-Pass) and one with 2-Pass, then the difference in quality between these two files will be very small. Most likely you wouldn't be able to notice it. The difference is: With 2-Pass you know the final size in advanced, with CRF you don't. But in 2-Pass mode you need to decide for a target average bitrate, which isn't easy, as different sources require different bitrates to look good! In CRF mode you can simply specify a level of quality (very roughly) and the decoder decides the required bitrate for you.

In short: If you are targeting for a certain level quality and you don't care about filesize, then find the highest possible CRF value that still satisfies your eyes and use that CRF value for all your encodes. And if you are targeting for best possible quality for a restricted filesize (e.g. 700 MB for a CD-R or 4,7 GB for a DVD+R) then use 2-Pass mode.
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 1st January 2009 at 18:42.
LoRd_MuldeR is offline   Reply With Quote
Old 1st January 2009, 21:20   #17  |  Link
refulgentis
Registered User
 
Join Date: Apr 2008
Posts: 56
Quote:
Originally Posted by LoRd_MuldeR View Post
As far as I know if you create two files of the same size, one with CRF (1-Pass) and one with 2-Pass, then the difference in quality between these two files will be very small. Most likely you wouldn't be able to notice it. The difference is: With 2-Pass you know the final size in advanced, with CRF you don't. But in 2-Pass mode you need to decide for a target average bitrate, which isn't easy, as different sources require different bitrates to look good! In CRF mode you can simply specify a level of quality (very roughly) and the decoder decides the required bitrate for you.

In short: If you are targeting for a certain level quality and you don't care about filesize, then find the highest possible CRF value that still satisfies your eyes and use that CRF value for all your encodes. And if you are targeting for best possible quality for a restricted filesize (e.g. 700 MB for a CD-R or 4,7 GB for a DVD+R) then use 2-Pass mode.
To make this very, very, clear: they will produce the same quality at the same size, but you don't know what that "same size" is until its done with the CRF encode. Two-pass is just guesswork.
refulgentis is offline   Reply With Quote
Old 1st January 2009, 21:22   #18  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,039
Quote:
Originally Posted by refulgentis View Post
To make this very, very, clear: they will produce the same quality at the same size, but you don't know what that "same size" is until its done with the CRF encode.
Basically, yes!
But as far as I know they do not produce the exact same output at the same filesize. However the results will be very very close.
I doubt you will be able to spot the difference...

Quote:
Originally Posted by refulgentis View Post
Two-pass is just guesswork.
Quality-wise the 2-Pass mode is guesswork. At least if you did not do any tests in advance to find a reasonable bitrate.
But size-wise it's exact. In contrast to CRF, which produces an unpredictable size (but predicable quality - roughly).
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 1st January 2009 at 21:35.
LoRd_MuldeR is offline   Reply With Quote
Old 4th January 2009, 01:35   #19  |  Link
eyekyu
Registered User
 
Join Date: Feb 2008
Posts: 19
the higher the CRF the better?
eyekyu is offline   Reply With Quote
Old 4th January 2009, 01:56   #20  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 959
No, the crf value is related to the quantisers used. A higher value uses higher quantisers which produces lower quality, a lower crf value produces higher quality.
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley 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 02:07.


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