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. |
|
26th December 2009, 08:55 | #1 | Link |
Registered User
Join Date: Nov 2009
Posts: 12
|
about real time encoding with 2pass
Hi, recently, I did some comparison between 1 pass ABR and 2 pass, obviously, 2 pass almostly uses less bit rate to produce more psnr, my issue is if I can use 2 pass method, when I want to implement real time encoding, certainly, it is not really real time, 10 or more second latency can be allowed, and my assumption is one pass generates stat in real time, meanwhile another pass encodes later than 10 seconds based on the stat, can X264 implement it? or somebody has considered it or implemented it based on X264? thanks
|
26th December 2009, 09:17 | #2 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Impossible in the general case since the purpose of 2-pass is to distribute bits over the whole video, while your plan would only distribute bits over, well, 10 seconds.
However, this is already implemented as RC-lookahead in x264, and is used for VBV, where one does in fact care about the next few seconds as opposed to the whole video. |
26th December 2009, 10:07 | #3 | Link | |
Registered User
Join Date: Nov 2009
Posts: 12
|
Quote:
In fact, I attempt to encode some sport program(such as NBA) from 1080i to D1, as you know, the scene in NBA is always high complexed, my plan is encoding them in a very low bitrate, 800bps maybe, however, the result is awful, too obvious block-effect exist in edge for the complexed scene, I know it's because of the high QP for low bitrate, so I try some special methods to improve the quality, not for the psnr, but for the vision from human, and I denoise the raw data based on freq and time domain to smooth the detail, which maybe decrease the complexity for encoding and more or less can distribute some bits for reducing the block effect, could my attempt be available? or do you have any suggestion for the pre-posting or the encoding process for increasing the quality at low bitrate? |
|
26th December 2009, 23:40 | #4 | Link |
Derek Prestegard IRL
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
|
If you're having low quality due to high QPs, then you can do a few things:
1) Slow down x264 to increase its quality 2) Increase bitrate 3) Decrease resolution 4) Add denoising, either directly in x264, or ideally via more fancy stuff like AviSynth How exactly are you processing your 1080i sources? Real-time is not my specialty, and probably rules out AviSynth, but maybe something can be done. Why the low bitrate restriction? What x264 command line exactly are you using? Your problem may be due to poorly chosen settings. Are you going to 480p60 or 480p30? If you're coding interlaced - you probably shouldn't if you're trying to squeeze in as much quality as possible. The scaling / deinterlacing process can also heavily impact compressibility. So - how are you doing this? 800kbps is probably enough bitrate for 480p30 sports to look *okay*, not fabulous or anything, always hard to say - and always source specific!! Moar info pls ~MiSfit
__________________
These are all my personal statements, not those of my employer :) Last edited by Blue_MiSfit; 26th December 2009 at 23:42. |
27th December 2009, 03:42 | #5 | Link | |
Registered User
Join Date: Nov 2009
Posts: 12
|
Quote:
1 pass --bitrate 800 --ratetol 10 --qcomp 0.9 --profile baseline --me dia --ref 1; 2 pass --bitrate 800 --ratetol 10 --qcomp 0.9 --profile baseline --analysis all --me umh --ref 3 --deblock 3:3. 800bps is restricted by the network, but it allows 10 second latency, so I choose 10 as ratetol, and baseline is confined by the decoder, cabac and B can' t be used. and deblock alpha and beta is set as 3 3, which can help to decrease the block effect more or less I think. however, all my attempts do not give me a obvious improvement, now my plan is below: 1 reduce some detail at pre-process, by using some strong denose tool or blur tool, because of scaling down too much. 2 because of NBA scene, what we concentrate on are always the athlete and ball, while the auditorium is ignored usually, so I can adjust the QP higher at center region, on the contrary, lower at around of the video, so maybe I add some code for ratecontrol based on the region adaptive. that is my assumption, any suggestion? |
|
27th December 2009, 04:36 | #6 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
Here's what you actually mean: --bitrate 800 --vbv-maxrate 800 --vbv-bufsize 8000 |
|
27th December 2009, 05:15 | #7 | Link | |
Registered User
Join Date: Nov 2009
Posts: 12
|
Quote:
And I just view some threads about CBR, you suggest me to use VBV buffer model, and according to my understanding, X264 set a 10 second video buffer for imitating the stream buffer at decoder, in purpose that X264 can distribute less bits for the low complexed scene, and more bits for the high ones, but the distribution is limited by the size of buffer to ensure the decoder stream buffer is not overflow and underflow, in a word, that means it produces a stream with constant bitrate in 10 seconds perspective and if we see the curve of bitrate, it must be fluctuant around --vbv-maxrate. is it correct? if so, what is --bitrate used for? and when we set VBV, has the --rc-lookahead been set as a default value? because, if not, how the x264 can guarantee the constant bitrate in a 10 seconds perspective? Last edited by seanxu_2010; 27th December 2009 at 05:52. |
|
27th December 2009, 05:48 | #8 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
|
|
Tags |
2 pass, realtime, x264 |
|
|