Log in

View Full Version : Qu2HC -> The QuEnc CLI wrapper for HCEnc


Darksoul71
9th January 2009, 15:12
Hi all,

I just wanted to release Qu2HC.

What does Qu2HC do ?
Nothing special ! It simply translates QuEnc commandline options
into HCEnc-compatible ini options.

So you can basically use HCEnc with every app that is compatible with QuEnc
(e.g. DVD2SVCD, DVD-RB). This is similar to Qu2AQE which I coded some month
ago.

My main purpose of Qu2HC is to add support for the new HCEnc v0.24 feature
(1Pass VBR) to applications which do not support this or/and even do
not support HCEnc. It´s also ment to be an alternative for HC_D2S:
http://forum.doom9.org/archive/index.php/t-133066.html

I tested Qu2HC quite intensively with DIKO and DVD-RB (Free/Pro)
during my testing phase of HCEnc for the VBR 1Pass mode. Unfortunately
DVD2SVCD bombed out with some strange floating point error message. :confused:

So any comments on a working DVD2SVCD usage of Qu2HC are welcome.

To use the One Pass VBR Mode in HCEnc via Qu2HC you can either
set "QuEnc" to 1Pass in your frontend (e.g. DVD2SVCD) or simply
add *1PASS to your HC template. Custom filtering scripts or
matrices are also supported. Have a look at the included readme.

AutoIt sources are included as usual.

Downloadlinks:
http://www.megaupload.com/?d=G5R1K4CA
http://rapidshare.com/files/181389846/qu2hc_v01.zip.html

Edit:
Rapidshare is limited to 10 Downloads. So if all downloads for rapidshare
are "used" and you can not grab it from megaupload then let me know.
If some1 knows other good free hosting sites then also let me know.

Have a nice weekend,
D$

P.S.: For HCEnc v0.24 have a look here:
http://forum.doom9.org/showthread.php?t=143850

manolito
10th January 2009, 00:26
Unfortunately DVD2SVCD bombed out with some strange floating point error message.
Just a quick reply:
I tested Qu2HC with DVD2SVCD, and it worked without any errors (WinXP Pro SP3). But after quickly going over your sources I really think that you are making your life unnecessarily complicated. HC basically is already compatible with QuEnc, there are only very few command line parameters which are different and need to be translated by a wrapper application. IMO there is no need to manipulate INI files for HC at all.

I will post more details tomorrow...

Cheers
manolito

Darksoul71
10th January 2009, 09:18
Hi manolito,

Thanks for the report. Then something seems to be screwed up with my DVD2SVCD install or in my WinXP (using XP Pro SP2 here).

I agree in regard with complexity but Qu2HC was based on Qu2AQE. Since AutoMatQEnc uses the CCE ECL format (similar to an Ini-File) the modifications for HCEnc were easy. The rest (manipulating the HCEnc.ini) comes from two of my other script (HCShredder / HCPredictor). So it was more putting together a few scripts and less fully developing a new script.

A "from scratch" script would have looked a lot different. For HCEnc I prefer full ini usage though since I have all functions already coded to manipulate the exe (= less work to do).

Have a nice weekend,
D$

manolito
10th January 2009, 14:12
I agree in regard with complexity but Qu2HC was based on Qu2AQE
That's what I thought, you even forgot to replace "AutoQmatEnc.exe" with "HC.exe" in the Readme ;)

My old HC_D2S plugin is now obsolete because the new 1-pass mode in HC 0.24 is far superior to the CQ based 1-pass mode of my plugin. I am just waiting for the final version 0.24 until I trash the old HC_D2S.

The new HC_D2S wrapper is already finished, it looks like this:
@ECHO Off
SET HC_DRIVE=%~d0
SET HC_PATH=%~p0
SET CMDLINE=

%HC_DRIVE%
CD "%HC_PATH%"
IF NOT EXIST HCenc.exe COPY /b HCenc*.exe HCenc.exe >NUL

:assemble
IF !%1==! GOTO doit
IF NOT %1==-interlaced IF NOT %1==-nointerlaced IF NOT %1==-dc IF NOT %1==-cgop IF NOT %1==-hq IF NOT %1==-1 IF NOT %1==-2 SET CMDLINE=%CMDLINE% %1
IF %1==-dc SET CMDLINE=%CMDLINE% -dc_prec
IF %1==-cgop SET CMDLINE=%CMDLINE% -closedgops
IF %1==-hq SET CMDLINE=%CMDLINE% -profile best
IF %1==-1 SET CMDLINE=%CMDLINE% -1pass
IF %1==-2 SET CMDLINE=%CMDLINE% -2pass
SHIFT
GOTO assemble

