Quantcast A New Way to Calculate CQ... Maybe? - Page 3 - digitalFAQ.com Forums [Archives]
  #41  
02-28-2003, 03:21 PM
alfredini alfredini is offline
Free Member
 
Join Date: Dec 2002
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Of course... the audio...
i am usualy not using AviSource(movie, FALSE).
Anyway thanks a lot
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #42  
02-28-2003, 04:38 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
I just wish CQ would be a linear scale icon_cry.gif
Then we wouldn't have all this trouble
Yeah, but what fun would that be?

Ok I finally finished my spreadsheet- lot of work for file prediction

I encode samples of Heist with this script:
Code:
Mpeg2Source("D:\HEIST\VIDEO_TS\heist.d2v")
LegalClip()
BilinearResize(512,344,3,0,714,480)
AddBorders(8,68,8,68)
LegalClip()
which is very basic- no noise filters

here's the result:

here's the excel file for the Sigmoidal Curve parameter sticky post : Heist_data.xls

I still think it may be possible to create a linear equation based on cq0 to ~cq50 and combine another one for cq50 to ~cq80

ren
Reply With Quote
  #43  
02-28-2003, 05:58 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ARnet_tenRA
The problem I see with these values is that your CQ100 seem way out of proportion with the CQ0 and CQ50 values.

Using the scale I had posted before you should only have about 17.778MB and 1194 as the avg. bitrate for CQ100. ie: double CQ50

Your CQ100 is triple CQ50 and that is why the formula is not working.
Yep, that is very weird I wonder if this might have to do with the resolution I used the KVCDx3 528x480 template
Reply With Quote
  #44  
02-28-2003, 09:11 PM
ARnet_tenRA ARnet_tenRA is offline
Free Member
 
Join Date: Jan 2003
Location: Illinois, USA
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by rendalunit
I wonder if this might have to do with the resolution I used the KVCDx3 528x480 template
That is a very good possibility. I used 352x240 for my tests.

-Tenra
Reply With Quote
  #45  
02-28-2003, 09:14 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
If this means that the curves are different for each resolution, we're screwed
Reply With Quote
  #46  
02-28-2003, 09:23 PM
ARnet_tenRA ARnet_tenRA is offline
Free Member
 
Join Date: Jan 2003
Location: Illinois, USA
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by kwag
If this means that the curves are different for each resolution, we're screwed
Don't worry, I'm working on a new formula where you take 3 or 4 short samples and the curve for your movie is automatically determined.

-Tenra
Reply With Quote
  #47  
02-28-2003, 11:55 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
I encoded a bunch of samples of"the Matrix" at 528x480 and graphed the sizes and it follows exactly the same pattern!

The peak file sizes (or the "ceiling") is higher with the Matrix samples The bottom line is that it may be possible to determine the final size of the encode with one short sample at cq-100 and with a good formula (maybe range adjusted by resolution or number of pixels), making the process simpler :tongue2:

ren
Reply With Quote
  #48  
02-28-2003, 11:59 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
OK, I'm finally done, and I think I have good news

First, a chart, and then the explanation :

Code:
CQ	FS	  ABR	 !ABR	   *CQ

100  4349	1603	1603	   100
99	4336	1598	1586.97	98.32
98	4323	1593	1570.94	96.64
97	4310	1589	1554.91	94.92
96	4298	1584	1538.88	93.27
95	4287	1580	1522.85	91.56
94	4276	1576	1506.82	89.87
93	4265	1572	1490.79	88.2
92	4255	1568	1474.76	86.53
91	4246	1565	1458.73	84.82
90	4237	1561	1442.7	 83.18
89	4228	1558	1426.67	81.5
88	4219	1555	1410.64	79.83
87	4211	1552	1394.61	78.18
86	4204	1549	1378.58	76.54
85	4196	1546	1362.55	74.91
84	4171	1537	1346.52	73.59
83	4032	1486	1330.49	74.31
82	3884	1431	1314.46	75.32
81	3692	1361	1298.43	77.28
80	3419	1259	1282.4	 81.49
79	3085	1136	1266.37	88.07
78	2990	1101	1250.34	88.58
77	2985	1099	1234.31	86.48
76	2980	1097	1218.28	84.4
75	2975	1095	1202.25	82.35
74	2966	1092	1186.22	80.38
73	2880	1060	1170.19	80.59
72	2784	1025	1154.16	81.07
71	2613	961	 1138.13	84.09
70	2402	884	 1122.1	 88.85
69	2362	869	 1106.07	87.82
68	2361	869	 1090.04	85.3
67	2356	867	 1074.01	83
66	2352	866	 1057.98	80.63
65	2298	845	 1041.95	80.15
64	2222	817	 1025.92   80.37
63	2078	765	 1009.89	83.17
62	1987	731	 993.86	 84.29
61	1985	731	 977.83	 81.6
60	1983	730	 961.8	  79.05
59	1978	728	 945.77	 76.65
58	1947	717	 929.74	 75.21
57	1882	693	 913.71	 75.15
56	1773	653	 897.68	 76.98
55	1768	651	 881.65	 74.49
54	1759	647	 865.62	 72.25
53	1756	647	 849.59	 69.6
52	1742	641	 833.56	 67.62
51	1695	624	 817.53	 66.82
50	1623	597	 801.5	  67.13
49	1615	595	 785.47	 64.69
48	1613	594	 769.44	 62.18
47	1616	595	 753.41	 59.51
46	1602	590	 737.38	 57.49
45	1546	569	 721.35	 57.05
Please ignore the three columns in the center. They were used only for reference while creating the factors. The important numbers are the CQ on the left, and the *CQ on the right ONLY.

