Log in

View Full Version : 2gb max for xvid encodes - want undersize :)


musicnyman
13th May 2005, 06:52
in the older versions of auto gk, setting the encode to 2 gig max would undersize the output AVI if it couldn't compile the movie at 2gigs. with the newer versions of autogk, it'll still try and keep the movie at 2 gigs, but i want it just to keep the movie at 100% quality if it can be kept smaller instead of re-encoding the movie again. an example is the log posted below. i set it to 2 gb max and it came out 2 gigs, but if i rencode the same movie at 100% quality, it comes out at about 1.5 gigs. so i guess i'm asking if there's a way for autogk to do this automagically instead of me doing two encodes if compressiblity test is over 100%?

[5/7/2005 11:08:17 AM] AutoGK 2.08b
[5/7/2005 11:08:17 AM] OS: WinXP (5.1.2600).2
[5/7/2005 11:08:17 AM] Job started.
[5/7/2005 11:08:17 AM] Input dir: D:\workspace\white noise
[5/7/2005 11:08:17 AM] Output file: D:\workspace\white noise.avi
[5/7/2005 11:08:17 AM] Output codec: XviD
[5/7/2005 11:08:17 AM] Audio1: English AC3 6ch
[5/7/2005 11:08:17 AM] Subtitles: none
[5/7/2005 11:08:17 AM] Format: .AVI
[5/7/2005 11:08:17 AM] Target size: 2040Mb
[5/7/2005 11:08:17 AM] Custom resolution settings: fixed width of 720 pixels
[5/7/2005 11:08:17 AM] Standalone support enabled: MTK/Sigma
[5/7/2005 11:08:17 AM] Started encoding.
[5/7/2005 11:08:17 AM] Demuxing and indexing.
[5/7/2005 11:11:56 AM] Processing file: D:\workspace\white noise\VTS_01_1.VOB
[5/7/2005 11:11:56 AM] Source aspect ratio: 16:9
[5/7/2005 11:11:56 AM] Source resolution: 720x480
[5/7/2005 11:11:56 AM] Found NTSC source.
[5/7/2005 11:11:56 AM] Source seems to be pure FILM.
[5/7/2005 11:11:56 AM] Output will contain 140998 frames
[5/7/2005 11:11:56 AM] Audio1 size: 329,323,008 bytes (314.07 Mb)
[5/7/2005 11:11:56 AM] Overhead: 980,096 bytes (0.93 Mb)
[5/7/2005 11:11:56 AM] Video size: 1,808,791,936 bytes (1725.00 Mb)
[5/7/2005 11:11:56 AM] Running compressibility test.
[5/7/2005 11:11:56 AM] Writing the following script to D:\workspace\agk_tmp\white noise_comptest.avs
===========================================================
LoadPlugin("C:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\autocrop.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\RemoveGrainSSE3.dll")

movie = mpeg2source("D:\workspace\agk_tmp\white noise.d2v")
cropclip = autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=0,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
fixed_aspect = 1.18518518518519
c_width = width(cropclip)
c_height = round(height(cropclip) / fixed_aspect)
input_par = float(c_width)/float(c_height)
out_width = 720
out_height = round(float(out_width) / input_par)
hmod = out_height - (floor(out_height / 16 ) * 16)
out_height = (hmod > 4) ? (out_height + (16 - hmod)) : (out_height - hmod)
new_aspect = (float(out_width) / float(out_height)) / fixed_aspect
autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=new_aspect,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
LanczosResize(out_width,out_height)
RemoveGrain(mode=2)
SelectRangeEvery(300,15)
===========================================================
[5/7/2005 11:15:20 AM] Duration was: 3 minutes 24 seconds
[5/7/2005 11:15:20 AM] Speed was: 34.55 fps.
[5/7/2005 11:15:20 AM] Compressibility percentage is: 134.27
[5/7/2005 11:15:20 AM] Switching b-frames off
[5/7/2005 11:15:20 AM] Chosen resolution is: 720x304 ( AR: 2.37 )
[5/7/2005 11:15:20 AM] Predicted comptest value is: 100.43
[5/7/2005 11:15:20 AM] Running first pass.
[5/7/2005 11:15:20 AM] Writing the following script to D:\workspace\agk_tmp\white noise_movie.avs
===========================================================
LoadPlugin("C:\PROGRA~1\AutoGK\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\autocrop.dll")
LoadPlugin("C:\PROGRA~1\AutoGK\filters\RemoveGrainSSE3.dll")

