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-2 Encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th October 2005, 03:40   #241  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
freelock7 - thanks for the test. can you also do a comparison against 0.61 release version so i can see the actual difference ?

Quote:
i can't see the way to encode the audio to 48000 Hz sampling rate instead of the default 44.1 KHz,is there a way?
QuEnc encodes at the rate it is given, feed it 44khz it encodes to 44khz. to change the sample rate with Avisynth read the Avisynth docs that are installed with it.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 9th October 2005, 11:45   #242  |  Link
freelock7
High beam
 
freelock7's Avatar
 
Join Date: Apr 2004
Location: Belgium
Posts: 290
Tested another movie
QuEnc-DGZ
Wanted avg=4500
Encoded avg=4010
Global QLevel=1.40

QuEnc061(original)=exactly the same!

Well, strange QLevel with many flat lines at quant=1 (underquantization).
Fine quality picture (sure, for this average!)
Both of them work the same. Did you change something?
freelock7 is offline   Reply With Quote
Old 9th October 2005, 14:15   #243  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
Both of them work the same. Did you change something?
yes but it is only a small change to try and see if it has a posative or negative impact. on some it seems posative while others negative and others no difference. so i think there are more fundamental changes needing to be made for any major improvement. i will be trying to look at some other changes this week as time permits. thanks again.

oh and for that second test, if you have a lot of Q1 and na average of 1.40 then you are practically saturating the compression. so it would struggle to get up to that bitrate unless it used padding etc which of course doesnt add any quality just size.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)

Last edited by dragongodz; 9th October 2005 at 14:17.
dragongodz is offline   Reply With Quote
Old 9th October 2005, 20:57   #244  |  Link
DarkFoon
Awakened to video Dec2003
 
DarkFoon's Avatar
 
Join Date: Dec 2003
Location: US West
Posts: 191
Quote:
Originally Posted by dragongodz
unless it used padding etc which of course doesnt add any quality just size.
That's something that's been puzzling me. A few weeks ago (probably a month or two), it sounded like you were just adding some kind of padding to increase the bitrate, but what is the point of that? Isn't smallest size at the highest quality (possible) the purpose of compression?
No offense, but I can't think of any situations where undersizing would be undesirable.
__________________
Mac killed my inner-child

My Quant Matrices:
Caerulea
For MPEG-2 DVD Destination Anime

Simple Lo
General Purpose MPEG-2 (tested with anime only)
DarkFoon is offline   Reply With Quote
Old 10th October 2005, 06:02   #245  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
it sounded like you were just adding some kind of padding to increase the bitrate, but what is the point of that?
no, not adding padding. the things i have been changing are to do with bit distribution and rate control calculations.

Quote:
No offense, but I can't think of any situations where undersizing would be undesirable.
when the rate control has failed to distribute as much bitrate as possible. for the above example where the average quant is around 1 then you are practically at saturation point and wont get much more in either size or quality. however say the average quant had been more like 4 or 5 and you were still under your target bitrate. that suggests that there should be areas where a lower quant me be able to be used, thus raising bitrate towards target and ,atleast in theory, increasing quality. of course the distribution still has to adhere to any restrictions such as max bitrate and VBV etc.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 10th October 2005, 06:43   #246  |  Link
DarkFoon
Awakened to video Dec2003
 
DarkFoon's Avatar
 
Join Date: Dec 2003
Location: US West
Posts: 191
I stand corrected.

By the way, how is max bitrate determined by quenc/libavc? I remember come confusion on the subject a while back.
I always thought it was the number of bits used to encode 30 frames (NTSC) or 25 frames (PAL). And when a new frame was encoded, the oldest frame in the comparison group (the 30 or 25 frames used to determine max bitrate) was dumped, and the newest frame could have at most as many bits that would make the group total the max bitrate.

hmmm, but that wouldn't work too well... if there were 29 frames of 0 bits(unlikely), the 30th frame could by 8.5 megabits in size (assuming max bitrate=8500) which would totally mess up set top playback devices.
__________________
Mac killed my inner-child

My Quant Matrices:
Caerulea
For MPEG-2 DVD Destination Anime

Simple Lo
General Purpose MPEG-2 (tested with anime only)
DarkFoon is offline   Reply With Quote
Old 11th October 2005, 09:08   #247  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
of course, if you're getting an undersized file at average quant 1, then you can squeeze a few more bits with a higher bitrate matrix - the numbers in the quant matrix behave the same as the global quantizer - lower numbers = more bits = more detail.

