View Full Version : XviD presets - preliminary thoughts and suggestions
Pages :
1
2
3
4
5
6
7
[
8]
Chainmax
29th September 2006, 01:01
I recently bought a Chaplin DVD from Amazon and intend to make an Xvid encode out of it and would like for it to be playable on standalones here in Uruguay. Thing is, all but a few DivX capable models are generic, so I'd like to stick with something like AutoGK's "ESS-based standalones" mode to ensure maximum compatibility. Upon checking MeGUI's Xvid presets, I noticed that the profiles available there are only comp_check-based. Is there a possibility to include AutoGK's standalone compatibility profiles?
Teegedeck
29th September 2006, 07:52
I guess henryho_hk's wonderful batchfile could be the thing for you to try. Myself I've always been adamant that I don't want to duplicate work that went into XviD's own hardware profiles. Even if they don't work. ;) Does it make sense to multiply the number of presets by the number of hardware profiles? It seems to undermine the initial idea behind the presets - to make high-quality encoding simple.
The true reason if, of course, that I am too lazy. ;)
henryho_hk
29th September 2006, 10:37
Teegedeck, I owe you an apology for creating those unofficial MTK & ESS presets without your consent. ^_^
henryho_hk
29th September 2006, 18:26
Batch file updated again. Now you can drop an AVS on the batch script and start a 2.06-pass XviD encode (fast preset, 6% comp test + 2-pass encode).
http://rapidshare.de/files/34888521/xvid1xenc_v15c.zip.html
The code is shown below:
....obsolete....
henryho_hk
30th September 2006, 09:41
Version 1.5d: Batch AVS processing is back and you don't need to set the installation path now. Also, please avoid spaces in the file/dir names as quote handling is not there yet.
....obsolete old code deleted....
Teegedeck
30th September 2006, 18:26
What can I say? Wow. :)
MarkCurly
30th September 2006, 23:36
...XviD's own hardware profiles. Even if they don't work. ;)
What is it about the XviD profiles that doesn't work?
(I'm particularly interested in if the Home Theatre and Cinema Plus profiles have any problems.)
Thanks
henryho_hk
1st October 2006, 07:10
V.1.5g ~ If the AVI is over 2GB, use ffmpeg (megui bundle) to convert it to OpenDML.
....obsolete old code deleted....
henryho_hk
1st October 2006, 07:37
What is it about the XviD profiles that doesn't work?
These quality presets use some quality-enhancing features that your standalone player may not support. Hence, I have coarsely modified these presets (mainly turning off those features) hopefully to make them playable in standalone players. I recommend you to try and test.
Indeed, if you have a spare computer at home, you've got to try GeeXboX. You will be surprised how useful it can be.
http://geexbox.org/en/start.html
henryho_hk
2nd October 2006, 14:04
Version 1.6b ~
1) Presets are read from the file bin\xvid_presets.csv
2) Names with spaces can be handled
3) One-pass "Crap" presets are added
4) Zone errors fixed (1.6b)
http://rapidshare.de/files/35222476/xvidenc_16b.zip.html
rack04
2nd October 2006, 18:55
Version 1.6b ~
1) Presets are read from the file bin\xvid_presets.csv
2) Names with spaces can be handled
3) One-pass "Crap" presets are added
4) Zone errors fixed (1.6b)
http://rapidshare.de/files/35222476/xvidenc_16b.zip.html
Can you possibly explain how to use your batch script? Do I just modify the sample.avs and drag/drop to batch script?
Livesms
3rd October 2006, 15:03
Can you possibly explain how to use your batch script? Do I just modify the sample.avs and drag/drop to batch script?
NO. You can just write
xvidenc_16b cmprchkhq br 1350 your_avs_screen.avs
henryho_hk
3rd October 2006, 15:12
Version 1.6c ~~ Comp Test for >=500 frames only
http://rapidshare.de/files/35343151/xvidenc_16c.7z.html
.... compressed twice with 7zip with password xvid_presets
Usage:
1) have a win2k/xp box
2) open a command prompt
3) extract the 7z package keeping the directory structure
4) run xvidenc_16c.bat -h
OR
1) modify DEFSET, DEFSZU and DEFSZV in xvidenc_16c.bat to the value you desire
2) drag and drop some AVS files onto the batch and then wait for it to finish (remember, the AVS script can't have an return statement at the end)
Livesms
3rd October 2006, 16:10
Version 1.6c ~~ Comp Test for >=500 frames only
http://rapidshare.de/files/35343151/xvidenc_16c.7z.html
.... compressed twice with 7zip with password xvid_presets
Usage:
1) have a win2k/xp box
2) open a command prompt
3) extract the 7z package keeping the directory structure
4) run xvidenc_16c.bat -h
OR
1) modify DEFSET, DEFSZU and DEFSZV in xvidenc_16c.bat to the value you desire
2) drag and drop some AVS files onto the batch and then wait for it to finish (remember, the AVS script can't have an return statement at the end)
Thank you...
Can you post your archive to http://dump.ru or http://slil.ru
This is Russian filesharing services but it has no annoing "wait for 65 minutes" or "you can't download now"
The same xvidenc_16c.7z.html reposted here. http://dump.ru/files/3/329866955/xvidenc_16c.7z
MD5 hash: 0164c2758b02597d390234086e411c9d
henryho_hk
3rd October 2006, 16:31
I uploaded it here http://dump.ru/files/6/673400987/. Still double compressed and encrypted. The MD5 is 0164c2758b02597d390234086e411c9d.
Livesms
3rd October 2006, 16:34
I uploaded it here http://dump.ru/files/6/673400987/
Comparing to previous (1.6b) there is no help screen with blank comman-line parametres - and pause (press any key to continue...) in te end.
As for me help with blank command line and no pause is more convenient.
henryho_hk
3rd October 2006, 17:12
Can you possibly explain how to use your batch script?
Before running the batch script, please read Teegedeck's original explanation of the presets in these 2 posts:
http://forum.doom9.org/showthread.php?p=796900#post796900
http://forum.doom9.org/showthread.php?p=841263#post841263
The default settings (esp. the default bitrate which I use for 640x480 tdeint'ed DVD) may not suit your materials, even if you are using the comp-test assisted modes. Do more tests.
henryho_hk
4th October 2006, 16:44
Version 1.6d
1) Full comp test for <500 frames while 6% comp test for >=500 frames
2) TS (target size) comp test ~ formula fixed
3) New "cmprchkonly" mode ... self-explanatory
4) BPPX (target bit/pixel) mode added ... for fun only, use with caution
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
rem mode con cp select=437
set INSPATH=%~dp0
set BINPATH=%INSPATH%bin
set MATPATH=%INSPATH%matrix
set XVIDEXE=%BINPATH%\xvid_encraw_20060621.exe
set BCFLEXE=%BINPATH%\bc.exe
set FFMGEXE=%BINPATH%\ffmpeg.exe
set AVSUEXE=%BINPATH%\avsutil.exe
set PRESETF=%BINPATH%\xvid_presets.csv
set DEFSET=cmprchkfast
set DEFSZU=br
set DEFSZV=1300
if "%~1"=="" (
echo Usage: "%~0" cmpr{chk/gt30/gt45/gt58/gt90}{hq/fast/crap/mtk/ess} {br/ts/bppx} {value} {filename.avs} {filename2.avs} ...
echo.
echo br 1300 means a target bitrate of 1200kbps
echo ts 1300 means a target size 1200KB
echo bppx 0.181 means a target rate of 0.181 bit/pixel
echo Use cmprchkhq, fast, crap, mtk or ess for comp-test assisted encodes.
echo ^(Note: crap, mtk and ess are not official Teegedeck presets.^)
echo Use cmprchkonly for comp test only.
echo When only filename.avs is specified, "%DEFSET% %DEFSZU% %DEFSZV%" is assumed.
echo To force I-Frames ^(e.g. chapter pts^), create a plain filename.zones.txt.
echo.
goto GEND
)
if /i "%~x1"==".avs" (
for %%A in (%*) do call "%~0" %DEFSET% %DEFSZU% %DEFSZV% "%%~A"
pause
goto GEND
)
if /i not "%~x1"==".avs" if /i not "%~x2"==".avs" if /i not "%~x3"==".avs" if /i "%~x4"==".avs" if /i "%~x5"==".avs" (
for %%A in (%*) do if /i "%%~xA"==".avs" call "%~0" %1 %2 %3 "%%~A"
pause
goto GEND
)
rem -------- one by one now ----------
if "%~4"=="" (
echo Please specify source file names, or even "*.avs".
goto GEND
)
if not exist "%~4" (
echo Source file "%~4" is not found.
goto GEND
)
if /I not "%~x4"==".avs" (
echo Source file "%~4" must be an AVS file.
goto GEND
)
for %%I in ("%~4") do (
set SRCFILE=%%~fI
set SRCDISK=%%~dI
set SRCPATH=%%~pI
set SRCNAME=%%~nI
set SRCEXTT=%%~xI
set SRCPREF=%%~dpnI
set TMPPATH=%%~dpItmp\
)
set SRCTMPP=%TMPPATH%%SRCNAME%
pushd %SRCDISK%%SRCPATH%
set WAY=%~1
set SIZU=%~2
set SIZV=%~3
if not exist %TMPPATH%\NUL mkdir %TMPPATH%
echo.
echo.
echo start "Source Check" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.avs" -frames 1
start "Source Check" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.avs" -frames 1 2> "%SRCTMPP%.fps"
for /f "usebackq tokens=1,2,3* delims=()" %%A in (`type "%SRCTMPP%.fps" ^| find "xvid [info]" ^| find "fps"`) do set ORIFFPS=%%B
for /f "usebackq" %%A in (`echo %ORIFFPS% ^| "%BCFLEXE%" -l`) do set ORIGFPS=%%A
for /f "usebackq tokens=1,2,3,4,5,6,7,8* delims=, " %%A in (`type "%SRCTMPP%.fps" ^| find "xvid [info]" ^| find "fps"`) do (
set ORIWIDT=%%E
set ORIHEIG=%%G
)
for /f "usebackq" %%A in (`%AVSUEXE% "%SRCFILE%"`) do set ORIFRM=%%~A
if /I "%SIZU%"=="br" (
set SIZ=-bitrate %SIZV%
) else if /I "%SIZU%"=="ts" (
set SIZ=-size %SIZV%
) else if /I "%SIZU%"=="bppx" (
for /f "usebackq tokens=1,2*" %%A in (`echo x ^= %SIZV% * %ORIWIDT% * %ORIHEIG% * %ORIFFPS% / 1000 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do (
set SIZU=br
set SIZV=%%A
set SIZ=-bitrate %%A
)
) else (
set SIZ=-bitrate %DEFSZV%
)
if /I "%WAY:~0,7%"=="cmprchk" (
set PPC=-zones 0,q,3,KO -vhqmode 0 -qtype 1 -qmatrix "%MATPATH%\Didees-SixOfNine.cqm" -nopacked -quality 4 -turbo
set W3=!WAY:~7!
if /i not "!W3!"=="mtk" if /i not "!W3!"=="ess" set PPC=!PPC! -max_bframes 2 -bquant_ratio 162 -bquant_offset 0
if /i "!W3!"=="mtk" set PPC=!PPC! -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
if /i "!W3!"=="ess" set PPC=!PPC! -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
set CTMFRM=500
(
type "%SRCFILE%"
echo.
if "!ORIFRM!" GEQ "!CTMFRM!" echo SelectRangeEvery^(233, 14^)
) > "%SRCPREF%.ct.avs"
for /f "usebackq" %%A in (`%AVSUEXE% "%SRCPREF%.ct.avs"`) do set SRCFRM=%%~A
echo start "Compressibility Test 0.06" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.ct.avs" -pass1 "%SRCTMPP%.ct.stats" -progress 100 !PPC!
start "Compressibility Test 0.06" /b /wait /low "%XVIDEXE%" -type 2 -i "%SRCPREF%.ct.avs" -pass1 "%SRCTMPP%.ct.stats" -progress 100 !PPC! 2> "%SRCTMPP%.ct.hd"
move "%SRCPREF%.ct.avs" "%SRCTMPP%.ct.avs"
set SRCFPS=!ORIFFPS!
set CTTYPE=STL
if /i not "!W3!"=="mtk" if /i not "!W3!"=="ess" set CTTYPE=NRM
set LINENUM=0
set CTFRM=0
set CTSIZ=0
(
echo 0 \
for /f "usebackq skip=3 tokens=1,2,3,4,5,6,7* delims= " %%a in (`type "%SRCTMPP%.ct.stats"`) do (
if !ORIFRM! GEQ !CTMFRM! if "!CTTYPE!"=="NRM" if not !LINENUM! EQU 0 if not !LINENUM! EQU 1 if not !LINENUM! EQU 2 if not !LINENUM! EQU 11 if not !LINENUM! EQU 12 if not !LINENUM! EQU 13 (
set /A CTFRM+=1
echo + %%f \
)
if !ORIFRM! GEQ !CTMFRM! if "!CTTYPE!"=="STL" if not !LINENUM! EQU 0 if not !LINENUM! EQU 1 if not !LINENUM! EQU 12 if not !LINENUM! EQU 13 (
set /A CTFRM+=1
echo + %%f \
)
if !ORIFRM! LSS !CTMFRM! (
set /A CTFRM+=1
echo + %%f \
)
SET /A LINENUM=!LINENUM! + 1
if !LINENUM! GEQ 14 SET LINENUM=0
)
echo + 0
) > "%SRCTMPP%.ct.sz"
for /f "usebackq tokens=1,2* delims= " %%A in (`type "%SRCTMPP%.ct.sz" ^| "%BCFLEXE%" -l`) do SET CTSIZ=%%A
echo.
echo.
echo Source FPS = !SRCFPS!
echo No. of frames in CT AVS = !SRCFRM!
echo No. of frames for CT = !CTFRM!
echo Size of selected frames = !CTSIZ!
if /I "%SIZU%"=="br" (
echo Target Bitrate = !SIZV!
for /f "usebackq tokens=1,2* delims= " %%A in (`echo x ^= !SIZV! * !CTFRM! * 1000 / 8.0 / ^( !SRCFPS! ^) / !CTSIZ! * 100 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do set CPTRS=%%A
)
if /I "%SIZU%"=="ts" (
echo Target Size in KB = !SIZV!
for /f "usebackq tokens=1,2* delims= " %%A in (`echo x ^= !SIZV! * 1024 / !ORIFRM! * !CTFRM! / !CTSIZ! * 100 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do set CPTRS=%%A
)
echo Compressibility Test = !CPTRS!
set PRESET=cmprgt30!WAY:~7!
if !CPTRS! GEQ 45 set PRESET=cmprgt45!WAY:~7!
if !CPTRS! GEQ 58 set PRESET=cmprgt58!WAY:~7!
if !CPTRS! GEQ 90 set PRESET=cmprgt90!WAY:~7!
if /i not "!WAY!"=="cmprchkonly" (
echo Preset !PRESET! is choosen.
set WAY=!PRESET!
)
)
if /i "!WAY!"=="cmprchkonly" goto GEND
set W1=!WAY:~0,6!
set W2=!WAY:~6,2!
set W3=!WAY:~8!
set PRESET=%WAY%
if /i not "!W1!"=="cmprgt" set PRESET=cmprgt45fast
if /i not "!W2!"=="30" if /i not "!W2!"=="45" if /i not "!W2!"=="58" if /i not "!W2!"=="90" set PRESET=cmprgt45fast
if /i not "!W3!"=="mtk" if /i not "!W3!"=="ess" if /i not "!W3!"=="crap" if /i not "!W3!"=="fast" if /i not "!W3!"=="hq" set PRESET=cmprgt45fast
set W1=!PRESET:~0,6!
set W2=!PRESET:~6,2!
set W3=!PRESET:~8!
for /f "usebackq tokens=1,2* delims= " %%A in (`echo x ^= !ORIGFPS! * 10 + 0.5 ^; scale ^= 0 ^; x /^= 1 ^; x ^| "%BCFLEXE%" -l`) do set KEYINT=%%A
for /f "usebackq skip=2 tokens=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26* delims=," %%A in (`type "%PRESETF%"`) do if "!W2!"=="%%~A" if /I "!W3!"=="%%~B" (
set PP0=-nopacked -progress 100 -max_key_interval !KEYINT!
if /I "%%~B"=="ESS" set PP0=!PP0! -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
if /I "%%~B"=="MTK" set PP0=!PP0! -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000
if not "%%~D"=="." set PP0=!PP0! -quality %%~D
if not "%%~E"=="." set PP0=!PP0! -vhqmode %%~E
if /I "%%~F"=="Y" set PP0=!PP0! -lumimasking
if /I "%%~G"=="Y" set PP0=!PP0! -qpel
if not "%%~H"=="." set PP0=!PP0! -max_bframes %%~H
if not "%%~I"=="." set PP0=!PP0! -bquant_ratio %%~I
if not "%%~J"=="." set PP0=!PP0! -bquant_offset %%~J
if /I "%%~K"=="H263" set PP0=!PP0! -qtype 0
if /I "%%~K"=="MPEG" set PP0=!PP0! -qtype 1
if /I "%%~K"=="ULR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\eqm_v3ulr_rev3.xcm"
if /I "%%~K"=="LR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\eqm_v3lr_rev1.xcm"
if /I "%%~K"=="HR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\eqm_v3hr_rev1.xcm"
rem if /I "%%~K"=="HR" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\heini_mr.xcm"
if /I "%%~K"=="6OF9" set PP0=!PP0! -qtype 1 -qmatrix "%MATPATH%\Didees-SixOfNine.cqm"
if not "%%~L"=="." set P1Q=%%~L
if not "%%~M"=="." set PP0=!PP0! -imin %%~M
if not "%%~N"=="." set PP0=!PP0! -imax %%~N
if not "%%~O"=="." set PP0=!PP0! -pmin %%~O
if not "%%~P"=="." set PP0=!PP0! -pmax %%~P
if not "%%~Q"=="." set PP0=!PP0! -bmin %%~Q
if not "%%~R"=="." set PP0=!PP0! -bmax %%~R
if not "%%~S"=="." set PP0=!PP0! -chigh %%~S
if not "%%~T"=="." set PP0=!PP0! -clow %%~T
if not "%%~U"=="." set PP0=!PP0! -ostrength %%~U
if not "%%~V"=="." set ZBS=%%~V
if /I not "%%~W"=="Y" set PP0=!PP0! -nochromame
if /I "%%~X"=="Y" set PP0=!PP0! -bvhq
if /I "%%~Y"=="Y" set PP0=!PP0! -turbo
set ZZ1=,q,!P1Q!,KO!ZBS!
set ZZ2=,w,1,KO!ZBS!
if "%%~C"=="1" (
set PP1=!PP0! -pass1 "%SRCTMPP%.stats" -type 2 -i "%SRCFILE%"
)
if "%%~C"=="2" (
set PP2=!PP0! %SIZ% -pass2 "%SRCTMPP%.stats" -type 2 -i "%SRCFILE%" -avi "%SRCPREF%.avi"
)
if /I "%%~B"=="CRAP" (
set PP0=!PP0! -single -cq !P1Q! -type 2 -i "%SRCFILE%" -avi "%SRCPREF%.avi"
)
)
set ZP1=-zones 0%ZZ1%
set ZP2=-zones 0%ZZ2%
if exist "%SRCPREF%.zones.txt" for /f "usebackq" %%f in (`type "%SRCPREF%.zones.txt"`) do if 0%%f neq 0 (
set ZP1=!ZP1!/%%f%ZZ1%
set ZP2=!ZP2!/%%f%ZZ2%
)
set ZP0=%ZP2%
echo.
if /I "!W3!"=="CRAP" (
echo start "%PRESET% - Single Pass" /b /wait /low "%XVIDEXE%" %ZP0% %PP0%
start "%PRESET% - Single Pass" /b /wait /low "%XVIDEXE%" %ZP0% %PP0%
) else (
echo start "%PRESET% - Pass 1" /b /wait /low "%XVIDEXE%" %ZP1% %PP1%
start "%PRESET% - Pass 1" /b /wait /low "%XVIDEXE%" %ZP1% %PP1%
echo.
echo start "%PRESET% - Pass 2" /b /wait /low "%XVIDEXE%" %ZP2% %PP2%
start "%PRESET% - Pass 2" /b /wait /low "%XVIDEXE%" %ZP2% %PP2%
)
rem if the AVI is over 2,000,000,000 bytes, use ffmpeg to convert it to OpenDML AVI
if exist "%SRCPREF%.avi" for %%A in ("%SRCPREF%.avi") do if %%~zA GTR 2000000000 (
echo.
"%FFMGEXE%" -i "%SRCPREF%.avi" -vcodec copy -y -f avi "%SRCPREF%.opendml.avi"
del /f /q "%SRCPREF%.avi"
)
echo.
:GEND
drob
6th October 2006, 14:42
What would be the MEGui profiles/preset that would give me best quality, (size not an issue), but would keep mediatek compatibility (that is no gmc or packed bitstream and max 2 bframes).
shadell
10th October 2006, 14:39
I've tested these settings (the HQ variants) twice now and compared the results to those created using the 'standard' doom9 settings at
http://www.doom9.org/index.html?/gknot-codecsetup-xvid11.htm
In both cases I preferred the standard settings - there was less noise.
foxyshadis
10th October 2006, 19:39
The entire idea of the HQ settings is to retain noise and film grain along with detail. If you prefer a smoother picture, they really aren't for you.
shadell
18th October 2006, 02:47
The entire idea of the HQ settings is to retain noise and film grain along with detail. If you prefer a smoother picture, they really aren't for you.
No, I am talking about the amount of XviD artifact noise.
henryho_hk
6th December 2006, 00:59
Time to pump this thread up again. ^_^
I have tested Teegedeck's presets on a famous CG movie. For each preset, both best case and worst case are performed. I have captured a common I-Frame:
Teegdeck's Fast Presets: http://dump.ru/files/1/1246579557/
Teegdeck's Quality Presets: http://dump.ru/files/6/6767911858/
Now I understand what's meant by ULR's sharpening effect.
Dams
6th December 2006, 11:12
@henryho_hk : interesting,
well, i've seen the post named "new revision of presets", but we don't see where is the anim preset or don't understand new preset :D
Personally, I use recently the preset on first page for anim , and I'm happy with it. (+/- 1150 kb/s , duration 1:10:00)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.