FS=File Size.
ABR=Average Bit Rate.
!AVBR=Linear(should be) Average Bit Rate.
*CQ=Use this CQ to encode.

This was done with 352x480 template to pick a "half way" point for resolution.

Now you only need to run a sampler ( ~30% or full ) one time only with CQ=100

And do this:
(1)Lookup the average bit rate that MovieStacker suggested.
(2)Divide Moviestacker's suggested average bit rate by your real average bit rate of your sample as seen on BitRate Viewer, and multiply by 100.
(3)Look up the closest number you got in step (2) IN THE LEFT CQ values column of the chart, and use the *CQ on the same line on the far right

Tada!. That's it.

Please let me know if this is on target, or if it has been a waste of time

Edit: Suggestion, I think it's better to run the one time full sampler instead of ~30%. This way we get a more accurate bit rate for the prediction. Also these numbers are to be used with KVCD's Q Matrix and GOP. They will be WAY off with anything else

-kwag
Reply With Quote
  #49  
03-01-2003, 12:00 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
@Ren,

Take a look at the numbers and see if it now matches close to what you had encoded before

-kwag
Reply With Quote
  #50  
03-01-2003, 01:48 AM
muaddib muaddib is offline
Free Member
 
Join Date: Jun 2002
Location: São Paulo - Brasil
Posts: 879
Thanks: 0
Thanked 0 Times in 0 Posts
Hey!
If this works I can code this chart into MovieStacker and
make a Prediction Tab to make all the choices and calculations!
Reply With Quote
  #51  
03-01-2003, 02:11 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by muaddib
Hey!
If this works I can code this chart into MovieStacker and
make a Prediction Tab to make all the choices and calculations!
Yesssssssssss

I need people to test this. The chart was based on a 20 second sample. If the prediction is not at least 98% accurate, then I'll do a batch job overnight with a longer sampler, and then feed in the new values to the spreadsheet.

-kwag
Reply With Quote
  #52  
03-01-2003, 02:20 AM
Smoochie3 Smoochie3 is offline
Free Member
 
Join Date: Jun 2002
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, my movie was Ronin.
MovieStacker says average bitrate was 2064 kbps.
Bitrate viewer says 1495
2064/1495 = 1.380602007 x 100 = 138.0602007 ?!?!?!

I used 528x480 with this script:
Code:
Import ("G:\sample avisynth scripts\LoadPlugins.h")

Mpeg2Source("G:\video_ts\Ronin.d2v")

LegalClip()
Telecide()
Decimate()
Gripcrop(528,480)
Gripsize(resizer="lanczosresize")
mergechroma(blur(1.58))
mergeluma(blur(0.2))
SpaceDust()
FluxSmooth(7,7)
NoMoSmooth(40,1,6,1,3,false)
Convolution3d(preset="movieHQ")
DctFilter(1,1,1,1,1,1,.5,0)
GripBorders()
LetterBox(0, 0, 8, 8)
LegalClip()

Sampler(length=24)
What did i do wrong?
Reply With Quote
  #53  
03-01-2003, 02:25 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Smoochie3

What did i do wrong?
2064 kbps average, , no way
Look again at the LEFT value on MovieStacker.
Right under the "Minutes" field.

-kwag
Reply With Quote
  #54  
03-01-2003, 02:28 AM
Smoochie3 Smoochie3 is offline
Free Member
 
Join Date: Jun 2002
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
LOL! i figured it out, thanks!

Ok, so....

Ok, my movie was Ronin.
MovieStacker says average bitrate was 1001 kbps.
Bitrate viewer says 1495
1001/1495 = .6695652174 x 100 = 66.95652174.

