Log in

View Full Version : avs2qxvid.bat [AVS to Quality XviD]


Pages : 1 2 3 4 [5] 6

SilaSurfer
2nd November 2009, 15:01
Hello Henryho-hk first off all thank you very much for this awasome tool, and Teegedeck for his awasome presets. I did couple of rips of my dvds and it looks great. I have couple of questions.
First: I do my encodes in Mpeg standard quant type because i watch my rips on standalone dvd player so I changed in presets file from the 6of9 matrix to Mpeg but I get undersized files and I think its because of comp check that uses 6of9 matrix. Is this editable so it may be changed?
Second: I'm always adding audio and splitting later so doing some of my rips i get splitting when file reaches 2000MB so where can I change this so i would have a single file using HQMTK presets. Thanks for your time and keep it up you've given us something to play with. hehe

henryho_hk
4th November 2009, 16:35
(((1)))

a) Download an updated version of XviD from http://www.free-codecs.com/download/Nic_XviD_Codec.htm

b) Replace the xvidcore.dll in the bin directory with the above updated one

c) Add two new presets in xvid_presets_25h.csv. Try them out.


"HVAQMTK-00","1","5","1",".",".","1","162","0","H263",".","2","31","2","31","2","31",".",".",".",".",".",".","Y","-lumimasking"
"HVAQMTK-00","2","6","1",".",".","1","162","0","H263",".","2","31","2","31","2","31",".",".",".",".","Y","Y",".","-lumimasking"
"H263VAQ-00","1","5","1",".",".","2","162","0","H263",".","2","31","2","31","2","31",".",".",".",".",".",".","Y","-lumimasking"
"H263VAQ-00","2","6","4",".","Y","2","162","0","H263",".","2","31","2","31","2","31",".",".",".",".","Y","Y",".","-lumimasking"


(((2)))

There are two ways to avoid the splitting.

i) [Seems not working....] Rename the HQMTK presets to something like HQMKK. (i.e., no "MTK" in the preset name)

ii) Look for the following codes in the batch file and switch to the 2nd cide segment.


rem if "!MUXFMT!"=="STL" (
echo AVI HAALIMODE 0 >> "!TMPAMG!"
echo OPENDML 0 >> "!TMPAMG!"
echo LEGACY 0 >> "!TMPAMG!"
echo RECLISTS 0 >> "!TMPAMG!"
echo NUMBERING $Name_$Nbr{2} >> "!TMPAMG!"
echo MAXFILESIZE ON >> "!TMPAMG!"
echo MAXFILESIZE 2000 >> "!TMPAMG!"
rem ) else (
rem echo AVI HAALIMODE 1 >> "!TMPAMG!"
rem echo OPENDML 1 >> "!TMPAMG!"
rem echo LEGACY 1 >> "!TMPAMG!"
rem echo RECLISTS 0 >> "!TMPAMG!"
rem echo NUMBERING OFF >> "!TMPAMG!"
rem echo MAXFILESIZE OFF >> "!TMPAMG!"
rem )

SilaSurfer
6th November 2009, 17:16
Thanks for your answer. With the HQMTK presets I can play avi files on my standalone just the filesize doesn't add up. With the 6of9 matrix it's harder to compress the video then with Mpeg standard so my filesizes are not wright. I was thinking of doing a compcheck with Mpeg standard matrix it would give me more
accurate results.

For Example: I'm converting a DVD movie and the resolution is 720x304, the original audio is used Ac3 448 6 channel. My aiming filesize is 1800MB. Now when I do a compcheck it gives me the result 81% so I go for HqMtk58(MPEG standard) and the resulting filesize is like 400 MB smaller. And when the first pass is done the avarage bitrate is 1408Kbit/s and desired one is 1834Kbit/s. This is not the only case.

Can I change like in the presets, compcheck settings (6of9 to Mpeg standard)


For the spliting part I came around that by tuning up a little the TGHQ presets removing Q-pel and replacing 6of9 with Mpeg standard. So I use this presets for videos that are over 2000MB

henryho_hk
8th November 2009, 11:32
The undersized problem is partly due to "-altpass2". Try changing it to "-pass2" in the batch script.