:doit
HCenc.exe%CMDLINE%
Please note that other than translating the few incompatible commands the commands for GOP structure and for Interlaced / Progressive are not passed to HC. This is intentional in order to use HC's AutoGOP and AutoInterlaced features.

In the current HC 0.24 beta the "-1pass" and "-2pass" command line parameters are not working, so right now 1-pass mode must still be specified in the INI file. Once the final version of HC 0.24 is out I will post a compiled version of this wrapper.


Cheers
manolito


P.S. Of course this wrapper also works with the free version of DVD-Rebuilder

Darksoul71
12th January 2009, 21:07
Hi manolito,

yes, I´ve seen the AutoMatQEnc.exe you´ve been refering to and have replaced it in the readme.
Your new wrapper looks very clean :)
But this is of course no wonder since you could remove all your prediction code since it´s replaced by HCEnc´s 1Pass VBR mode.

May I ask what you mean by compile ? Will you use a batch2exe compiler ?

Cheers,
D$

manolito
12th January 2009, 21:28
May I ask what you mean by compile ? Will you use a batch2exe compiler ?
Yes, that's what I do. It is not my intention to hide the source script from anybody, it just happens to be the easiest way to get rid of this annoying console window whenever WinXP executes a batch file. I did a lot of research on this topic, but WinXP does not offer any way to hide or minimize the console window when the calling application calls the batch file in "normal window" mode. In some of my other plugins I use a "Clicker" application (SmartDialog) which sits in the background waiting for any console window to show up and hide it. But using a batch file compler makes this task much easier.

My two weapons of choice are ExeScript and Quick Batch File Compiler, and Quick Batch File Compiler (from www.abyssmedia.com) has the upper hand these days. The current version 3.2.0.0 contains a lot of bug fixes, it also has been simplified by removing some features, and it offers the option to compile the batch file as a "Ghost Application" which does not display console windows. And as an additional treat no registration nags will be displayed in Ghost mode.


Cheers
manolito

Darksoul71
13th January 2009, 10:06
Hi manolito,

ok, I agree...those "DOS" windows are really anoying. That was a reason why I developed
Qu2AQE also. It enabled me to get rid of the AQE window when shrinking DVDs with it
and DVD-RB.

There would be another option to get rid of the DOS window:
Simply use a two liner in AutoIt to start your batch. It could look like this:


AutoItSetOption (TrayAutoPause, 0)
RunWait (@ScriptDir & "\MyBatch.cmd " & $CmdLineRaw, @ScriptDir, @SW_HIDE)


Save this to a text file called "blabla.au3", compile it with AutoIt and you´re done...

I think the code itself is really simple:
The first line disables the automatic pausing of the script when the user clicks on the AutoIt tray icon.

The second command starts a batchfile "MyBatch.cmd" in it´s current directory and calls it with the full CLI given to the compiled AutoIt script. The AutoIt script simply "forwards" the complete commandline without modifications. The parameter SW_HIDE tells AutoIt to hide the DOS Box. Setting this to SW_SHOW makes the DOS box visible.

This method would have several advantages IMO:
You can keep your batch file in "source".
No compilation required. So you can easily make modifications and test them without the hassle of compiling the batch file prior releasing it.
You get rid of the DOS box and may be more compatible with any frontend as some of them might expect an Exe or Com file in the FileSelectBox
instead of a CMD file. Additional to this you (or I ;)) could easily add some basic logging function for further error analyzation.

I can compile such a "wrapper" and send it to you if you like.

Let me know what you think.

Cheers,
D$

P.S.: I don´t think that BatchCompilers are a bad thing at all but it seems to me a bit of overkill if a simple wrapper in AutoIt can do the job as well ;)
Esp. since AutoIt is freeware and the sources of the wrapper are freely available :D

manolito
13th January 2009, 20:44
Thanks for the tip, I will check it out.

But I already see some inconveniences:
1. If I want to distribute the files then I have to compile the AutoIt script because I cannot force the user to install AutoIt. This means that the name of the batch file is hard coded into the AutoIt executable. The user cannot rename the batch file.

2. The AutoIt script has to be expanded a little bit. In this case my wrapper has to reside in the HC folder. DVD2SCVD calls the encoder with its full path name because at the time of calling the encoder the active directory is NOT the HC folder. My batch file takes care of it by first extracting the HC drive and full path from the command line and then changing to the HC drive and folder. If I use your AutoIt method then the AutoIt script has to do that before executing the batch file.