So, i would use a CQ of 83?
Reply With Quote
  #55  
03-01-2003, 02:53 AM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Smoochie3
LOL! i figured it out, thanks!

Ok, so....

Ok, my movie was Ronin.
MovieStacker says average bitrate was 1001 kbps.
Bitrate viewer says 1495
1001/1495 = .6695652174 x 100 = 66.95652174.

So, i would use a CQ of 83?
That's it
Tell me your results

-kwag
Reply With Quote
  #56  
03-01-2003, 12:22 PM
PyRoMaNiA PyRoMaNiA is offline
Free Member
 
Join Date: Jan 2003
Location: a PAL land (UK)
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts
Wow. A lot has happened since I was last here......

It might be just me but when I ran a full sampler, got the correct CQ, and then used this CQ and ran another sampler using manual file size prediction, the resulting file was about 2 megs bigger than my target size...
Reply With Quote
  #57  
03-01-2003, 12:28 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by PyRoMaNiA
Wow. A lot has happened since I was last here......

It might be just me but when I ran a full sampler, got the correct CQ, and then used this CQ and ran another sampler using manual file size prediction, the resulting file was about 2 megs bigger than my target size...
WARNING -SLIPPERY WHEN WET ALPHA ALPHA ALPHA Method, not even BETA

That's related to ALL my posts in this thread.
Ok, so you mean your "sampler" file size was ~2MB larger than with the standard method of file prediction
What was your resolution

-kwag
Reply With Quote
  #58  
03-01-2003, 12:43 PM
rendalunit rendalunit is offline
Free Member
 
Join Date: Apr 2002
Location: san jose, Ca
Posts: 1,148
Thanks: 0
Thanked 0 Times in 0 Posts
hey kwag,

I tried the table and it worked great 1/2 times- first time very close- second time off pretty badly If you want you can download my excel worksheet of Heist that I posted-- did you see that?

I'm confused about a couple things though:

1. The curve range is totally different between 352x240 and 528x480 (assuming the resolution is causing this)- so won't the error factor be different?

2. Why not just use filesize and not bitrate? Using the bitrate is a serious pain- first the recommended bitrate to use in MovieStacker is based on all the settings on the page (most relate to SVCD) It would be so much easier to just enter your error factor into the Predict2 function and it will display the correct cq to use

thanks,
ren
Reply With Quote
  #59  
03-01-2003, 12:44 PM
PyRoMaNiA PyRoMaNiA is offline
Free Member
 
Join Date: Jan 2003
Location: a PAL land (UK)
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Ok, so you mean your "sampler" file size was ~2MB larger than with the standard method of file prediction
That's right, and my resolution was 352x480.
Reply With Quote
  #60  
03-01-2003, 12:50 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by rendalunit
hey kwag,

I tried the table and it worked great 1/2 times- first time very close- second time off pretty badly If you want you can download my excel worksheet of Heist that I posted-- did you see that?

I'm confused about a couple things though:

1. The curve range is totally different between 352x240 and 528x480 (assuming the resolution is causing this)- so won't the error factor be different?

2. Why not just use filesize and not bitrate? Using the bitrate is a serious pain- first the recommended bitrate to use in MovieStacker is based on all the settings on the page (most relate to SVCD) It would be so much easier to just enter your error factor into the Predict2 function and it will display the correct cq to use

thanks,
ren
Hi ren,

Yes, the resolutions throw off the curve completely .
I guess this exercise did turn into a "crap" ( for my posts ), because the method is very tightly integrated with the MIN, MAX and resolution I used. So there would have to be a chart for every template, and then if anything is changed ( matrix, etc. ) that would mean that a whole new chart would be needed. So, I slipped and fell on this one
Thanks for trying it out. Now I'll go dig a hole in the ground and proceed to insert myself in it for a couple of hours, and meditate

-kwag
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
KVCD: How to calculate required bitrate? pappukanghi Video Encoding and Conversion 8 10-13-2004 11:47 AM
Bitrates: Does Calcumatic (and others) calculate correctly average bitrate Prodater64 Video Encoding and Conversion 3 08-25-2004 03:55 AM
BBMpeg: Calculate exact output size? azel Video Encoding and Conversion 3 07-22-2003 06:15 PM
DVD2SVCD: Can IfoEdit calculate frame count and movie length ? black prince Video Encoding and Conversion 5 12-08-2002 12:19 AM
Program to Calculate CQ file size? marky Video Encoding and Conversion 2 06-16-2002 05:10 PM

Thread Tools



 
All times are GMT -5. The time now is 05:11 AM  —  vBulletin © Jelsoft Enterprises Ltd