movie = mpeg2source("D:\workspace\agk_tmp\white noise.d2v")
cropclip = autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=0,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
fixed_aspect = 1.18518518518519
c_width = width(cropclip)
c_height = round(height(cropclip) / fixed_aspect)
input_par = float(c_width)/float(c_height)
out_width = 720
out_height = round(float(out_width) / input_par)
hmod = out_height - (floor(out_height / 16 ) * 16)
out_height = (hmod > 4) ? (out_height + (16 - hmod)) : (out_height - hmod)
new_aspect = (float(out_width) / float(out_height)) / fixed_aspect
autocrop(movie,mode=0,wmultof=4,hmultof=4,samples=10,aspect=new_aspect,threshold=34,samplestartframe=0,leftadd=0,rightadd=0,topadd=0,bottomadd=0)
LanczosResize(out_width,out_height)
RemoveGrain(mode=2)
===========================================================
[5/7/2005 11:53:59 AM] Duration was: 38 minutes 39 seconds
[5/7/2005 11:53:59 AM] Speed was: 60.80 fps.
[5/7/2005 11:54:00 AM] Expected quality of first pass size: 106.93
[5/7/2005 11:54:00 AM] Trying to adjust settings.
[5/7/2005 11:54:00 AM] No adjustment is possible
[5/7/2005 11:54:00 AM] Setting min quantizer to 1 to prevent undersize.
[5/7/2005 11:54:00 AM] It is recommended to use smaller size or larger resolution!
[5/7/2005 11:54:00 AM] Running second pass.
[5/7/2005 1:17:37 PM] Duration was: 1 hour, 23 minutes 37 seconds
[5/7/2005 1:17:37 PM] Speed was: 28.10 fps.
[5/7/2005 1:17:37 PM] Job finished. Total time: 2 hours 9 minutes 20 seconds

BigDid
13th May 2005, 18:28
Hi,

I'm not sure I understand what you want so I will make a guess:

You want encodes at 100% quality unless the final size exceeds 2 Gb

If so, do so
- 100% = quality encode 1 pass, quant 2
- 2 Gb = 2 pass encode, quant goes from 2 to 4,5 maybe 6

2 points:
- in your exemple why is it still 2Gb: because AGK used quant 1 ( or 1 & 2) to fit the size
- why is it only 1.5 Gb at 100% quality: because AGK uses quant 2 for quality encodes

In what order do you want to try? depends if you can watch/catch the result of the comp test in size mode in your exemple:
[5/7/2005 11:15:20 AM] Predicted comptest value is: 100.43
stop the size encode and switch to 100% quality mode.
Otherwise do it the other way because time for 1 pass-encode will be less than half the time of the size-encode ( 40/45 mn compared to 2h 9mn)

If my guess is wrong, try again :)

Did

musicnyman
13th May 2005, 23:43
Originally posted by BigDid
Hi,

I'm not sure I understand what you want so I will make a guess:

You want encodes at 100% quality unless the final size exceeds 2 Gb

If so, do so
- 100% = quality encode 1 pass, quant 2
- 2 Gb = 2 pass encode, quant goes from 2 to 4,5 maybe 6

2 points:
- in your exemple why is it still 2Gb: because AGK used quant 1 ( or 1 & 2) to fit the size
- why is it only 1.5 Gb at 100% quality: because AGK uses quant 2 for quality encodes

In what order do you want to try? depends if you can watch/catch the result of the comp test in size mode in your exemple:
[5/7/2005 11:15:20 AM] Predicted comptest value is: 100.43
stop the size encode and switch to 100% quality mode.
Otherwise do it the other way because time for 1 pass-encode will be less than half the time of the size-encode ( 40/45 mn compared to 2h 9mn)

If my guess is wrong, try again :)

Did

yes. but i understand what you're saying. so using quant of more than 1 or 2, it gives the movie better quality anyway right? so even though it can fit on 1.5 on quant 1 or 2, using something more than quant 2+, it'll use the extra space for better quality?

BigDid
14th May 2005, 00:39
Originally posted by musicnyman
yes. but i understand what you're saying. so using quant of more than 1 or 2, it gives the movie better quality anyway right? so even though it can fit on 1.5 on quant 1 or 2, using something more than quant 2+, it'll use the extra space for better quality?
Hi,
You've got the general idea :) , even if this quantizer thing is reverse -> lower is better, Q2 is better than Q3, Q3 better than Q4 and so forth
Exception: Q1 is only marginally better than Q2, use search (on quantizer) to find the threads related to theses exchanges.

Did

musicnyman
14th May 2005, 03:26
Originally posted by BigDid
Hi,
You've got the general idea :) , even if this quantizer thing is reverse -> lower is better, Q2 is better than Q3, Q3 better than Q4 and so forth
Exception: Q1 is only marginally better than Q2, use search (on quantizer) to find the threads related to theses exchanges.

Did

right.. so my suggestion was to have an option to leave it at 100% quality if compressibility test was over 100% instead of doing 2 pass. your suggestion is what i do now. i run 2 pass 2 gig size. if it's over 100%, i stop it and set it to 1 pass 100% quality. but if i wanted to kick off 5 movies this way, i'd have to watch every single one :) for now, i'll just stick to 2 gb max.

manono
16th May 2005, 15:18
Hi-

- in your example why is it still 2Gb: because AGK used quant 1 ( or 1 & 2) to fit the size

You sure about that, BigDid? Have you checked to confirm that AutoGK allows the use of quant 1? I don't know for sure, but I didn't think so. I figured that the different sizes were because the 2 GB encode turned off B-Frames to reach that size, and the 100% encode always keeps B-Frames.