Also, 6of9 is not 100% standalone compatible. Use 6of9-HVS (I remember that I use it in the MTK presets). You also need to change the number of consecutive B-frames to "1" instead of "2".

SilaSurfer
8th November 2009, 19:18
Thank for your time Henryho_hk. I'm really taking your time I know, sorry. The custom matrices don't work on my standalone, none of the used ones. i tried them with short encodes from the movies. I just encoded Transformers from DVD and the filesize was correct.The compcheck gave me 60% and I encoded the movie with TGHQ58 preset (Mpeg standard and no Qpel). What I wanted to ask you if the settings for compcheck are editable so I can change settings like in the presets. Thanks again!

henryho_hk
9th November 2009, 01:00
Um.... If your player can take MPEG or H263 matrices only, I recommend you trying the universal preset "HVAQMTK-00" in post #207. To ensure that N-VOP is not generated, you can also use the new XviD builds in http://jawormat.republika.pl/xvid.html and add "-drop -1" in the xvid_encraw command line. (Tips: look for lines below "set ZZ1=,q,!P1Q!,K!CAT!!ZBS!")

Jawor
9th November 2009, 20:09
To ensure that N-VOP is not generated, you can also use the new XviD builds in http://jawormat.republika.pl/xvid.html and add "-drop -1" in the xvid_encraw command line.
xvid_encraw doesn't seem to accept --drop -1.

