View Full Version : At a loss, with how to use HC lossless
halsboss
17th August 2008, 06:08
This is a 1-pass hc.ini that I use ...
*INFILE G:\HDTV\1\hqq1-CQ2.5.avs
*OUTFILE G:\HDTV\1\hqq1.mpv
*LOGFILE G:\HDTV\1\hqq1-HC-CQ2.5.log
*INTERLACED
*TFF
*PROFILE BEST
*ASPECT 16:9
*BIAS 50
*BITRATE 9350
*MAXBITRATE 9450
*LASTIFRAME
*AUTOGOP 15
*PULLDOWN
*CLOSEDGOPS
*DC_PREC 10
*CQ_MAXBITRATE 2.5
*MATRIX MPEG
Can someone please post a 2-pass HC equivalent .ini which uses HC's "lossless" functionality ? (the script can be slow. sports action footage, downsized from HDTV). I can't seem to get it to work.
I'm hoping for a higher quality output result from 2-pass. Other suggestions for maximizing the bitrate consumed to the maximum permitted by DVD-spec would be welcome.
blutach
17th August 2008, 07:51
Well, you need to specify *LOSSLESS and a path to the intermediate file (e.g. *LLPATH C:\). In any event, asking for CQ_MAXBITRATE orders a one pass encode; you'll need to remove that.
Read the help manual.
Regards
halsboss
17th August 2008, 09:07
OK thanks, that's a good start. Any suggestions on how to ensure maximum use of the available bitrate ?
Also, I don't really understand the CQ item ... do I replace that with something else or will it automatically try to use "the lowest" within the bitrate as apparently does 1-pass ?
halsboss
17th August 2008, 09:51
Well, I guess I'll give this a try. Corrections welcome.
*INFILE G:\HDTV\1\test-1080i.avs
*OUTFILE G:\HDTV\1\test-1080i.mpv
*LOGFILE G:\HDTV\1\test-1080i.log
*AVSMEMORY 512
*SMP
*INTERLACED
*TFF
*PROFILE BEST
*ASPECT 16:9
*LASTIFRAME
*AUTOGOP 15
*PULLDOWN
*CLOSEDGOPS
*DC_PREC 10
*MATRIX MPEG
*LOSSLESS
*DBPATH G:\TEMP
*LLPATH G:\TEMP
*AQ 0
*BIAS 70
*LUMGAIN 3
*BITRATE 9400
*MAXBITRATE 9450
Edit: Well, so much for that... "ERROR, can't open dbs file, invalid path?" (the folder exists). Can't fix it, move the dbpath/llpath statements around, ensure no tabs, remove dbpath ... same error stops it dead every time.
halsboss
17th August 2008, 12:04
The ONLY thing that works for me (EDIT: except solution below) is to delete the LLPATH and DBPATH lines, copy HC files into the local folder with the source (on a large capacity disk) and run it from there... the dbs and lossless file get created in the same folder as the HC exe and then auto-deleted by HC afterward.
Darksoul71
18th August 2008, 22:47
@halsboss:
Have a look here:
http://forum.doom9.org/showpost.php?p=1162692&postcount=65
hank315
19th August 2008, 00:49
Just found and fixed a parsing error when using the *DBPATH and *LLPATH command.
Thanks for pointing it out.
Work around: put 2 (or more) spaces between the *DBPATH or *LLPATH command and the path, that should fix it for now.
halsboss
29th August 2008, 12:41
Thankyou. Using it very successfully now. Absolutely top-notch first-rate fantastic product. Congratulations Hank.
halsboss
29th August 2008, 14:22
Suggestion: when trying to run 2 HC's with lossless set to the same path the 2nd crashes I guess since the filenames may be "fixed" ? Any chance of making the lossless files use say random names or the same as the .ini or output except with a different extension ?
Darksoul71
1st September 2008, 10:04
Suggestion: when trying to run 2 HC's with lossless set to the same path the 2nd crashes I guess since the filenames may be "fixed" ? Any chance of making the lossless files use say random names or the same as the .ini or output except with a different extension ?
You simply have to set different lossless path in the ini-file.
I´m doing the same in HCEnc^n.
Of course this would require an ini file for each HCEnc instance.
halsboss
1st September 2008, 10:35
Thanks, yes, I'm doing that now. Had a "standard" .BAT file which used a predefined path. Changed it to use a path and generate a .INI file based on the filename.
Darksoul71
1st September 2008, 11:21
Another approach would be the usage of AutoIt to modify the ini file for HCEnc.
I´ve written a library which enables everyone to modify HC.ini files very easy....
mikenadia
14th June 2009, 04:36
I must do something wrong. Everytime, I am using lossless mode, I have (HC023 and HC024) a Windows XP error (MPEG2 encoder has encountered a problem and needs to close). Thanks in advance.
hank315
16th June 2009, 22:29
Could you give some more info, the settings in the HC.ini file would be nice.
mikenadia
16th June 2009, 22:41
The HC.ini file (in HC023)
*INFILE c:\working\d2vavs\v01000200002002.avs
*OUTFILE C:\Lossless\test.m2v
*DBPATH C:\Working\D2VAVS
*LLPATH C:\Working\D2VAVS
*BITRATE 4000
*MAXBITRATE 8000
*FRAMES 0 9651
*NOSMP
*AUTOGOP 12
*AQ 1
*LOSSLESS
*MATRIX mpeg
This is with HC023 or HC 024 reinstalled in a separate folder.
P.S. I found the issue. It is working if I replace "*AUTOGOP 12" by "*GOP 15 2" or by "*AUTOGOP 15".
Also, in the window, when HC is running, may we replace " GOP auto" by "GOP auto 12 or ?".
Thanks for your help.
txporter
1st February 2010, 21:16
Sorry to dredge up this old thread, but it seems better to use this then create another.
I don't understand how to get LOSSLESS working. Avisynth is erroring out because MPEG2Source says it can't open the input file. I assume this is because of the lossless format. How do I run it correctly?
HC.ini
*DBPATH D:\Temp
*LLPATH D:\temp2
*BITRATE 3500
*MAXBITRATE 7000
*PROFILE best
*AUTOGOP 12
*PROGRESSIVE
*INTRAVLC 2
*MATRIX hclow
*LUMGAIN 2
*LOSSLESS
avs file:
setmtmode(2)
loadplugin("Path\To\DGDecode.dll")
LoadPlugin("Path\To\Fluxsmooth.dll")
LoadPlugin("Path\To\Undot.dll")
LoadPlugin("Path\To\MaskTools.dll")
LoadPlugin("Path\To\WarpSharp.dll")
LoadPlugin("Path\To\mt_masktools-25.dll")
LoadPlugin("Path\To\RemoveGrain.dll")
LoadPlugin("Path\To\Repair.dll")
Import("Path\To\LSFmod.v1.9.avs")
LoadPlugin("Path\To\MT.dll")
loadplugin("Path\To\TIVTC.dll")
loadplugin("Path\To\VSFilter.dll")
MPEG2Source("D:\Temp\test\video.d2v",cpu=3)
TFM()
TDecimate()
Undot()
FluxsmoothT(3)
MT("""LSFmod()""",threads=2,splitvertical=true)
TextSub("D:\Temp\test\video.d2v.srt")
neuron2
1st February 2010, 22:25
Post the top of the D2V file.
What happens if you open the script in VirtualDub?
txporter
1st February 2010, 22:33
:o :stupid:
Thanks for the poke, neuron2. I tried to open in Vdub (which I was positive would be fine), and found out that I had accidentally deleted the source file :mad:. Oddly enough, it works fine when I recovered it. ;)
update: When I ran it with the recovered file with the gui, it did not try to use a lossless file. When I forced it to with CLI, it crashes the encoder. (encountered a problem and needs to close) I don't know how to capture the actual technical data that it shows.
mikenadia
1st February 2010, 22:46
looks like the AUTOGOP 12 problem with Lossless mode.
http://forum.doom9.org/showthread.php?p=1297563#post1297563
http://forum.doom9.org/showthread.php?p=1368385#post1368385 (last paragraph)
txporter
1st February 2010, 22:48
looks like the AUTOGOP 12 problem with Lossless mode.
http://forum.doom9.org/showthread.php?p=1297563#post1297563
:thanks: Yep, seems to be running fine with AUTOGOP 15.
update: Tested CLI -gop 12 2 and that crashes the encoder (like AUTOGOP 12) but -gop 10 2 works fine. Odd problem. Quite a nice speed up in 2nd pass encoding though (nearly 300% improve with only ~20% pass 1 slow down).
mikenadia
24th July 2010, 15:45
From Hank315.
Autogop still uses a standard GOP length of 15, if the source is 23.976 it will switch to a GOP length of 12 because it's a candidate for pulldown.
GOP lengths of 12 - 14 are valid for pulldown but some authoring apps only take 12 as input.
I think the AUTOGOP 12 issue is still there in the April beta. If I can provide more info, let me know:)
hank315
27th July 2010, 21:14
IIRC I've tried to replicate this reported error but I couldn't.
If you can provide source and HC settings I will have a look at it.
mikenadia
28th July 2010, 00:23
Thanks in advance. Here is the info requested. On my computer (but I think that txporter had a similar issue), it happens with any source (DVD NTSC or PAL) and any HC.INI with AUTOGOP12 or GOP 12 * in it.
I recreated the error with the following file and the following ini.
http://www.sendspace.com/file/n6d75k
and the ini
*INFILE c:\temp\v01000000001001.avs
*OUTFILE C:\TEMP\aa.m2v
*LOGFILE c:\temp\log.log
*BITRATE 4000
*MAXBITRATE 8000
*FRAMES 0 945
*NOSMP
*AUTOGOP 12
*LOSSLESS
*INTRAVLC 2
*MATRIX mpeg
Using Windows XP SP3
Edit: off topic .
If I take the above HC.ini file and click on "Make DVD compliant" button, it modifies the ini file and changes AUTOGOP from 12 to 18 (normal or not ?).
txporter
28th July 2010, 20:01
Yes, I had the same problem. I don't, however, really use lossless mode any more. Ever since hank changed hcenc to work with setmtmode and 1-pass, I have been using that. I don't really have any need to exactly hit a file size, so it has been great! Also, using lossless would bring my computer to its knees (I could not do any multi-tasking), while encoding using 1-pass VBR allows normal computer usage.
hank315
29th July 2010, 01:14
@mikenadia
I can reproduce it, nice crash :)
The solution is a bit more complex though, somewhere deeply hidden in some assembler routines, will take a while to fix and test.
Edit: off topic .
If I take the above HC.ini file and click on "Make DVD compliant" button, it modifies the ini file and changes AUTOGOP from 12 to 18 (normal or not ?).
Will also change this behaviour, it shouldn't do that. 18 is NTSC 29.97 compliant but 12 also is...
mikenadia
29th July 2010, 15:22
Great news and thanks a lot for your work.:thanks:
Was it processor specific (I am using SSE3) ?
hank315
31st July 2010, 23:03
No, the routines causing it use SSE2 or MMX, they try to access one line of pixels too many.
Strange thing is it only crashes with autogop 12 :confused:
Will update the beta soon.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.