View Full Version : HCenc 027
AlanHK
20th November 2014, 12:23
Is that the exact wording?
Yes.
Maybe it is looking in the wrong folder after all.
Does the gui info state the full path when it does find it?
Lars2500
20th November 2014, 12:53
Does the gui info state the full path when it does find it?
No, it then just displays Avisynth file version and creation date.
Assuming that in your case HCenc really searches for the Avisynth.dll in the "system32" folder (i.e., relative path instead of absolute), you can probably simply create a folder named "system32" inside your HCenc folder, and put the Avisynth.dll there.
That would not explain the bug, but at least work around it.
AlanHK
20th November 2014, 15:27
Assuming that in your case HCenc really searches for the Avisynth.dll in the "system32" folder (i.e., relative path instead of absolute), you can probably simply create a folder named "system32" inside your HCenc folder, and put the Avisynth.dll there.
d:\hcenc\system32\avisyth.dll didn't work,
But d:\system32\avisyth.dll made HC_gui happy.
Now it says: "Avisynth file version 2.6.0.4, creation date 20-11-2014"
But HCenc still aborts saying: "Avisynth version too old, need at least 2.6.0.4"
However, if I launch the encode from HCgui, then HCenc does work.
Normally however I use a a batch file (below) to launch HCenc directly. I just use the gui to work out the bitrate, then paste that into my script.
set rate=3000
set ar=16:9
set hc=D:\HCenc\HCenc_027
set mpgd=G:\vid\mpg\
for %%A in (
501.avs
502.avs
503.avs
504.avs
) do (
%hc% -i %%~fA -o %mpgd%%%~nA.m2v -b %rate% -aspectratio %ar% -pulldown -profile best -matrix qlb -frames all -2pass -maxbitrate 8000 -log %%~dpAhenc.log -avsreload -lossless
)
I launch the batch file from the G: drive, where I keep my videos.
So, I made G:\system32\avisynth.dll
Now HCenc can find avisynth.dll and work.
So, I guess all this shows HC can't work out my "windir" folder and assumes it's the current drive root directory.
tvholic
20th November 2014, 17:30
So, I guess all this shows HC can't work out my "windir" folder and assumes it's the current drive root directory.
"windir" doesn't propagate to batch files because it's lower case. Add this to the top of your batch file that launches HC:
set windir=%systemroot%
Or, you could switch to TCC/LE (free, http://jpsoft.com/tccle-cmd-replacement.html) as your command interpreter.
AlanHK
20th November 2014, 19:11
"windir" doesn't propagate to batch files because it's lower case. Add this to the top of your batch file that launches HC:
set windir=%systemroot%
OK. That's weird, but it works.
I don't get this case business though.
If I create a system variable xxx and then launch a command, it has the variable XXX.
(typing "set" to list all the environment variables)
But has neither windir nor WINDIR.
Even if I create a variable WINDIR it isn't exported,though others with random names are.
WTF?
And I don't need to do any of that for hcenc_026.
tvholic
20th November 2014, 19:48
Even if I create a variable WINDIR it isn't exported,though others with random names are.
You're right. You can't set that one in the master environment because the lower-case system variable with the same name will override it.
Lars2500
21st November 2014, 00:11
"windir" doesn't propagate to batch files because it's lower case.
This is not true.
It was the case with Windows 95 and COMMAND.COM but is no longer with CMD.EXE.
Edit: I have to correct myself. Even in Windows XP there is still a COMMAND.COM which can be used to process batch files. And there %windir% does not work.
AlanHK, do you happen to run your batch files inside a COMMAND.COM prompt, instead of CMD.EXE?
tvholic
21st November 2014, 01:51
Edit: I have to correct myself. Even in Windows XP there is still a COMMAND.COM which can be used to process batch files. And there %windir% does not work.
Yes, that sounded like the situation. I didn't want to go too far down that path, but the command processor is specified by the "ComSpec" environment variable.
AlanHK
21st November 2014, 02:32
AlanHK, do you happen to run your batch files inside a COMMAND.COM prompt, instead of CMD.EXE?
Actually, I use Far as my shell.
(http://www.farmanager.com/)
It has a Norton Commander style two-pane file screen and a command line.
I start Far itself with a batch, so I added a set to it.
set windir=%systemroot%
c:\Far\Far.exe
exit
Now my HC batch files (launched from Far) work with hc_027.
That's an acceptable workaround.
Obviously my setup and way of using HC isn't common, which is why maybe no one else has come across this problem. But I do believe it exposes issues in HC, especially in how it reports errors.
If it can't find avisynth.dll, it shouldn't report "Avisynth version too old", which sends you on a wild goose chase looking for the old version HC is accessing and has people reinstalling Avsiynth over and over.
If it gets a blank "windir" it should fall back, maybe use systemroot (or why not do it anyway, does it work in all supported Windows versions?). Or do whatever it did in version 0.26, since that works regardless. Or at least report the actual error, like: "No windir environment setting found." Not assume Windows is installed in the root of the current drive.
================
More diagnosis: Far does use %comspec% (cmd) for its command processor.
But I use a convoluted way of launching it, for compatibility with some old DOS programs I run from Far.
I use a pif, point the pif at the batch which starts Far.
The pif allows me to use EMS memory, which XP doesn't make available if you just start a Windows program directly.
Maybe the pif emulates "command" in what it passes from the environment, it's supposed to be for legacy apps.
Sorry if my simplifications of my setup confused matters. I thought a command line was a command line, now I know it's a lot more involved.
Lars2500
21st November 2014, 10:50
But I use a convoluted way of launching it, for compatibility with some old DOS programs I run from Far.
I use a pif, point the pif at the batch which starts Far.
The pif allows me to use EMS memory, which XP doesn't make available if you just start a Windows program directly.
Maybe the pif emulates "command" in what it passes from the environment, it's supposed to be for legacy apps.
Yes, that's exactly it.
qyot27
23rd March 2015, 15:32
With the recent refactoring of AviSynth+'s internal version code to make it more maintainable and identify itself consistently, HCenc 0.27 now errors out with the 'too old' message on AviSynth+ r1718 and higher.
This doesn't seem to make any sense to me, since earlier in the thread the explanation was that the check determined whether AVS_Linkage is present, and as far as I know (and the git log reports), that's not something AviSynth+ has done anything to. The thing that's actually changed is the versioning code.
Since 2.6 RC1 bumped the AVISYNTH_INTERFACE_VERSION to 6 and AviSynth+ integrated the RC1 changes @ r1718 (the versioning changes started being committed at the same time as RC1 is all; a basic change occurred before the beginning of the RC1 patchset, a much more robust version shortly afterward), the check should probably just simply check whether GetVersion() returns a value of 6 or higher.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.