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 13th June 2006, 20:56   #1  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
increasing b-frame is good or not?

I'm trying x264 these days, and I've read some posts here which mentioned that increasing b-frame to above 3 may be useless for the encoder itself may hardly choose to use b-frame above 3. But in a recent try, I've found that by increasing b-frame to 16, the final bitrate is decreased a lot and PSNR also decreases.
All uses crf24, the raw file is a anime
1. b-frame 16: final bitrate: 288Kbps, PSNR: Avg:45.054 Global:44.097
2. b-frame 3: final bitrate: 335Kbps, PSNR Avg:46.512 Global:45.068

Is this the expected behavior? Increasing b-frame will reduce the bitrate but also PSNR? Though I didn't see many major loss with my eye....
huang_ch is offline   Reply With Quote
Old 13th June 2006, 21:05   #2  |  Link
AlexB17
Registered User
 
Join Date: Mar 2005
Posts: 33
Anime is anime - don't think you get same result on real life footage or movie
AlexB17 is offline   Reply With Quote
Old 14th June 2006, 00:07   #3  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,175
That might be due to the difference between P and B frame quantizers; what if you lower the crf to bring the first bitrate in line with the other? Try to control all but one variable to make useful conclusions. What if you measure with SSIM? Most importantly, are they adaptive?

If controlling for bitrate results in higher quality in 3-b still, obviously chuck it. If it shows 16-b is higher, by metrics and visual or just metrics and no visual difference, then you can make a rough recommendation: Use a lower crf when using lots of b-frames with anime.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 14th June 2006, 02:55   #4  |  Link
Kurth
Registered User
 
Kurth's Avatar
 
Join Date: Mar 2006
Posts: 51
I always use 16 B-Frames with Adaptive B-Frames for my Anime encodes it help a lot to make a 25 minutes episode fit in a 100MB file with a very good quality.
Well I use all very slow options of the encoder hehehe so I dont get this high diference on PSNR like you had on your test xD
On anime there is a lot of scenes that the imagem dont have any high movement for a lot of time and the anime image dont have a lot of details like a real movie and if your read the Stats file after doing the 1st Pass you can see a lot of places with more than 3 consecutive B-Frames and I even saw some scenes that the encoder used like 8-12 consecutive B-Frames.
I really think that you can use Adaptive 16 B-Frames without any problems when you are doing encodes that is going to have a small file size.

To get a diference of 1.0 PSNR that he got I really think that he dont used Adaptive B-Frames.
16 B-Frames without Adaptive you always lose a lot of quality.

Last edited by Kurth; 14th June 2006 at 03:10.
Kurth is offline   Reply With Quote
Old 14th June 2006, 06:59   #5  |  Link
GodofaGap
Registered User
 
Join Date: Feb 2006
Posts: 823
Uhm...

The only sane way of comparing PSNR scores is doing a 2-pass with a fixed bitrate, not crf or qp modes. Just 10 kbps can already make a big difference in PSNR sometimes.
GodofaGap is offline   Reply With Quote
Old 14th June 2006, 07:52   #6  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
foxyshadis & Kurth, I'm pretty sure that I use b-adaptive feature. Below is the command line I used for the encode:
--crf 24 --ref 5 --mixed-refs --bframes 16 --b-pyramid --b-rdo --bime --weightb --direct auto --filter 4,4 --subme 6 --trellis 2 --analyse all --8x8dct --qpmin 14 --qpmax 28 --ipratio 1.6 --pbratio 1.6 --me umh --progress --no-dct-decimate

I'm keeping trying to adjust --crf, --qpmin/max, --bframes, --ref, --ipratio/pbratio these days.
huang_ch is offline   Reply With Quote
Old 14th June 2006, 08:09   #7  |  Link
Audionut
Registered User
 
Join Date: Nov 2003
Posts: 1,254
With adaptive b-frames enabled, the number of b-frames becomes the maximum number of b-frames that the encoder can use.

The encoder will then use however many b-frames it thinks are best.

Obviously with the content you are encoding, more b-frames is good.

Without adaptive b-frames, if you specify 2 b-frames, that is how many will be used.
Audionut is offline   Reply With Quote
Old 14th June 2006, 08:29   #8  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
Quote:
Originally Posted by Audionut
With adaptive b-frames enabled, the number of b-frames becomes the maximum number of b-frames that the encoder can use.

The encoder will then use however many b-frames it thinks are best.

Obviously with the content you are encoding, more b-frames is good.

Without adaptive b-frames, if you specify 2 b-frames, that is how many will be used.
Why you say more b-frames is good for my content? Though the bitrate decreased a lot, but the PSNR also decreased by ~1.0. (Though no obvious visual decrease...)
huang_ch is offline   Reply With Quote
Old 14th June 2006, 08:51   #9  |  Link
Kurth
Registered User
 
Kurth's Avatar
 