I uploaded special xvidcore.dll files that treat "0" like "-1".
1.2.2 (http://jawormat.republika.pl/XviD_122_encraw.zip)
1.3.-127 (http://jawormat.republika.pl/XviD_13-127_encraw.zip)

henryho_hk
10th November 2009, 01:03
squid's 20070831 version does accept "-drop -1". There is no error. But I need to test whether there is really no N-VOP generated.

SilaSurfer
10th November 2009, 15:14
Hey Henryho_hk I want to test something and I need your assistance. How can I change custom matrix usage in your batch file. I want to change to a diffrent custom matrix for Hqmtk presets. I'm on to something here and I don't know how to change that.


It's ok i figured it out.

SilaSurfer
10th November 2009, 17:39
Henryho_hk. I've done some researching, and I found something interesting that some matrices are fully supported by MediaTek1389XX chipsets which standalone players use. Five of them were labeled as perfect playback.

Andreas_78er matrix
Deedes Semi insane matrix
Hvs best picture matrix
hvs better picture matrix
hvs good picture matrix

The standalone that was tested uses MediaTek1389DE chip/decoder, the other ones from this family are GE, FE, EE(mine)

So I've done three encodes one with HVS best picture matrix, Semi insane and Andreas_78er matrix with your batch file. Just changed settings for matrices in batch file and preset file, other setting stayed as you wrote them. Avarage bitrate was 1500Kbit/s. I'm going to test them tonight on my dvd player.

Andreas_78er: compcheck 70%, 6of9 59%, Hqmtk58 preset, Visual quality is very good and resulting filesize is 25MB smaller than desired one

Hvs best picture: compcheck 97%, 6of9 59%, Hqmtk90 was used and resulting filesize is 18MB smaller than desired one

Semi insane matrix produces excellent results: hqmtk58 preset, resulting filesize 25MB larger then desired one

I hope this works on my player. Visual quality is very good with Andreas_78er matrix.

And I'm sorry for double posting.

SilaSurfer
11th November 2009, 15:51
Hello. Yesterday I tried encodes with matrices above and results are bad. Playback fine but with artifacts, with all of them so its Mpeg standard for me at the moment. You were right henryho_hk about "change the number of consecutive B-frames to "1" instead of "2". Now I'm getting right filesizes with HQMtk presets. Thanks again. I'm seriously thinking of buying a HTPC. hehe. One more question about ripping from dvd, What do you think is better "IEEE -1180 Reference" or "64-bit Floating Point" in Dgindex?

henryho_hk
13th November 2009, 03:42
Changing from "-altpass2" to "-pass2" is for fixing undersizing. Cons.B-frame=1 is for compatibility.

As for idct, it does not really matter. For best results, it is said that the encoding and decoding idcts should match each other. However, I dunno whether there is any way to check for the encoding idct. Hence, I use the "32-bit SSE2 MMX" all the time.

SilaSurfer
13th November 2009, 14:33
What I meant is that I'm happy with TGHQ presets with MPEG Standard and no Qpel, I get right filesizes. While I was looking at your batch file I found this url:
"http://members.optusnet.com.au/squid_80/xvid_encraw.zip"
so I downloaded latest Xvid_encraw version and replaced the one in you package, because I noticed somewhere on the net it is optimimized. Is this ok?
And where do you edit the setting so packed bitstream are not used during encodings, my player boorks on them, so I don't have to remove them via MPEG4Modifier. This is the last thing I need ,so thank you very much Henryho_hk for your time I appreciate it.

henryho_hk
13th November 2009, 15:17
Look for

set PPK=-packed
if /I "!ML:~-3!"=="-CT" set PPK=-nopacked

SilaSurfer
13th November 2009, 15:51
Thanks but what about Xvid_Encraw?

henryho_hk
13th November 2009, 16:39
Which version are you talking about?

SilaSurfer
13th November 2009, 16:51
The latest one from here http://members.optusnet.com.au/squid_80/xvid_encraw.zip
I changed the one from your package with this one and encoding is faster at least on my PC, could you try it out please.

henryho_hk
14th November 2009, 02:18
Isn't my batch using that version already? nvm. As long as it is from squid_80, it is always okay.

SilaSurfer
14th November 2009, 17:08
Well the one that I downloaded seems to use only one processor core, but I have a dual core processor and the one that was supplied with your batch file I remember that I saw while encoding both cores were used, but the downloaded one encodes faster at least here.
Your package: Xvid_Encraw 2007.02.03
Downloaded One: Xvid_Encraw 2007.08.31

SilaSurfer
18th November 2009, 16:51
What Xvid version do you use Henryho_hk with this presets, I've been having some problem while encoding LOTR: Fellowship of the Ring DVD Extended version. At th begining of the movie where studios logo comes up I see green blocks and this is only in the dark areas. Tried everything and it seems that xvid encraw is producing this anomaly, it is not present in the source, I also tried it on the shorter version of LOTR and it is there so two dvds, Idct is not a culprit because while encoding in Virtual dub I don't get this green "blocks" so I don't know what to do. Any suggestions, I would be very grateful

henryho_hk
19th November 2009, 12:11
Try Jawor's XviD compiles at http://forum.doom9.org/showthread.php?p=1342310#post1342310

Which software player are you using?

SilaSurfer
19th November 2009, 16:41
Thanks for your response. This is basicly the product of encoding I don't see it in Wmplayer classic when previewing avs script and I wan't to correct myself it is also present in Virtual dub after encoding with settings in xvid from TGHQ presets. It is like a big green block stretching from right side of the screen to the left, it is more visible for example when the studios logo is shown where there is so much darkness and also through the rest of the movie in very dark scenes.

Dvd Decrypter last version
Avisynth version 2.5.8 last stable one, tried also with 2.5.5
Xvid codec 1.2.2 stable from Koepi, uninstaled and did a fresh install
Dgindex 1.5.6 latest one tried also on 1.4.3 Tried 4 different Idcts still present

This is also seen on my standalone. Then I tried with Virtualdub again and encoded with Default xvid setting, it was still there but not so visible. Today I tried it on my sisters Pc, with these apps same thing. Now I will do something that I didn't do for a long long time, I am going to encode in divx so I can eliminate Xvid as a culprit. Using BsPlayer for watching. Any suggestions?



Update: Tried with Divx 7 version same script same settings in all apps and no green artifacts, so all of them are fine: Dgindex, Avisynth and ripping is ok. Something to do with Xvid. What do you think?. Could this be a version of Xvid that is producing this, if so should I try Jawors builds?

Update 2: It seems this is only produced with Koepi's version of Xvid 1.2.2 codec. I tried Jawor's 1.2.2 version with your batch file with TGHQ-90(6of9) preset and the green blocks are gone. I wonder if I can use Jawors version for all presets?

henryho_hk
24th November 2009, 04:13
yes, u can use Jawor's version for all presets.

SilaSurfer
25th November 2009, 14:24
Hey Henryho_hk thanks again for responding, I would post this problems that I have somewhare else on this forum but it is against the rules to post same question on other threads. The problems are still present but what is known now is that it is the decoding issue, this is why green blocks aren't visible with Jawors compile because it doesn't come with a decoder so when I was viewing it block were not there and it is also not present in VirtualDub when previewing the encoded video. Ffdshow decoding gives me the same thing. So here is what I found out so far:

1.Tried only Xvid 1.2.2 versions
2. It is only the problem with DVD sources, had some files on my disk that are captures from digital TV 720p resolutions that I did some time ago with x264 codec based on guides on this site, and I encoded them to xvid 480p with your batch file and Teegedeck presets and "no green blocks" anywhare so only when I'm encoding from dvd sources.
3. Basicly this green blocks are more ampliefied with diffrent settings used in xvid, more detail more green blocks. Not so visible with h263, more with Mpeg standard, a lot with 6of9.
4. Not visible while viewing in VirtualDub or if there is no xvid decoder present on my PC. Tried also Bsplayer, Wmplayer 9, Vlc Player and my standalone, so only software and hardware players. Running Vista 32bit on my sistem.

I think you have more experiance then me so if you could help I would be very grateful and thanks for everything.

henryho_hk
26th November 2009, 03:51
Try cutting about 5~10 seconds of "green-blocked" segment of the AVI and upload it to a somewhere so that we can take a look too. Make sure those green blocks are visible when loaded in Virtualdub.

SilaSurfer
27th November 2009, 11:14
Ok here you go, I uploaded it on the same page where you uploaded your batch file.

http://www.sendspace.com/file/9x1pbo

Green block is not visible in VirtualDub thats the point it is only visible in software and hardware players and if I use Xvid, Divx and FFdshow decoders. When there is no decoder present on my pc if I uninstall them no green block. Take a look in fullscreen, it is from the beginning of the movie about 1000 frames where this is visible. Thanks for your help.

Update!
I think this is due to low bitrate usage by the codec, because of high compression in those dark areas of the video, when I encoded the movie with h263 matrix the green blocks are not present, so if I would like to encode it with for example Tghq-58 preset I need to "lower the compressibility-force higher bitrates" in those areas. What do you recommend?

henryho_hk
6th December 2009, 10:51
Try removing "-lumimasking" from the preset you are using.

SilaSurfer
6th December 2009, 15:40
I don't see it:

"TGHQ-58","1","5","1",".",".","2","162","0","6OF9","3",".",".",".",".",".",".",".",".",".",".",".",".","Y","."
"TGHQ-58","2","6","4",".","Y","2","162","0","6OF9",".","3","4","3","5","3","5","10","3",".",".","Y","Y",".","."

It is only present in "30" presets:

"TGHQ-30","1","5","1",".",".","2","162","0","STUL","3",".",".",".",".",".",".",".",".",".",".",".",".","Y","-lumimasking"
"TGHQ-30","2","6","4",".","Y","2","162","0","STUL",".","3","5","3","5","3","5","30","15",".",".","Y","Y",".","-lumimasking"

I don't use those presets, only TGHQ-45-58-90

I was thinking, maybe using Blockbuster filter in those areas but I don't have experiance with it.

henryho_hk
9th December 2009, 10:34
You need MTK or HQMTK presets for standalone hardware players.

Yet I dunno why your computer has playback problems. There are no such problems in my computer, in ms media player (+ffdshow), mpc-hc or kmplayer.

SilaSurfer
13th December 2009, 16:43
You need MTK or HQMTK presets for standalone hardware players.

I forgot to mention that I've changed a DVD player which has Zoran chipset with mine and is handling CQMs very good.

Yet I dunno why your computer has playback problems. There are no such problems in my computer, in ms media player (+ffdshow), mpc-hc or kmplayer.

I presume you are using ffdshow for decoding in all cases, if so do you have any filtering enabled in ffdshow? If it is my computer, then why is it also present on my satndalone? I'll try Blockbuster and see if that changes anything. Thanks for everything

henryho_hk
14th December 2009, 05:42
The TGHQ and TGFAST presets use 2 consecutive B frames, QPel, etc. Standalone players are usually not happy with these settings.

Green blocks appear to be decoding errors. I suspect that some outdated codecs are taking the role in ur computer. Our computers are usually much more capable and flexible than the standalone players, unless somethings are messing up, such as codec packs, renderers, display drivers (very rarely), etc.

chesterman
9th January 2010, 01:08
The TGHQ and TGFAST presets use 2 consecutive B frames, QPel, etc. Standalone players are usually not happy with these settings.

Green blocks appear to be decoding errors. I suspect that some outdated codecs are taking the role in ur computer. Our computers are usually much more capable and flexible than the standalone players, unless somethings are messing up, such as codec packs, renderers, display drivers (very rarely), etc.

Agreed.

boveyking
9th March 2010, 01:32
I tried to produce an avi with avs2qxvid, there is no audio. I also tested with xvid_encraw, there is still no audio.

Before testing with this tool, I tried with avs2Avi, there is no audio too.

Does anyone know why there is no audio?What configuration too to modify in order to produce the audio.

The avs scripts is so simple just like:

AVISource("D:\dev\video-process\avs\sample\avi-1.AVI",audio=true)

Thank you every much.

henryho_hk
10th March 2010, 03:15
xvid_encraw does not encode audio.

When u load ur simple AVS script in Virtualdub, is there any audio?

roozhou
11th March 2010, 08:06
I tried to produce an avi with avs2qxvid, there is no audio. I also tested with xvid_encraw, there is still no audio.

Before testing with this tool, I tried with avs2Avi, there is no audio too.

Does anyone know why there is no audio?What configuration too to modify in order to produce the audio.

The avs scripts is so simple just like:

AVISource("D:\dev\video-process\avs\sample\avi-1.AVI",audio=true)

Thank you every much.
Use mencoder.

SilaSurfer
23rd October 2010, 20:29
Hello HenryHo.

You posted these presets on one ofthe previous pages of this thread, so I tried them. WOW

"HVAQMTK-00","1","5","1",".",".","1","162","0","H263",".","2","31","2","31","2","31",".",".",".",".",".",".","Y","-lumimasking"
"HVAQMTK-00","2","6","1",".",".","1","162","0","H263",".","2","31","2","31","2","31",".",".",".",".","Y","Y",".","-lumimasking"
"H263VAQ-00","1","5","1",".",".","2","162","0","H263",".","2","31","2","31","2","31",".",".",".",".",".",".","Y","-lumimasking"
"H263VAQ-00","2","6","4",".","Y","2","162","0","H263",".","2","31","2","31","2","31",".",".",".",".","Y","Y",".","-lumimasking"

I've been experimanting with Xvid VAQ latest Jawors Build 1.2.2 and I must say I'm very glad I did. Tried Mpeg default with VAQ very good results and avi's are all playable on my standalone until I use a custom matrix like 6of9 hehe but thats no problem because default will do.

2 question:
1. Have you tried encoding with some Teegedeck options in his presets like doing a first pass with fixed Q=X, limiting quantizers in second pass with the usage of VAQ?
2. What about the Comp check?

henryho_hk
24th October 2010, 01:00
I suggest

"HVAQMTK-00","2","6","4",".",".","1","162","0","H263",".","2","31","2","31","2","31",".",".",".",".","Y","Y",".","-lumimasking"

It was said that VAQ should be used with H263 or other high bitrate custom matrices. Is your 2-pass bitrate very high or very low?

We can use fixed quant. in Teegedeck's first pass because the preset should have been chosen by means of compressibility test; therefore the average quant. used in second pass should be similar to the fixed one. For the VAQ entry, we do not (cannot) specify any present level, so I use varied quant. in both passes.

Comp. tests use fixed quant. too:

"NRM-CT","S","4","0",".",".","2","162","0","6OF9","3",".",".",".",".",".",".",".",".",".",".",".",".","Y","."
"STL-CT","S","4","0",".",".","1","162","0","6OF9","3",".",".",".",".",".",".",".",".",".",".",".",".","Y","."

SilaSurfer
28th October 2010, 16:00
I suggest

"HVAQMTK-00","2","6","4",".",".","1","162","0","H263",".","2","31","2","31","2","31",".",".",".",".","Y","Y",".","-lumimasking"

My SAP unit supports Qpel, AQ, GMC only in Divx, up to 6000 Kbps, and 5 b-frames that is what I tested. It doesn't like packed bitstream and CQMs:o:

It was said that VAQ should be used with H263 or other high bitrate custom matrices. Is your 2-pass bitrate very high or very low?

So only H263 for me. In range from 1800 to 2400 Kbps

henryho_hk
29th October 2010, 05:09
I learnt some time before that XviD uses max. 2 consecutive B-frames only, even if we specify 3 or more.

1800-2400kbps is quite high. Is it DVD or Bluray?

SilaSurfer
30th October 2010, 18:30
I learnt some time before that XviD uses max. 2 consecutive B-frames only, even if we specify 3 or more.

Well I didn't know about that, that info came from a friend who has LG standalone unit built around the same chipset as mine Philips unit. I never use more then 2 B-frames.

1800-2400kbps is quite high. Is it DVD or Bluray?

Mostly DVDs as source filtered with LSFmod. I did buy a Bluray of The Departed, even if I don't own HD devices yet (soon), but have a Bluray unit in my PC, just because I was interested how it would look like and because slowly it will come to transition to x264 for me, with all the love for Xvid:p I will still use it but for other encodes.


To ask you Mpeg default in Xvid + Vaq, I didn't see any difference from H263, 2-pass encodes (short 5 min clips) came out the same filesize and ones with Mpeg had more details and sharp image compared with H263. I didn't notice any so called unwanted results. So is MPEG ok?

henryho_hk
1st November 2010, 00:57
You must try QTGMC (http://forum.doom9.org/showthread.php?t=156028).

SilaSurfer
1st November 2010, 13:56
Thanks for the link. What about Xvid+Vaq and Mpeg default?

henryho_hk
3rd November 2010, 17:03
MPEG and lower-bitrate custom matrices work by "applying more compression" at the same quantizers.
VAQ works by using higher quantizers (hence more compression) at different areas.

So, when they come together, some picture areas may be compressed too much, causing blockiness, rainbow textures, ringing, etc.

In your case, since you specify quite a high bitrate, I believe the quantizers never go too high, and so there is no problem of over-compression.

SilaSurfer
3rd November 2010, 18:51
Thanks HenryHo for clearing that out.

kachaj
18th November 2010, 21:22
I have a strange problem encoding with avs2qxvid.
Every time I try to encode, the output framerate is jerky. AVS scripts are fine. Virtualdub plays the correctly This happens for every encode I feed to avs2qxvid. Tested on two machines (one winxp home sp3, other win7x64), jerky video happens on both.

henryho_hk
19th November 2010, 13:56
May I know your encoding parameters?

kachaj
19th November 2010, 22:26
avs file:
LoadPlugin("C:\Program Files (x86)\megui\tools\ffms\ffms2.dll")
FFVideoSource("C:\Users\User\Desktop\avs2qxvid_25h_full_\tron-tlr1_h480p.mkv")
Video in this script is actually a Tron Legacy trailer from apple trailers remuxed to mkv. All presets built-in to avs2qxvid give jerky output at their default settings. This also happens with different types of input eg. avisource

henryho_hk
21st November 2010, 03:22
Just tried. No problem here (mov trailer remuxed to mkv). Can u post ur transcoded AVI somewhere?

kachaj
21st November 2010, 23:27
ok. So I have found a problem with playback. Every time I use ffdshow to playback the video is jerky. But if I use WMP12 the file plays perfectly normal. The problem is libavcodec. All software based on it play this file jerky-style. Tried KMplayer, DOTPlayer (I know it's almost the same software but they are libavcodec-based). Here is my file for testing (http://cid-d81d0698cb41c502.office.live.com/self.aspx/.Public/tron-tlr1%5E_h480p.mkv%5E_TGHQ-58%5E_br%5E_1073.avi)

henryho_hk
22nd November 2010, 06:42
are you using the newer "ffdshow tryouts (http://ffdshow-tryout.sourceforge.net/)"?