BigDid
16th May 2005, 18:10
Originally posted by manono
Hi-

- in your example why is it still 2Gb: because AGK used quant 1 ( or 1 & 2) to fit the size

You sure about that, BigDid? Have you checked to confirm that AutoGK allows the use of quant 1? I don't know for sure, but I didn't think so. I figured that the different sizes were because the 2 GB encode turned off B-Frames to reach that size, and the 100% encode always keeps B-Frames.
Hi Manono,

I did'nt experiment it myself but it is clearly stated in the log musicnyman has provided:
" Expected quality of first pass size: 106.93
[5/7/2005 11:54:00 AM] Trying to adjust settings.
[5/7/2005 11:54:00 AM] No adjustment is possible
[5/7/2005 11:54:00 AM] Setting min quantizer to 1 to prevent undersize.
[5/7/2005 11:54:00 AM] It is recommended to use smaller size or larger resolution!
[5/7/2005 11:54:00 AM] Running second pass. "

Regards

Did

manono
17th May 2005, 09:50
Hi BigDid-

By golly you're right. After I saw in the log that B-Frames had been turned off, I figured that was the reason and stopped reading. Thanks for the correction.

len0x
20th May 2005, 21:18
Well, I thought having exact target size no matter what is useful as many newbies ask "why did I get undersized file?". If many agree I can revert back to having them...

ZorbaK
22nd June 2005, 16:17
Hi,

My problem with quantizer (i think) is even better.
I have 175% oversize on recoded file...
Requested target file size = 2 GB (max for DVDRs)
Real target file size = 3.46 GB!

I'm try recoding 700 MB Avi
(I have some avis to recode, because my hardware player limitations (GMC & QPEL))

[2005-06-21 22:30:43] AutoGK 2.09b
[2005-06-21 22:30:43] OS: Win2000 (5.0.2195).2
[2005-06-21 22:30:43] Job started.
[2005-06-21 22:30:43] Input file: MyMovie.avi
[2005-06-21 22:30:43] Input codec: XviD
[2005-06-21 22:30:43] Source duration: 1h 46mn 18s
[2005-06-21 22:30:43] Output file: E:\AV\K\MyMovie_agk.avi
[2005-06-21 22:30:43] Output codec: XviD
[2005-06-21 22:30:43] Audio1: 149 Kbps MPEG1/2 L3 2ch
[2005-06-21 22:30:43] Subtitles: none
[2005-06-21 22:30:43] Format: .AVI
[2005-06-21 22:30:43] Target size: 2040Mb
[2005-06-21 22:30:43] Custom resolution settings: fixed width of 608 pixels
[2005-06-21 22:30:43] Standalone support enabled: ESS
[2005-06-21 22:30:43] Started encoding.
[2005-06-21 22:30:43] Source resolution: 608x334
[2005-06-21 22:30:43] Source fps: 25
[2005-06-21 22:30:43] Analyzing source.
[2005-06-21 22:30:43] Writing the following script to E:\AV\K\agk_tmp\lastjob.vcf
......

[2005-06-21 23:30:46] Duration was: 16 minutes 47 seconds
[2005-06-21 23:30:46] Speed was: 7.92 fps.
[2005-06-21 23:30:47] Compressibility percentage is: 309.42
[2005-06-21 23:30:47] Switching b-frames off
[2005-06-21 23:30:47] Chosen resolution is: 608x336 ( AR: 1.81 )
[2005-06-21 23:30:47] Predicted comptest value is: 231.76
[2005-06-21 23:30:47] Running first pass.
[2005-06-21 23:30:47] Writing the following script to E:\AV\K\agk_tmp\MyMovie_agk_movie.avs
.....
[2005-06-22 00:55:01] Duration was: 1 hour, 24 minutes 14 seconds
[2005-06-22 00:55:01] Speed was: 31.55 fps.
[2005-06-22 00:55:01] Expected quality of first pass size: 241.02
[2005-06-22 00:55:01] Trying to adjust settings.
[2005-06-22 00:55:01] No adjustment is possible
[2005-06-22 00:55:01] Setting min quantizer to 1 to prevent undersize.
[2005-06-22 00:55:01] It is recommended to use smaller size or larger resolution!
[2005-06-22 00:55:01] Running second pass.
[2005-06-22 00:55:01] Writing the following script to E:\AV\K\agk_tmp\lastjob.vcf

And the final size of the file was 3.46 GB!


Another problem (or request) is (off topic):
Is it possible to change autoresize behavior.
In my example I have source 608x334 and I want to not resize the movie.
But AutoGK reports target resolution will be 608x336 (I know this is by limitation of size must be multiply of 4 or even more)
It is possible in such cases to change size by adding thin black bars to the film instead resizing by 2 pixels?
I think it is possible by allowing negative values in force cropping fields in Hidden Options...

PS.
Thank you very much for creating this program.

len0x
22nd June 2005, 20:38
in the above case undersize is definitely better...