of course, some stuff undersizes no matter what... i encoded "son of godzilla" with a flat 8 matrix (all 8's for intra and non intra) and it still came out at almost constant quant 1. pre-compression filtering can often be too efficient (maybe these movies were mastered for divx rather than DVD?)
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 12th October 2005, 01:23   #248  |  Link
DarkFoon
Awakened to video Dec2003
 
DarkFoon's Avatar
 
Join Date: Dec 2003
Location: US West
Posts: 191
@Mug Funky
That's an interesting idea. My MPEG-2 capture card uses different quant matrices. I'm not sure what causes it to change, but when I run it through DGDecode with the "show quant matrices" option, I get a large file with about 10 to 20 matrices.

I'd be kinda neat if a user could specify a directory with a bunch of matrices, and quenc could switch to another matrix if it maxes out on quant 1 with the first one the user specifies. Or the user could specify 4 or 5 matrices for quenc to choose among for highest quality/smallest size, depending on which the user prioritizes.
__________________
Mac killed my inner-child

My Quant Matrices:
Caerulea
For MPEG-2 DVD Destination Anime

Simple Lo
General Purpose MPEG-2 (tested with anime only)
DarkFoon is offline   Reply With Quote
Old 12th October 2005, 05:05   #249  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
i'd love it for CBR stuff. it'd be easier to implement i think - if quant=1 and bitrate < target, then multiply matrix by some calculated number (based on compressibility stuff i have no idea about, and also a ratio of current bitrate and target bitrate), then round to integers. this wont affect the "shape" of the matrix much (rounding excluded), but will allow quant 1 to keep more detail.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 12th October 2005, 11:20   #250  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
I always thought it was the number of bits used to encode 30 frames (NTSC) or 25 frames (PAL). And when a new frame was encoded, the oldest frame in the comparison group (the 30 or 25 frames used to determine max bitrate) was dumped, and the newest frame could have at most as many bits that would make the group total the max bitrate.
correct. though not all rate controls will go through all that. some will just go by GOP and target that to the relevant percentage per frames per max bitrate etc. Nics latest experimental versions is infact trying to do it the way you describe.

Quote:
hmmm, but that wouldn't work too well... if there were 29 frames of 0 bits(unlikely), the 30th frame could by 8.5 megabits in size (assuming max bitrate=8500) which would totally mess up set top playback devices.
actually no it shouldnt. that is if the dvd player has that little dvd symbol on it then it is meant to be able to handle such a case as that seeing as it is technically legal. ok reality may show that not all players would handle it great but reality should also show that it would have to be an extreme case, and i mean really extreme and rare, for an encoder to ever produce such an encode. so its not actually something you should need to worry about.

Quote:
I'd be kinda neat if a user could specify a directory with a bunch of matrices, and quenc could switch to another matrix if it maxes out on quant 1 with the first one the user specifies. Or the user could specify 4 or 5 matrices for quenc to choose among for highest quality/smallest size, depending on which the user prioritizes.
well yes that is possible but it would be much simpler to simply adapt the chosen matrix if needed. that is if after 1st pass at Q2 the size/bitrate estimated is smaller than half the target size/bitrate then reduce/halve the values in the matrix(limiting to 8 and 16 values for intra and non-intra). then adapt the GOP/frame sizes from the first pass to a rough(you would need another real first pass to be actually accurate) new value from what the new matrix should produce. then encode second pass based on that. want to guess how much fiddling around that would be ?

Quote:
i'd love it for CBR stuff. it'd be easier to implement i think
i agree, for CBR it should be easier to implant aswell. still fiddley though.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 13th October 2005, 01:20   #251  |  Link
DarkFoon
Awakened to video Dec2003
 
DarkFoon's Avatar
 
Join Date: Dec 2003
Location: US West
Posts: 191
The reason I suggested swapping matrices as opposed to modifying one was because I thought that would be easier.
This is how I thought it would work (with no idea as to how it would be programmed):
Let's say the user specified higher quality as opposed to smallest size. So, when the encoder encodes a frame that is not Q1 (or as high as it can go, like Q2 for 2 pass, first pass) it re-encodes that frame with a different matrix and if that fails, then another, until it exhausts all the ones it can use, and then it picks the best out of those. If it encounters a winner on its second matrix, then it will go with that one, and not even try the others: this would be for speed enhancement. Instead of going through them all and encoding each one, it would just try "the next one" and if the "next one" is better than "the last one" then it sticks with it, even if there are other past it that could od a better job, it doesn't know.
The hardest part, that I can see, is getting it to still respect the bitrate. I mean, if it just picked the largest frame it could every time, then bitrate would be thrown to the wind.
__________________
Mac killed my inner-child

My Quant Matrices:
Caerulea
For MPEG-2 DVD Destination Anime

Simple Lo
General Purpose MPEG-2 (tested with anime only)
DarkFoon is offline   Reply With Quote
Old 13th October 2005, 21:19   #252  |  Link
boombastic
Registered User
 
Join Date: Oct 2003
Location: Ascoli Piceno-Italy
Posts: 279
is there a command line to use the author dvd feature?
boombastic is offline   Reply With Quote
Old 25th November 2005, 09:04   #253  |  Link
freelock7
High beam
 
freelock7's Avatar
 
Join Date: Apr 2004
Location: Belgium
Posts: 290
Quote:
Tweaked rate control for 2 pass
I confirm it!
Encoded a movie with QuEnc062Prettyexperimental in 2Pass, VBR=4500, scenechange off, closed gop off and quality is great!
Any more prediction problem (correct).
freelock7 is offline   Reply With Quote
Old 26th November 2005, 23:27   #254  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,079
Force Closed GOP and GOP length

When I select "Force Closed GOP" in QuEnc 0.61 it seems that the resulting GOP length can only be 1+(multiple of 3). A GOP length of 12 or 15 is not possible, only 10, 13 or 16. When I select a GOP size of 15, QuEnc will change it to the nearest lower value (13 in this case).

Is this normal (or even desirable), or is this something that should be corrected?


Cheers
manolito
manolito is offline   Reply With Quote
Old 22nd February 2006, 12:17   #255  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
for those interested in doing a little experimentation/testing i present QuEnc 0.62 alpha3.

this should not undersize as bad as the other 0.62 alphas did. it should be closer to 0.61's undersizing, that is not always using quant 1 when it can for high bitrate or easy encodes. however feedback on not only high bitrate encodes but also low bitrate aswell, to see how good that is aswell, would be appreciated.

WARNING this is an alpha experimental version only and should be considered for testing purposes only.

binary(self extracting 7zip archive)
REMOVED. see alpha 4 link and mirror in later posts.

QuEnc 0.62 experimental source code
http://www.megaupload.com/?d=GL62KA1L
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)