Join Date: Mar 2006
Posts: 51
Maybe using 16 B-Frames Adaptive only work better on a 2-Pass Encode because I always use 2-Pass and I dont have any problem.
Did you really need to use a constant quality encode? You will get better quality using a 2-pass Encode.
Kurth is offline   Reply With Quote
Old 14th June 2006, 08:55   #10  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
foxyshadis, I've finished SSIM analyze on two videos, below is the result:
1. b16: 89.06
2. b3: 91.00

Still lossing that amount of bitrate cause the quality loss. I'll try to have a similar bitrate to compare.
huang_ch is offline   Reply With Quote
Old 14th June 2006, 09:04   #11  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
Quote:
Originally Posted by Kurth
Maybe using 16 B-Frames Adaptive only work better on a 2-Pass Encode because I always use 2-Pass and I dont have any problem.
Did you really need to use a constant quality encode? You will get better quality using a 2-pass Encode.
I've tried 2 pass with b-3, but got a not so competetive result in PSNR than any other methods. Below is the result for 2 pass with b-3
bitrate 350Kbps, PSNR Avg:46.274 Global:45.262
while another try with crf24, b3, qpmin/max-13/28 produces: 341Kbps, PSNR Avg:46.938 Global:45.318

So I think it's better to stick with crf mode.
huang_ch is offline   Reply With Quote
Old 14th June 2006, 09:52   #12  |  Link
Audionut
Registered User
 
Join Date: Nov 2003
Posts: 1,254
My bad, I thought you had increased psnr with 16 b-frames.

Ignore,
Quote:
Obviously with the content you are encoding, more b-frames is good.
If a bitrate of 350kbps is what your shooting for, then follow foxyshadis advice.
Quote:
what if you lower the crf to bring the first bitrate in line with the other?
Encode with 16 b-frames but with crf 23 or 22, so that the resulting bitrate is closer to 330-350kbps.
Audionut is offline   Reply With Quote
Old 14th June 2006, 10:58   #13  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
Quote:
Originally Posted by Audionut
My bad, I thought you had increased psnr with 16 b-frames.

Ignore,


If a bitrate of 350kbps is what your shooting for, then follow foxyshadis advice.


Encode with 16 b-frames but with crf 23 or 22, so that the resulting bitrate is closer to 330-350kbps.
Thanks for clarify, indeed, I'm not shooting for any bitrate, I'm new to x264, so just interesting in trying to see how low the bitrate could be to encode one of my video. So I want to try any options to make it as low as possible.

Also, another question is, since I've got 89-91 for SSIM, I think this score may be pretty high, right? Are there any former experience from any one can share with me that what SSIM & PSNR value you've got for your videos which you think its quality is pretty good. Is there any relationship between SSIM/PSNR with visual quality? I mean for example, a SSIM above a special value could be regarded as a rather good quality.
huang_ch is offline   Reply With Quote
Old 14th June 2006, 13:23   #14  |  Link
Audionut
Registered User
 
Join Date: Nov 2003
Posts: 1,254
Use your eyes!!
Audionut is offline   Reply With Quote
Old 14th June 2006, 13:37   #15  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
Quote:
Originally Posted by Audionut
Use your eyes!!
That's what I'm doing these days, but I just want to ask for some experiences from your guys to fasten the progress.
huang_ch is offline   Reply With Quote
Old 14th June 2006, 17:08   #16  |  Link
imcold
pencil artist
 
imcold's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 197
Quote:
Originally Posted by Audionut
With adaptive b-frames enabled, the number of b-frames becomes the maximum number of b-frames that the encoder can use.

The encoder will then use however many b-frames it thinks are best.
nope.. encoder uses max. so many b-frames as defined or fewer. It decides where many b-frames are useful and where they aren't, so with adaptive the frame sequence could look like this (3 b-frames) : I BB P BBB P P B P... instead of I BBB P BBB P BBB P....
imcold is offline   Reply With Quote
Old 14th June 2006, 19:54   #17  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,175
Nono, you misread him; he meant that switching on adaptive changes the meaning of the b-frames switcher box to "maximum" instead of "constant".
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 14th June 2006, 20:24   #18  |  Link
imcold
pencil artist
 
imcold's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 197
oops.. sorry.
imcold is offline   Reply With Quote
Old 15th June 2006, 02:13   #19  |  Link
huang_ch
Registered User
 
Join Date: Jul 2004
Posts: 169
Yes, so I fully understand that it is Adaptive, and x264 does seems to use more b frames after the max is set to 16, but the overall bitrate & PSNR is also decrease a bit.
So the main target that b-frame is introduced to video codecs is to increase the bitrate efficiency or increase the quality? I'm a bit confused...

Last edited by huang_ch; 15th June 2006 at 02:17.
huang_ch is offline   Reply With Quote
Old 15th June 2006, 06:08   #20  |  Link
Audionut
Registered User
 
Join Date: Nov 2003
Posts: 1,254
Substantially reduce bitrate without a great loss in quality.
Audionut 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 06:26.


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