View Full Version : HCenc 025
Blue_MiSfit
19th December 2010, 05:47
Hi hank315 and everyone else!
I'm having a few issues with HCenc025, and hopefully I can learn a thing or two.
I'm doing testing to evaluate HC's suitability for encoding CableLabs VOD files, specifically 1080p24 and 1080i60 at ~18mbps. The specs require CBR encoding and a fixed GOP structure, so I'm very interested to see how HC stacks up with Rhozet (Canopus MPEG-2), Digital Rapids (Mainconcept MPEG-2) or other high volume "pro" encoders.
I'm sure I can stuff whatever HC encodes into a TS with padding to hit the target transport rate, but can HC technically create "CBR" video? I can sure set the avg bitrate == max bitrate, and maybe play with VBR bias (which gives more CBR-like video according to the manual).
My source in all cases is an AviSynth script at 1920x1080p23.976, YV12. Behind the AviSynth veil is a rather challenging segment of the BluRay disc for "The Hurt Locker", decoded by DGDecNV. The duration is 2000 frames, or roughly 1m23s.
1) I setup the encoder config using HCgui, no problems there. However, when I go to adjust the output / log paths, this resets the interlacing options to Interlaced / BFF! This is 100% repeatable for me. This definitely seems like a bug! I can see this functionality being desired when I change the actual input file, but not the output/log file locations! No other settings appear to change. Curious!
2) Final average bitrate seems to undershoot substantially! In my various tests, I got between 11.5 and 13.7 mbps when actually targeting 18mbps CBR. "Best" quality got me closest to the target. That's still over 25% undershoot. To be clear, I'm NOT complaining! HC is a fantastic piece of software, and it's free. I'm guessing that HC seems to be most focused on VBR encoding, which is perfectly cool and all, just sub-optimal for my case. I'm curious if hank315 is aware of this, and has any plans to improve CBR encoding?
I realize I'm using a short sample, but I sometimes have to encode pieces as small as 30 seconds, so very reliable rate control is super important.
3) I'm also seeing fairly low CPU usage. I saw at most about 80% utilization on my 3 GHz Q6600. Don't get me wrong, this is still damn fast! I get nearly 2x RT per pass on (80% of) my CPU using the "fast" settings. Considering that the very fastest settings in Rhozet gave me only 1.2x RT per pass, HC looks like a total speed demon!! For the record, my avisynth script probably isn't the bottleneck, since it renders at over 70fps in avs2avi.
I guess my question is if these CPU usage numbers seem in line with what other people see with HC for 1080p on the "Fast" preset? No big deal, I can do many encodes in parallel if I need to.
Just so everyone knows, in terms of VBR encoding, HCenc is definitely in the same league as Rhozet (Canopus in the case of MPEG-2) or any other tool I've worked with!
In fact, when I tested 2 pass VBR encoding (18mbps avg, 80mbps max per MP@HL), things got really interesting. I used the fastest speed presets for both encoders, but continued to enforce fixed gop size/structure. Rhozet managed a paltry .3x real-time after taking both passes into consideration. HC on the other hand managed a cool .92x real-time. That's over 3 times faster, AND IT WAS BETTER QUALITY!! We're not talking night and day difference here, but it was definitely better.
I just did some more testing, and it seems that Rhozet's "GRID Encoder" mode (aka multithreading) isn't compatible with 2 pass VBR. In other words, it's effectively limited to using a single core for encoding in this case (30% according to Windows). If it WERE possible to multithread Rhozet's MPEG-2 encoder with 2 pass VBR, the speeds would be fairly comparable.
Here's a couple randomly chosen screenshots, for whatever those are worth:
Carbon 1 (http://img269.imageshack.us/f/02carbonvbrfast.png/) Carbon 2 (http://img340.imageshack.us/f/carbonvbrfast.png/)
HC 1 (http://img72.imageshack.us/f/02hcvbrfast.png/) HC 2 (http://img26.imageshack.us/f/hcvbrfast.png/)
Both Rhozet and HC produced MPEG-2 elementary streams that were roughly 3.8% undersized in this case. This was using the fastest speed presets for both encoders, and still enforcing the CableLabs restrictions etc. I just switched rate control to 2 pass VBR. I consider this undersize to be completely tolerable.
Also strange is the fact that Carbon Coder doesn't seem to handle luma levels properly for AviSynth input. Even though I gave Rhozet TV range YV12, my output MPEG-2 stream was full range... 0_o? Thankfully HC didn't suffer from any issues here. Bravo :)
Unfortunately, HC seems a little rough for CBR, unless I'm doing something totally wrong.
Anyway, thanks for all the effort you put into developing this awesome encoder, hank315! It's exceedingly useful!
Derek
manolito
19th December 2010, 08:52
From the HC manual regarding CQ encodes:
NOTE: this is not the same as CBR encoding, HCenc doesn’t do CBR encoding.
Average Bitrate == Max Bitrate plus Bias=100 will be the closest you can get...
Cheers
manolito
Sharc
19th December 2010, 09:16
1) I setup the encoder config using HCgui, no problems there. However, when I go to adjust the output / log paths, this resets the interlacing options to Interlaced / BFF! This is 100% repeatable for me. This definitely seems like a bug! I can see this functionality being desired when I change the actual input file, but not the output/log file locations! No other settings appear to change. Curious!
Did you push the "save HC.ini" button after having made some changes in the settings?
Or are multiple instances of HCGui running, with conflicting settings?
7ekno
19th December 2010, 12:21
Here's a couple randomly chosen screenshots, for whatever those are worth:
Wow! That's a pretty impressive win for HCenc ... the macroblocking in the darker areas for CC really kill the image for me ...
7ek
hank315
20th December 2010, 00:21
1) I setup the encoder config using HCgui, no problems there. However, when I go to adjust the output / log paths, this resets the interlacing options to Interlaced / BFF! This is 100% repeatable for me. This definitely seems like a bug! I can see this functionality being desired when I change the actual input file, but not the output/log file locations! No other settings appear to change. Curious!
I also noticed the logic for interlaced and field settings sometimes seems to be screwed up in the latest release, working on that....
About CBR, HCenc can't do that ATM, the bit distribution is pure VBR. I never implemented CBR because it's a stupid way to encode, wasting a lot of bits.
OK, for streaming purposes it's needed, but a 6000kbs CBR will always be worse than a 6000kbs (9000 kbs max bitrate) VBR encode, that's why almost all DVD's are VBR.
And it hurts when you have to pad the stream with zero bits just to hold the requested bitrate.
But there have been more requests for CBR implementation so I will have a look at it.
3) I'm also seeing fairly low CPU usage. I saw at most about 80% utilization on my 3 GHz Q6600. Don't get me wrong, this is still damn fast! I get nearly 2x RT per pass on (80% of) my CPU using the "fast" settings. Considering that the very fastest settings in Rhozet gave me only 1.2x RT per pass, HC looks like a total speed demon!! For the record, my avisynth script probably isn't the bottleneck, since it renders at over 70fps in avs2avi.
HCenc is frame based multi-threaded. Because of the frame dependency it's not possible to get 100% on a quad core.
Suppose we have a GOP like this: IPBBPBBPBBPBB, then threading looks like this:
- I 1 thread running
- P 1 thread running
- BBP 3 threads running
- BBP 3 threads running
- BBP 3 threads running
- BB 2 threads running
Because there's also a thread running which at the same time reads, analyses and stores the next GOP input frames, the whole thing will max out at approx 80% on a quad core.
And it's just cool to see HCenc can be at the same level as a pro encoder :)
Blue_MiSfit
20th December 2010, 01:58
Thanks for the thoughtful replies!
CBR is indeed fairly stupid, but it's required for a whole lot of "pro" uses, like many types of VOD services. To clarify, I'm not 100% sure that it's actually REQUIRED, but the prevailing dogma is that you "must" deliver CBR in these cases, and it's what their specs call for in any case. Just to make sure we're on the same page here - when I say CBR I mean constant bitrate over a period of one second. Not constant frame size - that's really REALLY stupid :devil:!
If HC were capable of doing a CBR encode and hitting the bitrate within a fairly small margin of error (say +/- 5%), I'd be totally happy with it for these types of encodes. I'd undershoot a tiny bit, and let the TS Muxer pad the rest.
Again, for VBR this encoder is simply astonishing. I had hoped it would compare favorably to a well-respected pro encoder like Canopus, but to see it perform so much BETTER is quite impressive ;)
Derek
Mug Funky
20th December 2010, 02:21
CBR would be nice :)
what would also be nice if you were implementing such a thing is to perhaps have a check box enabling padding or not. this way we could do CBR -like encodes when space is not an issue (like a short program with a disc to itself), but not use padding to keep up the bitrate, and when we really need CBR (like for streaming purposes), we could enable that check box and get a bigger file for no benefit...
one way to avoid excessive padding might be to max out the AQ or adapt the matrix to really stuff as much detail in as possible.
[edit]
ooh, and another possibility to avoid padding is adaptively popping in more I-blocks. this would have a bonus of slightly increasing error-resilience as well for all those really cheap DVD players, bad atmospherics or poor pressings.
Blue_MiSfit
20th December 2010, 02:24
Another note, Rhozet's MPEG-2 encoder doesn't multithread when doing VBR encoding. They call it the "Grid encoder", and it's only available when encoding CBR to an elementary stream or transport stream. My guess is that this "Grid" encoder actually splits the movie into n pieces and runs multiple encodes in parallel. Sounds like trouble if you're doing VBR :devil:! In most real installations, this isn't (practically speaking) a real issue, since you typically run multiple transcodes in parallel using Rhozet (one of its major features), so you can keep your expensive Xeons loaded ;)! Oh, and almost everything out there is CBR anyway, so yeah.
Regardless, it's not really fair to stomp all over Rhozet for being 3 times slower than HC without mentioning this ;) I've put an edit into my original post to reflect this.
I'll be doing more comparisons, this time targeting the ever important interlaced encoding, including the dreaded hard pulldown, my personal favorite redheaded stepchild of video encoding.
I like Mug Funky's ideas as well!
Derek
kolak
21st December 2010, 20:58
But if you have 4 movies to encode Carbon Coder will finish them earlier :) It does not change the fact that for single encode it's quite slow.
Andrew
Chipstra
31st December 2010, 13:15
I have a problem with yuy2 encoding.
I load the latest HCenc (0.25) with the avisynth file:
avisource("video.avi") # <--- uncompressed RGB BlackMagic 8bit 720*576
converttoYUY2()
In HCenc I choice 4:2:2 (YUY2 input)
The encoded m2v file doesn't play in MPC (only colored blocks), but the m2v plays fine in Encore (C3).
Also the preview in Encore works ok.
Then I burn the Encore project to a dvd. The dvd won't start in a home dvd player. In the MediaPlayer the dvd shows me the colered blocks.
Now, when I choice 4:2:0 (YV12 or YUY2 input), using the same Avisynth script, everything works fine, on pc and a home-dvd player.
Is YUY2 is not an option, whether the fault lies with me?
Many thanks in advance.
hank315
31st December 2010, 15:58
Make sure you have a decoder which supports 4:2:2 in MPC (ffdshow does).
Apparently Encore does support 4:2:2, SMPlayer and VLC will certainly play it.
Also for DVD 4:2:2 is NOT permitted, DVD is 4:2:0 only, so probably no player will play it.
Strange Encore could even create a DVD out of this m2v :confused:
Happy new year
Gelukkig nieuwjaar
Chipstra
31st December 2010, 16:37
# Hank315
Yes, Encore creates the dvd, but is not playable.
Ok, clear now. I stay with 4.2.0.
Thanks for the explanation and your great encoder.
Happy new year
Gelukkig nieuwjaar
edit: the DVD (4.2.2) created with Encore works correctly in VLC
LogicDeLuxe
2nd January 2011, 21:17
I have one suggestion for mixed progressive/interlaced video.
Well, when I convert NTSC hybrid 24fps, 30fps video, it would be very desirable to have 30fps sections converted to 25fps interlaced PAL and 24fps sections to 25fps progressive PAL.
HCenc's autodetection doesn't seem very suitable for this task.
Would it be possible to have the detection guided by the script somehow?
MrC
3rd January 2011, 15:11
I have one suggestion for mixed progressive/interlaced video.
Well, when I convert NTSC hybrid 24fps, 30fps video, it would be very desirable to have 30fps sections converted to 25fps interlaced PAL and 24fps sections to 25fps progressive PAL.
HCenc's autodetection doesn't seem very suitable for this task.
Would it be possible to have the detection guided by the script somehow?
Add ConvertFPS(25) to your AviSynth script.
;)
Bye
Mug Funky
4th January 2011, 00:54
@LogicDeLuxe:
that falls well outside the scope of an encoder.
you can search for standards conversion stuff for avisynth. (in particular, NTSCtools is designed just for what you ask, but i'm not sure the state of the currently posted version. maybe i'll re-upload it if there's any interest).
audiohominis
7th January 2011, 09:44
I tried 0.25 just now and the encode button is grayed out for some reason. I can't get it to become available.
Here, I feed it the simplest script imaginable:
SegmentedDirectShowSource("clip.mp4", fps=23.976, audio=false, convertfps=true)
LanczosResize(720,480)
The source is perfectly fine series of high-compat h.264 videos clip.00.mp4 through clip.20.mp4
Aside from enabling 3:2 pulldown and setting profile to Best everything is left at their defaults (not that it works otherwise either)
It seems to recognize the input alright, writes out Possible non-DVD compliant settings fixed after hitting make DVD compliant. Under Setting 3 tab it identifies my CPU as MMX/SSE2/SSE3/SSSE3/SSE4.2.
0.23 never game me this problem.
PS. If I may offer a side input, one I would offer to any developer, when creating a Browse for Folder dialog, please, PLEASE don't forget to include an input field where the user could simply paste the directory path and hit Enter instead of having to drill down every time. Life is short.
Thanks. :o
!!UPDATE!!
Okay, I don't know what the hell I did but I got the button enabled. The only thing I remember doing in that session was setting AVS memory (to max, which seems to be 1024).
Anyway, now I have a different problem. It fails to get to the 2nd pass. It finishes the first one, after which, it either reports that everything went fine, (where the output is a 0 byte m2v) or crashes.
audiohominis
7th January 2011, 21:48
I reproduced it again so I could post the log:
---------------------------------------
| HCenc - MPEG2 encoder - rel. 0.24.0 |
---------------------------------------
MPEG profile@level: MP@ML
input: f:\storage\dvd.avs
output: F:\storage\clip.m2v
--------------------
| encoder settings |
--------------------
profile: BEST
frames: 0 - 76668
framerate: 23.976
aspect ratio: 16:9
chroma format: 4:2:0
bitrate Kb/s: 4000
max. bitrate Kb/s: 8000
pulldown: yes, 23.976 --> 29.97
closed gops: no
VBV check: yes
scene change det: yes
interlaced: no, TFF
goplen,B-pic: AUTO 12
dc_precision: 9
intraVLC: auto
scan method: zigzag
bias: 0
chapter frames: 0
time code: 0 0 0 0
CPU: SSE4 (4.2)
priority: idle
SMP active: yes
matrix: MPEG
luminance gain: no
adaptive quantization: yes, strength 2
deadzone quantization: auto
------------------
| source stats |
------------------
nr. of frames in source: 76669
width*height: 720x480
fps: 23.976
nr. of frames to encode: 76669
frames to encode: 0 - 76668
:thanks:
LogicDeLuxe
9th January 2011, 15:05
you can search for standards conversion stuff for avisynth.No need, my norm conversions are just fine.
The only thing is, that the encoder sometimes encodes progressive frames as interlaced which can produce artifacts in the player as deinterlacing is applied, eventhough it wasn't really necessary. And the other case is that sometimes interlaced frames are encoded as progressive, letting the player skipping deinterlacing, eventhough it would be appropriate, having some residual combing.
And indeed, this is a very old limitation with any encoder up today. I've seen this kind of issues on commercially mastered DVDs as well. This does not matter when played back on an old CRT TV (except when anamorphic video is scaled to letterbox that is), but can make a significant difference on modern displays.
To get a perfect result, I have to encode progressive and interlaced sections separately and splice them together afterwards. Not exactly a comfortable way. Not only does this involve quite some cutting work, but also makes it necessary to inspect the entire clip scene by scene before encoding.
Why should some automation fall outside the scope of an encoder? There's a first time for everything. I'm not asking for integrating norm conversion into the encoder, but just some way to have avisynth communicate with it in order to set the flag on the fly.
Mug Funky
10th January 2011, 04:33
ah mmkay.
it would be interesting to be able to write one's own "interlace detection" function and pass a boolean to HC.
but the problem with interlace detection is at some point it will fail, no matter how you choose to measure interlace. the crossover between space and time is large.
with me, if there's a chance something will have any interlace (even if most is progressive) and i haven't time to chase it and encode segments, i'll encode the feature interlaced.
the only time i've seen progressive-in-interlaced get fully deinterlaced (rather than motion-adaptive deinterlace only getting the bits that look interlaced and leaving the static detail) is when field-pictures are used. HC doesn't encode field-pictures, so you should be fine.
if something in the playback chain is messing up, it's the fault of the playback not being sufficiently advanced :). any newish telly will do it well enough for even critical viewing, though it may fail on scrolling, motion-blurred text that's interlaced.
yup
26th January 2011, 08:30
Hi all!
I am planing use HCEnc for batch encoding. But now have problem, I can not load ini.
batching file
HCenc_025 –ini e:\YUP\Video\Mother\flower.ini
ini file
*INFILE e:\YUP\Video\Mother\flower.avs
*OUTFILE e:\YUP\Video\Mother\flower.m2v
*BITRATE 4000
*MAXBITRATE 8000
*FRAMES 0 134
*NOSMP
*PROFILE best
*ASPECT 4:3
*AUTOGOP 15
*DC_PREC 10
*PROGRESSIVE
*INTRAVLC 2
*MATRIX mpeg
I get error no input, output, max and avg bitrate i.e. HCEnc not read any info from ini file.
Batch file place at HCEnc directory.
Please advice.
yup.
mikenadia
26th January 2011, 11:05
flower.avs instead of flower.ini in the command line.
yup
26th January 2011, 11:13
mikenadia!
Are You sure?
I need load ini file!
Using GUI I am load ini files without problem.
yup.
yup
26th January 2011, 11:28
Problem was wrong type for minus character (cut and paste from manual).
Now all work.
yup.
rcubed
28th January 2011, 03:53
Hi all,
I read in the forum here that one can't frame serve from VirtualDub to HC? True? I've been thinking about looking into it, but if can't be done I won't waste my time trying it.
I also would find that useful. It is necessary to edit out commercials in a capture of TV programs. One can then do that in VirtualDub and produce an intermediate avi file (save as avi), but in my case the intermediate files are sometimes rather large (128GB). I have found the ability to start at frame x and encode through frame y in HC very useful, this only applies if the capture doesn't have any commercials or require multiple deletes. Any solutions would be welcome. Looks like Trim() in AVIsynth can be used to accomplish this?
rcubed
GodofaGap
28th January 2011, 09:12
Yes, you can use VirtualDub to determine the cutpoints and use trim.
What you also could do is frameserve VirtualDub to an avisynth script.
Avisource("myvdr.vdr")
I think frameserving in VirtualDub always causes conversion to RGB24 though.
rcubed
28th January 2011, 22:48
Yes, you can use VirtualDub to determine the cutpoints and use trim.
What you also could do is frameserve VirtualDub to an avisynth script.
Avisource("myvdr.vdr")
I think frameserving in VirtualDub always causes conversion to RGB24 though.
GodofaGap,
Thanks for the confirmation. Using VirtualDub to find the set points seems to be the way to go for my workflow. Now if I can just keep my bookkeeping straight on where I would set the cut points. I was going to try it out last night, but I started falling asleep. ;) I try to stay away from conversion back and forth to/from RGB.
rcubed
paquette
12th February 2011, 17:18
Hi all,
I use HCGUI all the time but it is causing Microsoft Visual C++ Runtime Library to throw the following error on the file I am working with now. I am using version 0.25 of HCGUI.
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application support team for more information.
Incidentally, in case it is relevant, I have used DGAVCIndex to index the underlying .264 file, but I doubt that that is relevant although I know there are some problems with DGAVCIndex.
Any idea what is going on?
poisondeathray
12th February 2011, 17:36
paquette - is this hcenc issue or some other issue?
try running your .avs script into different encoder e.g. xvid vfw in vdub , or megui etc.... do you get same error?
what about other videos? maybe that specific video is problematic ?
what happens when you try using something else other than DGAVCIndex? e.g. ffms2 , dss2
paquette
12th February 2011, 22:34
Thanks--it seems to be specific to this video. I will try ffms2 and if that doesn't work I'll try a different encoder--as time allows, that is.
StainlessS
14th February 2011, 04:32
Quote:
Originally Posted by GodofaGap View Post
Yes, you can use VirtualDub to determine the cutpoints and use trim.
What you also could do is frameserve VirtualDub to an avisynth script.
Code:
Avisource("myvdr.vdr")
I think frameserving in VirtualDub always causes conversion to RGB24 though.
GodofaGap,
Thanks for the confirmation. Using VirtualDub to find the set points seems to be the way to go for my workflow. Now if I can just keep my bookkeeping straight on where I would set the cut points. I was going to try it out last night, but I started falling asleep. I try to stay away from conversion back and forth to/from RGB.
rcubed
Although I have little doubt that the above would work,
I think a better alternative would be to use VirtualDubMod
to load in your avisynth script, trim the commericals out
in VDMod, click on "Tools/Script Editor" in VDMod, and
press "CTRL I" and it will insert the trims used in VDMod
into the Avisynth script for you. You will then only be dealing
with Avisynth and not a combination of the two and will involve
no colorspace conversions in VD.
The VirtualDubMod version I use is I think the latest,
v1.5.10.3 and can be run alongside other versions of VD
(I currently have 4 versions of VD installed on different
hotkeys). VDMod is the only VD version that has the built in
Avisynth script editor and functions (I think).
EDIT:- Press F7 in script editor to refresh in VDMod after
trims added.
Next post mentions VirtualDub v1.78 with avisynth
script editor, but this is broken, see two posts on for link to
VirtualDubMod v.1.5.10.3 Build 2550.
AlanHK
14th February 2011, 04:55
The VirtualDubMod version I use is I think the latest,
v1.5.10.3 and can be run alongside other versions of VD
(I currently have 4 versions of VD installed on different
hotkeys). VDMod is the only VD version that has the built in
Avisynth script editor and functions (I think).
VirtualDub Patch: http://tongari.at/
is VDub 1.78, including the Avisynth script editor.
I really don't understand why the official maintainers won't include this even as an option in current builds.
StainlessS
14th February 2011, 05:01
VirtualDub Patch:
is VDub 1.78, including the Avisynth script editor.
I really don't understand why the official maintainers won't include this even as an option in current builds.
Quite splendid, Downloading immediately.
Thankyou very much, and have to agree with your difficulty
to understand, it should be mandatory.
EDIT:- Above Link Removed, it has bug, see next post.
StainlessS
14th February 2011, 06:18
@AlanHK,
Note the version (v1.78) of VDub with Avisynth script editor is BAD for trimming.
Note, VirtualDubMod v1.5.10.3 had a fix for bad trims applied quite some time ago.
The problem stems from the fact that avisynth expects the first and last
frame numbers to KEEP in a trim (both inclusive) but for VD , the start frame is
inclusive and the end frame is exclusive.
eg:-
In VirtualDubMod v1.5.10.3 , move to frame 2 and press HOME (start of range) and then
go to frame 10 and press END (end + 1 of range) and you are selecting
frames 2 through 9. In the Avisynth script editor press CTRL-T to insert
"Trim with Range" and it will insert "Trim(2,9)" into Avisynth script (correct).
Do same in VirtualDub v1.78 with avisynth script editor and it will insert
"Trim(2,10)", (incorrect).
It's only 1 frame out but I dont want to go back
to subtracting 1 from the second trim arg in every trim, like
I used to do.
Suggest you take a look here for the VirtualDubMod_1.5.10.3_b2550.zip.
http://forum.doom9.org/showthread.php?t=141693
EDIT:- Below from changelog on VideoHelp, range fix applied by Fizick on 1.5.10.2
No further changes in v1.5.10.3 relating to avisynth scripting.
[VirtualDubMod 1.5.10.2]
Fizick:
- Fixed: inserted frame range and imported frameset end position was not correct in Avisynth Script editor.
- Fixed: too small string buffer to show Avisynth Information messagebox.
- Updated: added new Avisynth v2.5.5 and v2.5.6 keywords to highlight list.
AlanHK
14th February 2011, 09:04
In VirtualDubMod v1.5.10.3 , move to frame 2 and press HOME (start of range) and then
go to frame 10 and press END (end + 1 of range) and you are selecting
frames 2 through 9. In the Avisynth script editor press CTRL-T to insert
"Trim with Range" and it will insert "Trim(2,9)" into Avisynth script (correct).
Okay, will keep it in mind, but I don't use that method.
I generally do coding in AvsP, but I might make a boilerplate script and then use VDub to adjust the exact ranges of Trim.
When using Vdub's script editor I might use control-P to paste the current frame # into the code. Then I do F5 (save, refresh) and check that it's correct.
When the script gets complicated I might put
FrameNumber(0,0)
near the top of the file so I can see the original frame numbers.
manolito
14th February 2011, 15:01
If you do not want to deal with VDub's script editor, you can use Darksoul's little tool VCF2AVS. Do your edits in VDub and save processing settings in a VCF file. Load this file into VCF2AVS and it will generate the AviSynth trim commands. I have been using this method for years, and for me it never failed...
Cheers
manolito
paquette
14th February 2011, 23:40
Sorry, I haven't gotten around to trying VirtualDubMod but I thought I'd report back what I have found. If I use FFMS2, HCEnc makes it about a third of the way through the second pass before it crashes—as opposed to crashing almost immediately with the DGAVCIndex dga file.
I downloaded MeGUI and it refused to load the avs script (see below).
I get the following error from it:
The file E:\....avs cannot be opened.
Please make sure it's a valid AviSynth script and that AviSynth is properly installed.
You can check the validity of your script and AviSynth installation by opening the file in your favorite media player.
If that works, try opening the video in VirtualDub(Mod) as well. If the former works and the latter doesn't, install YV12 codec.
Error message for your reference: Unable to load DLL 'AvisynthWrapper'. The specified module could not be found.
(Exception from HRESULT: 0x08007007E)
Here is my AVS script as it is now:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\ffms2.avsi")
FFVideoSource("E:\..FileName.m2ts")
StainlessS
15th February 2011, 01:05
@AlanHK
I dont usually use that method either, it was just to demonstrate the error,
all args of range/trim/framesets in VD v1.78 are wrong, not just the one
I demonstrated. CTRL-P works ok because it just inserts current frame number,
it will work ok the way you do it because it is YOU who has done the
necessary conversion for avisynth. I sometimes do it the way you do (depending
on requirements) but would normally use the editing functions of VDMod as usual
and when completed all editing, just use CTRL-I to insert the entire set of trims,
all being correct and not needing checking (assuming that you did it right in Vdub).
If you dont need the script editing, then use the latest or other version of VD,
but if you do, then you might as well use the one that works properly.
TEST 2 with 1000 frame clip:-
Go to frame 2, press HOME (=start), go to frame 10 press END (=end + 1)
and press DEL, this should delete frames 2 through 9 (not 10).
Pressing CTRL-I in script editor will use the script editors
"Insert Frameset as Trims" to insert the below-
Inserted by VDMod 1.5.10.3 Trim(0,1) ++ Trim(10,999) # Correct
Inserted by VD 1.78 Trim(1,2) ++ Trim(11,1000) # Wrong
Dear me, even worse than I remembered, start and end of each trim wrong.
See the menu in Script editor for insert command options etc.
EDIT:- Also note that F5 is a sort of halfway refresh, if you change eg colorspace
or framecount, it may not be correct, F7 is a full refresh.
-----
@paquette
I think your LoadPlungin is not necessary as it is already in the plugin
autoload directory, ie already loaded anyway, comment it out.
Dont know much about FFVideoSource or ffms2.avsi, assume ffms2.avsi
is a standard script and not one you have created yourself, if self
created you would need to list that for perusal too.
The '..' in you source clip file name looks strange to me, bit rusty
on this but dont that mean parent directory? Is already in root directory
so could this cause a problem. Suggest make this file path/name explicit.
EDIT:- Have read your post again,
The file E:\....avs cannot be opened.
this is flagging the '..' line as described above,
make path explicit.
GodofaGap
15th February 2011, 08:16
VirtualDub Patch: http://tongari.at/
I really don't understand why the official maintainers won't include this even as an option in current builds.
Perhaps because he (not they) doesn't consider VirtualDub a front-end to Avisynth and prefers to work on other things in the limited time he has?
paquette
16th February 2011, 12:49
When I try to load the video file in question in VDMod I get the following error:
Couldn't locate decompressor for format “YV12” (unknown).
VirtualDub requires Video for Windows (VFW) compatible codec to decompress video. DirectShow codecs, such as those used by Windows Media Player, Are Not Suitable. Only 'Direct stream copy' is available for this video.
paquette
16th February 2011, 12:54
@AlanHK
@paquette
I think your LoadPlungin is not necessary as it is already in the plugin
autoload directory, ie already loaded anyway, comment it out.
Dont know much about FFVideoSource or ffms2.avsi, assume ffms2.avsi
is a standard script and not one you have created yourself, if self
created you would need to list that for perusal too.
The '..' in you source clip file name looks strange to me, bit rusty
on this but dont that mean parent directory? Is already in root directory
so could this cause a problem. Suggest make this file path/name explicit.
EDIT:- Have read your post again,
The file E:\....avs cannot be opened.
this is flagging the '..' line as described above,
make path explicit.
"E:\....avs" is just an abbreviated placeholder in the sample file I sent. The actual avs file I'm using has the complete path and file name so this shouldn't be the problem.
StainlessS
16th February 2011, 19:39
@paquette
Try installing DIVX for YV12.
paquette
17th February 2011, 13:33
Hmm--once I removed everything except the FFVideoSource and the resize from the AVS file, this video file works fine with HCEnc. I did reinstall Avisynth but I doubt that had anything to do with it.
Thanks to you all!
StainlessS
24th February 2011, 06:17
@paquette
I know that the "E:\....avs" is an abbreviated placeholder, it is this line I was pointing out as the error.
FFVideoSource("E:\..FileName.m2ts")
(Double dot)
Did not think you would go the the bother of including full
filepath etc for the plugin load, and then abbreviate the
other line.
anyway, glad you sorted it out.
Edit: by the way, ellipsis should be triple dot "...", double dot is a bit ambiguous,
and the quadruple dot in the error message is, 'inventive'.
VBDavie
30th March 2011, 22:13
I've used HCenc for awhile now and was always impressed by the quality but always depressed when I wanted to encode many movies at once. I found no good batch methods.
So, as a programmer, I decided to write my own. It allows BATCH encoding of your videos and you can of course set bitrates and resolution etc.. You can even CROP and ROTATE or add borders to the videos. It also handles AUDIO so that your final output is a playable MPG file complete with audio. My audio options allow bitrate, samplerate, stereo/mono/Dolby 5.1 etc.. and you can adjust the volume as well.
So once you have all your settings in place for your project, you just run the batch button and then sit back and let it churn. All the encoding (HCenc) and audio encoding (ffmpeg) and merging (mplex) are done in the background so you don't have to mess around with anything. It's all automatic!!!!!
You can download it at my site of....
www.smatters.com/HCCompanion
I noticed a lot of people mentioning the lack of BATCH mode and so I thought it would be useful to create such a program. If anyone likes my program and has any bug fixes or spelling error corrections or some other valuable contribution, I will give a free registration for it. You are not required to register, although I sadly have a "nag" screen in there, because my other freeware-donate endeavors didn't equate into much funds even though thousands of downloads and people telling me how wonderful my product was ;((((
Tell me what you think
Thanks
Davie
tin3tin
3rd April 2011, 14:58
I did a slideshow in avisynth with 600+ slides. Running the script in Media Player Classic ran fine, but HCenc(0.26 beta) crashed when loading the script. Is it possible HCenc crashes when it runs out of RAM? And I'm I doing something wrong in the HCenc usage when the script crashes in HCenc and not Mediaplayer Classic?
Mug Funky
7th April 2011, 05:41
i've been doing some encodes off 1920x1080 v210 avi files lately, and found that HC is crashing if i feed it 4:2:2 video in high def. SD seems to encode just fine.
could it be a memory thing? or the chroma being twice the expected height, could it be HC is getting caught when height "exceeds" the maximum that it was designed for? (ie chroma height of 1080 implies 1080 lines in 4:2:2, but 2160 lines in 4:2:0 which would exceed the 1152 lines that HC supports)
@ tin3tin: this might be your problem as well. have you tried putting converttoyv12() at the end of your script?
Taurus
8th April 2011, 17:46
Well, I've got some problems with lossless file encoding recently with HCenc 025.
Normally I'm using 1 pass VBR for all of my encodes.
This time, because of real heavy and slow avisynth filtering,
and because the duration of the source is about 5 hours, I decided to go the lossless path.
Tried it on small samples and everything works as expected.
I splitted the source to two halves, because I want to make a 2 DVD set of them.
Calculated the average bitrate plus a little overhead.
The avisynth script is multithreaded and working :mad::p
HCenc almost on default settings, only bitrate adjusted.
HCenc starts processing just fine, about 97% CPU, 5,4fps, I was quite satisfied.
At about 10000 frames suddenly CPU is choking, only 0,7fps :mad: and had to abort.
Some more tries with SMP disabled, lossless file to another harddisk, etc., still no luck.
Plenty of diskspace for intermediate files on all harddisks.
Tried 1 pass vbr, and bingo, rockstable above the 10000 frames limit.
Didn't test to the end because of time but I think it would work.
For now I'm using Virtualdub and the lossless UTVideo codec in YV12 chroma plane
to get a lossless file and everything is working fine.
A little slower (about 4.2 fps) and filesize is less then HCenc lossless file,
quality is a little worse after encoding to mpeg2 with Hcenc, but who cares, it's only marginal.
Maybe someone can shed some light on the above mentioned slowdown.
Here are some specs:
Intel Quadcore 6600
3 Gb ram
Vista 32bit fully patched
All drivers uptodate, graphics, directx, etc.....
Avisynth MT 2.58 (SEt's version)
Here is a similar Avisynth script used:
### SetMemoryMax(1024)
SetMtMode(5,4)
DGDecode_mpeg2source("I:\Video\Test.d2v").changeFPS(25000,1000,true)
SmoothLevels(Preset="TV2PC")
tweak(sat=1.75)
MT("TemporalDegrain(GPU=false, degrain=3)",4)
SetMTMode(2,4)
Fastlinedarken(strength=148)
SetMtMode(2)
LSFMod(Defaults="Slow", strength=320)
crop( 12, 4, -14, -4)
Spline64Resize(720,576)
### GetMTMode(false)
Distributor()
### GetMTMode(false) > 0 ? distributor() : last
Note: No crashing, no error messages.
And yes, I successfully have done a many multithreaded encodes.
But now I'm stumped.
Taurus
18th April 2011, 18:17
Bump
The project is closed, working with intermediate UTVideo encode.
But nevertheless I'm interested how and what brought HCenc to it's knees during lossless file generation.
As said before normal 2 pass and 1 pass vbr is doing fine but out of scope for a project like this.
I even analysed with a process viewer to see if there are any dll's interfering where HCenc choked, but nothing.
So I'm not sure if it's an Avisynth, HCenc or System error.
Any suggestions are welcome for future reference.
Richard1485
22nd April 2011, 00:22
I notice that the more recent versions of HCenc accept YUY2 as input. Is there any advantage to adding ConverttoYV12() to the Avisynth script prior to input rather than letting HCenc perform the conversion?
Southstorm
10th May 2011, 04:08
Hello all,
Has anyone been having trouble with FFMpegsourceMT and HcEnc in 1-pass mode? I'm using Windows 7 Ultimate and get a crash every time in 1-pass mode. Works fine in 2-pass. Any thoughts?
Thanks,
Southstorm
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.