3. I would have to distribute 2 files instead of 1 for every wrapper I write.


To overcome the last point I could include the whole batch file as a string array in the AutoIt code and write this array to disk line by line before executing it with the RunWait command. But then again what would be the difference from a normal batch file compiler?


Cheers
manolito

Darksoul71
13th January 2009, 21:24
Hi manolito,

I see your point ! OK, agree...for the things you´ve mentioned there´s not big difference between a batch compiler and an AutoIt wrapper :)

Cheers,
D$

stenews
5th February 2009, 11:20
Hi manolito :)
I was reading that:
My old HC_D2S plugin is now obsolete because the new 1-pass mode in HC 0.24 is far superior to the CQ based 1-pass mode of my plugin. I am just waiting for the final version 0.24 until I trash the old HC_D2S.
I'd like to know if you already modified the new plug-in.
In case, where I can find this release and all the necessary explanations on how to use it?
Should I delete the old one or I can still decide to use both of them as I wish?

Thanks a lot for your help...
Bye,
Stefano.

Darksoul71
5th February 2009, 18:36
Hi Stefano,

Happy new year ! Yes, I know that you´ve asked manolito but I think I can help out as well....
To my understanding you´re missing a bit manolito´s point: With the new 1-pass VBR mode
of HC 0.24 he will drop all three of his OPV/VBR encoding modes. His wrapper will then become
a "simple" QuEnc CLI wrapper for HCEnc. See his batch sources above...

Because of the reason I see no big difference between using Qu2HC or manolito´s solution. :D

Cheers,
D$

stenews
5th February 2009, 20:45
Hi Darksoul71,
I'm really happy to chat with you again! :)
I was asking that only because I really like to use the manolito's plug-in, for me, the stuff that he builds is always one of the best...

Anyway thanks a lot for your reply, I really appreciate that!
Bye,
Stefano.

manolito
6th February 2009, 00:38
Hi Stefano,

I just uploaded the new HC_D2S package. Download here:
http://scifi.pages.at/manolito/HC_D2S/HC_D2S.zip

Also note this from one of my previous posts
In the current HC 0.24 beta the "-1pass" and "-2pass" command line parameters are not working, so right now 1-pass mode must still be specified in the INI file.

And I would not recommend having the old version and the new version stored in the same folder - too easy to become confused. Just create a second HC folder and put the new version there. To switch between the two just specify the desired file under the D2S encoder tab.


Cheers
manolito

stenews
6th February 2009, 09:41
Hi manolito, I'm really happy to read your reply!! :thanks:

Let me ask you a couple of more questions...just to make sure I have well understood everything before start.
1) first off, I have to go at this page:http://forum.doom9.org/showthread.php?t=143850 and download HCenc 024 beta. (but...is it the latest build?)
2) After that I need to call its unzipped folder with different name than the previous HCenc 0.23 folder, that already have.
3) I need to follow what yours "Readme files" say...carefully

Am I still forgetting something??

Thanks again for your help.
Stefano.

P.S.
just a different thing... but how can you use this kind of link "http://scifi.pages.at/manolito..."?
I mean, is it a free host server or something? Could I register me too to one of those?
Thanks. :p

manolito
6th February 2009, 13:01
1) first off, I have to go at this page:http://forum.doom9.org/showthread.php?t=143850 and download HCenc 024 beta. (but...is it the latest build?)

It is the latest build which was made public by Hank. And I can assure you that this build is very stable already.

2) After that I need to call its unzipped folder with different name than the previous HCenc 0.23 folder, that already have.

Yes, you make a new folder and give it a name different from the HC folder you already have. Extract HCenc_024.exe into this folder, then extract HC_D2S.zip into the same folder. You can rename HCenc_024.exe to HCenc.exe (if you don't, my plugin will take care of it). If you want to use my sample ini file, rename Sample_HC.ini to HC.ini. Start D2S, select the encoder tab and point it to HC_D2S.exe (or HC_D2S.bat if you don't trust the compiled version).

Am I still forgetting something??
I don't think so...

I use http://home.pages.at as my web hoster. Just go to their home page and create a free account for yourself, it's easy but only if you speak German...:p


Cheers
manolito

stenews
6th February 2009, 13:41
thanks again for your reply! :)
your explanations are absolutely nice and clear...as you're use to do. I'll give a try as soon.

P.S.
Unfortunately I don't speak German at all...could you suggest me a trust similar service but for English speakers?