Last edited by dragongodz; 24th February 2006 at 01:21.
dragongodz is offline   Reply With Quote
Old 22nd February 2006, 13:10   #256  |  Link
communist
Registered User
 
Join Date: Jul 2003
Posts: 1,152
Quote:
Originally Posted by Mug Funky
btw, any reason the last GOP on a 2-pass encode seems to get hit too hard? it's been behaving that way since the xvid RC was implemented. same with certain fade-ins and outs - quants just seem to get quite high.
Quote:
Originally Posted by Nic
Yes there is a reason the last GOP gets hit hard and I think it's because when we hit the last second some of the functions just stop working as they should. I'll look into it. Should be an easy fix, well spotted though.
Latest alpha still does that (not that it was supposed to be fixed in this version) - any news on that?

Also a temp. mirror for anyone else having trouble with megaupload:
Binary
Source
communist is offline   Reply With Quote
Old 22nd February 2006, 13:41   #257  |  Link
guada 2
Registered User
 
Join Date: Feb 2005
Location: Lyon
Posts: 718
communist.

Bye.
guada 2 is offline   Reply With Quote
Old 22nd February 2006, 18:58   #258  |  Link
freelock7
High beam
 
freelock7's Avatar
 
Join Date: Apr 2004
Location: Belgium
Posts: 290
Happy to test again .
DGZ, there is a problem -a great problem- in the bitrate average setting 2Pass.
At low bitrate <3000, prediction is not correct (oversizing+++)!
If you choose a VBR=2500 (or another value < 3000), prediction is always 4500!

Last edited by freelock7; 22nd February 2006 at 19:03.
freelock7 is offline   Reply With Quote
Old 23rd February 2006, 11:57   #259  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
Happy to test again
thanks. its one of the hardest things to get people to do.

Quote:
there is a problem -a great problem-
woops. see now thats why i need people to test and with different bitrates etc.

this should fix it
http://www.megaupload.com/?d=B3HIFBOZ
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 23rd February 2006, 17:58   #260  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
ehhm ....

I had a look into the sources of AVSEnc.cpp of the Qenc Source package.

In the section where its determined when using the QLB Matrix I found this ...

Code:
if ( bUseQLB || csMatrixFile.IsEmpty() == FALSE )
		{
			CString csQLBIntra, csQLBNonIntra;
			csQLBIntra = CString("8 16 19 22 26 27 29 34 ")
											+("16 16 22 24 27 29 34 37 ")
											+("19 22 26 27 29 34 37 39 ")
											+("22 22 26 27 29 34 38 42 ")
											+("22 26 27 29 32 36 40 50 ")
											+("26 27 29 32 36 40 50 61 ")
											+("26 27 29 35 40 50 59 75 ")
											+("27 29 35 40 50 59 75 89 ");

			csQLBNonIntra=CString("16 17 18 19 20 21 22 23 ")
								 		 +("17 18 19 20 21 22 23 25 ")
										 +("18 19 20 21 22 23 24 26 ")
										 +("19 20 21 22 23 24 26 28 ")
										 +("20 21 22 23 25 26 28 29 ")
										 +("21 22 23 24 26 28 29 31 ")
										 +("22 23 24 26 28 29 31 34 ")
										 +("23 24 25 28 29 31 34 38 ");


...
...
..
.
What makes me thinking is this line where its asked IF the user uses the integrated QLB Matrix or if the Matrix is loaded from a given matrix text file.
Code:
if ( bUseQLB || csMatrixFile.IsEmpty() == FALSE )
Im very new in C/C++ but ...

"csMatrixFile.IsEmpty() == FALSE" doesnt this mean if I(t)sEmtpy then a boolean true is the result?
(I couldnt find the specific class in the source files thats why Im asking)

So if the user determined as matrix the integrated QLB one then >bUseQLB=true< and if no external matrix has been loaded then >csMatrixFile.IsEmpty() = true< ... did I catch the right?

Cause if yes then even if an external matrixfile is loaded, still the usage of QLB is forced??

But maybe Im too much in Carnaval here in cologne at this moment *lol

Last edited by Inc; 23rd February 2006 at 18:00.
Inc 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 03:22.


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