manolito
6th February 2009, 15:43
There really is no shortage of free web hosting offers. Most internet service providers have this service for their customers. If you want to stay independent of a certain ISP, just google for "free web hosting", and you will find everything you need.

Cheers
manolito

stenews
6th February 2009, 16:06
Thanks again for all mate!
I'll have a look.

Bye,
Stefano.

stenews
7th February 2009, 23:57
Hi manolito...it's always me! :o
okay... I tried the plug-in and it's working well, but I need to ask you a couple of questions.
I'm using your HC.ini file at moment but how should I set-up the "Encoding Passes" inside the d2s Encoding tab?
I mean should I leave it to 1pass or your HC.ini will just pass though any option I choose? and what about the Advantage option?
I was wondering if can give a look to the screen shot I attached.

Bye and Thanks

manolito
8th February 2009, 17:41
OK, let's go through the D2S settings step by step. But first of all I assume that you are familiar with the HC INI parameters and that you know how to enable / disable a setting. If not, please read the HC manual...

1 pass Encoding
Supported, but the current HC 0.24 beta does not recognize the parameter yet. Right now you have to specify *1PASS in the HC.ini if you want to do a one-pass encode.

Use closed GOP
Supported

Number of frames in a GOP
Max B-Frames
Ignored
Reason: Ability to use HC's AutoGOP mode

DC Precision
Supported

Use Scene Detection
Supported

Interlaced
Ignored
Reason: Ability to use HC's AutoInterlaced mode

Use High Quality
Supported
If checked HC's profile BEST is used

Use Trellis Quant
Use Extreme Settings
Ignored
These parameters have no meaning for HC

Matrix settings
Ignored
You have to specify custom quant matrices in HC.ini

Hope this makes it clearer for you...:D

Cheers
manolito

stenews
8th February 2009, 18:20
Hi manolito and many thanks for reply :p
your explanations are very clear, as you're use to do...cool!

It's all much more clear now...at least I hope so!
For example if I'd like to always make on the "preview" when the encoder is first launched, should I need to add that line to the HC.ini file?
*PREVIEW
Am I right? in case yes which is the syntax to switch on the video buffer?

Thanks again for all,
Stefano.

manolito
8th February 2009, 18:38
Yes, to enable preview you got the correct syntax.

For the video buffer I assume you mean the "Video Buffer Verifier" (VBV). The verifier is enabled by default and should be left that way. You can disable it with the *NOVBV statement, but you really should not do this.
*NOVBV
parameter - type -
Status not required
Default -
Example *NOVBV
This command disables the VBV (Video Buffer Verifier) checking.
VBV checking is enabled by default. This command should not be used for DVD creation.

Cheers
manolito

stenews
8th February 2009, 18:56
thanks manolito,
just a couple of more questions:
1)for the preview...can I add that line anywhere or it must be insert between other lines in particular?
2)for "buffer" I mean the flashing progress bar at bottom that one can able by checking a button...

Many thanks again,
Stefano.

manolito
9th February 2009, 14:04
OK, now I see what you mean...
This is not a progress bar, it just shows the actual buffer use. There is no way to turn this buffer display on or off via command line or INI setting. And you don't really have to pay attention, because in HC there will be no buffer underruns (unless you specify *NOVBV).

BTW we are really getting OT for this thread. For questions about HC we should continue this discussion in one of the HC threads...

Cheers
manolito

stenews
9th February 2009, 14:15
okay, manolito you're right we have to stop hear... I know what you mean.
Anyway thanks a lot again for your patience, I really appreciate your help.

...but just one more question about your previous plug-in:
why in the previous one I had those files: GetCQ.exe, sed.exe, prediction.ini, HcPred.bat, AdaptativeOPV.bat plus a folder called "Smartdlg" and now not?
Have to copy them in the new HC folder as well?

Thanks again,
Stefano.

manolito
9th February 2009, 15:46
why in the previous one I had those files: GetCQ.exe, sed.exe, prediction.ini, HcPred.bat, AdaptativeOPV.bat plus a folder called "Smartdlg" and now not?
Have to copy them in the new HC folder as well?
That's because the old plugin contains all the code and helper applications for 1-pass mode. The new plugin is much simpler because starting with version 0.24 HC does 1-pass encodes all by itself. And it does it much better than my old plugin making it obsolete.
Which means that you do NOT have to copy these old files and folders to the new HC folder.

Cheers
manolito

stenews
9th February 2009, 15:58
now I see...many thanks again for your great help!
bye,
Stefano.