View Full Version : HCenc 025
hank315
21st September 2010, 18:11
A new HCenc (025) release can be found here: http://hank315.nl
HCenc 024 sometimes hangs at the end of the encode, this is fixed in release 025.
Please post all comments about HCenc 025 in this thread.
MrC
21st September 2010, 19:21
Thanks for the new build.
Tried a couple of time (simple avs scripts, no external filters) without issues.
;)
Bye
soneca
21st September 2010, 22:06
Thank you!
Rob100
21st September 2010, 23:50
Excellent, thanks. I use HCEnc for all my DVD encoding these days.
Midzuki
22nd September 2010, 00:22
:thanks: again.
Dkruskie
22nd September 2010, 04:28
Thanks
Hagbard23
22nd September 2010, 06:41
Thanks...
Yobbo
22nd September 2010, 08:59
Thanks!
MatLz
22nd September 2010, 11:41
Thanks !!!
yup
23rd September 2010, 07:25
hank315:thanks:
Now 025 work fine without hang at end.
yup.
tom942
23rd September 2010, 19:39
Thank you Hank for this and previous version :)
Alex-Kid
23rd September 2010, 23:23
Thanks Hank!!
For this new version, and the previous ones that let me burn to DVD my growing family footage with great quality.
nevragain
1st October 2010, 23:24
Thanks very much I've been awaiting a stable version to use. I am curious about the *NOUSERDATA option mentioned in the previous thread does it still work in the latest version? Also could you clarify if calling HC directly is required or if the gui can be used?
hank315
2nd October 2010, 20:07
HCenc 025 doesn't write user data anymore, so the *NOUSERDATA command is obsolete.
It means the stream now is completely anonymous.
Also could you clarify if calling HC directly is required or if the gui can be used?
Both can be used, using the GUI is just an easy way to generate the required info for the encoder.
nevragain
2nd October 2010, 20:19
OK thanks very much. Since *NOUSERDATA is obsolete the issue raised in the previous thread about needing to call HC directly in order to not have user data is not relevant.
Rashik
6th October 2010, 21:19
I used this program but I got no sound. how can I get sound when I use this program? Can anyone help me?
um3k
6th October 2010, 23:46
You have to encode the sound in another program, HCenc is only a video encoder.
me@work
7th October 2010, 17:15
First of all, of course, a big THANKS. For this new version, but also for all versions before.
One absolutely minor issue I think I found in HC025 is that its log files still quote to be created by rel. 0.24.0.
---------------------------------------
| HCenc - MPEG2 encoder - rel. 0.24.0 |
---------------------------------------
Man, I searched all my batches why they were refusing to pick up the latest hc025, until I tried a manual encode and checked the log... :rolleyes:
hank315
8th October 2010, 07:22
Yep, a few days ago I also found this one :o
Also the manual has some references to 024.
Will change that, thanks for the report.
Rashik
8th October 2010, 21:28
You have to encode the sound in another program, HCenc is only a video encoder.
Thanks for the explanation.
MilesAhead
21st October 2010, 16:55
Thanks hank for HC. I've only done a couple runs with the latest but all seems as expected. I've been using it with very simple .avs scripts and muxing/authoring the video and audio "by hand" more or less. What I was curious about, is there a guide or other info that would give me insight on creating a simple mechanism to calculate frame ranges so I could launch a copy of HC per core, as is done in apps like FAVC and DVD-RB?
I'm starting with the assumption I would have to detect I-frames to know which frames to pick in the general range of 1/4 the playing time for my quad core to run 4 instances concurrently? All I'm thinking of doing is something extremely simple for my own use. I have a quad so I'd like to launch a copy of HC per core processing a range of frames of say, an .mkv file, to output .m2v files. I don't care at this point if I have to mux the sections together by hand afterward. I'd just like to be able to max out my cores since sizing the frame down when going from HD to SD really slows the throughput.
I'd appreciate any pointers. :)
mariush
21st October 2010, 17:09
The website doesn't load in Romania at my home ISP (UPC), it says the server takes too much time to respond - it loads however from my server in US.
So in case someone else has problems connecting to the website, I've uploaded the encoder here: http://savedonthe.net/download/230/HC025.html
sneaker_ger
21st October 2010, 17:13
You don't have to look for I-frames as AviSynth outputs uncompressed video - every frame is like an I-frame for the calling application. I don't have any handy tips for splitting the script up, but instead you could also try to use AviSynthMT (http://forum.doom9.org/showthread.php?t=148117) to use multi-threaded resizing instead of serveral HC instances.
MilesAhead
21st October 2010, 20:35
You don't have to look for I-frames as AviSynth outputs uncompressed video - every frame is like an I-frame for the calling application. I don't have any handy tips for splitting the script up, but instead you could also try to use AviSynthMT (http://forum.doom9.org/showthread.php?t=148117) to use multi-threaded resizing instead of serveral HC instances.
Thanks for the info. :)
LogicDeLuxe
26th October 2010, 13:24
I've upgraded from 0.23 to 0.25. I previously tried 0.24, but it crashed a lot. 0.25 didn't so far. :thanks:
I already encoded many movies with 0.23 and now with 0.25, and the quality is just great. I only once encountered some troublesome material so far: The under water scenes at the beginning of Titanic (SE, PAL). Even at 4900 avg, those scenes just have far too low bitrates at times. Bias, lumgain and AQ don't seem to have much effect on those.
Midzuki
27th October 2010, 02:33
I only once encountered some troublesome material so far: The under water scenes at the beginning of Titanic (SE, PAL). Even at 4900 avg, those scenes just have far too low bitrates at times. Bias, lumgain and AQ don't seem to have much effect on those.
Have you already tried a High-Bitrate quantization matrix http://forum.doom9.org/images/icons/icon5.gif
Nexin
17th November 2010, 03:40
@Hank315
Is there any plans for hcenc to use one of the virtualdub frameservers. This would help greatly to encode frameservered virtualdub files with hcenc.
Anyway i'm sure i think about this it has many more huge benefits than first thought of. Such as what i read on the net mostly is people needed to convert x to upload to video view sites. And equal or more than that how do i convert x video to mpeg2 for dvd. Since virtualdub can use ffdshow users could input any x conatiner into virtualdub. With tweaks (filters etc) or without frameserve to use with hcenc. After all i have used mpeg2 with dgindex and hcenc. And it beats the pants of ffmpeg encoder any day. And that's the main point since all those softwares out there use ffmpeg to convert x to dvd compatible files. Also virtualdub can be used to edit files if needed before frameserving, many users would like that feature.
For me its about atm uncompressed avi getting into hcenc. Yes also would be used for x containers to mpeg2 using hcenc, would fill a a big missing hole. That all there is now, is the poor ffmpeg encoder or buggy mencoder for x conatiners to mpeg2. Then i also forever have the problem of avisynth like i read other users have. No time to learn it's comands via a manual or other or want to script them. I know the old one avisynth should have had a gui from the start. Then again we have virtualdub frameserver so this alone would fill the divide we all have, then able to encode any x container with hcenc.
mariush
17th November 2010, 19:58
HCEnc can already use Avisynth scripts. Almost everything Virtualdub has at filters is already present in Avisynth and external Virtualdub plugins can also be called from Avisynth scripts so there's no need to go through Virtualdub when you can use directly AVS scripts.
poisondeathray
17th November 2010, 20:10
@nexin - avisynth isn't difficult to load a video, you type 1 line in notepad, save it, rename extension to .avs
AVISource("video.avi")
That's it
If you can't handle that 1 line :) , then you can try avs2dvd for a GUI, and it will generate the script for you and can use hcenc as the encoder
(if your video isn't yv12, then you need to type another line, ConvertToYV12() , or ConvertToYV12(interlaced=true) if it's interlaced )
MilesAhead
17th November 2010, 21:52
Another program that generates nice .avs scripts is d2mp
I used to copy and paste from the d2mp log. Then modify to suit my needs.
Nexin
18th November 2010, 06:06
@nexin - avisynth isn't difficult to load a video, you type 1 line in notepad, save it, rename extension to .avs
AVISource("video.avi")
That's it
If you can't handle that 1 line :) , then you can try avs2dvd for a GUI, and it will generate the script for you and can use hcenc as the encoder
(if your video isn't yv12, then you need to type another line, ConvertToYV12() , or ConvertToYV12(interlaced=true) if it's interlaced )
What that is to easy, no working out anything there or complicated command to learn.
So we are able to with just these simple commands frameserve from virtualdub using avs script to many more softwares including hcenc.
Wonder then why this is information i haven't read on the net before, when looking for a sollution. For many years i have had the need for softwares. Now can load video and make adjustments from virtualdub then frameserve it via avs simple script (as above) to mnay more softwares. If this is what you are saying then this for me is big Thank You :)
Avs2DVD i will take a look at that just download the install. Maybe of no use if doesn't have full range of gui editing, such as what vdub filters are able to do. That is what i need from a avisynth editor, though sollution above is just be the key. ;)
Incase it gets mentioned i know it could as has done previously. Avidemux does have intergration with avisynth, don't know if makes scripts or just a processor. If doesn't make scripts for use in other softwares maybe it should have that ability (and so should virtualdub). For various other reasons bugs and avidemux screen never staying static full screen, wait for it to improve. Though someday i hope it might all be fixed and then use it since it also has some nice filters.
Right then i will go and install the latest avisynth again, since i will now be needing it. :D
Update:
I have found that both avisource and directshowsource work very well with an uncompressed avi, with using the extra command ConvertTOYV12() for non interlaces and ConvertToYV12()(interlaced=true) for interlaced. Though not yet through virtualdub frameserver proxy mode avi. For now easy enough to process file first to uncompressed avi (huffy). Will get to grips with frameserve via proxy avi of virtualdub soon.
MilesAhead
20th November 2010, 21:46
I seem to have run into a bit of a mystery. I have several .m2ts files that seem to have identical stats as shown by MediaInfo:
1.778 video display AVC codec AC-3 audio 640 kbps video frame rate 23.976
Using this avs script for all:
SetMTMode(2,0)
DirectShowSource("movie.m2ts",audio=false)
BilinearResize(720,480)
When I pull some into HCgui it shows 3:2 pulldown disabled with a warning not DVD compliant fps.
Others 3:2 pulldown is enabled, I can check it and process with no problem.
As far as I can tell looking at the other tabs, the settings are the same.
I'm baffled at this point.
hank315
20th November 2010, 22:30
If you use
DirectShowSource("movie.m2ts",audio=false,fps=23.976)
does it work OK?
MilesAhead
20th November 2010, 22:38
If you use
DirectShowSource("movie.m2ts",audio=false,fps=23.976)
does it work OK?
Yup. Pulldown box is enabled now.
Thanks Hank.
edit: hmm, the side effect is the throughput is only about 1/2.
Instead of averaging about 60 fps I'm only getting 28 with films
where the Pulldown was enabled without specifying fps in
DirectShowSource.
I'll have to experiment a bit I guess.
edit2: interesting. If I put it through HC indirectly using BDRB I get the same throughput. Either it's coincidence or correct loading without the frame rate spec seems to indicate if SetMTMode() will work. Specifying the frame rate in DirectShowSource() seems to nullify SetMTMode. Of course this is only trying a few samples.
edit3: more likely I'm jumping to conclusions. The average bit rate differences may be the factor. I'd have to try the same flick with the different settings to really see. Since the source is so rich I'm trying out the one pass vbr mode. See if I can shave off 1/2 hour without losing too much picture. See how it goes. :)
edit4: don't mind me. I still have a lot to learn.. esp. with AviSynth. :)
Nexin
21st November 2010, 03:16
I'm thinking of pushing other videos containers/formats through avisynth script using avisource("filename") or directshowsource("filename") modes. But most videos will need resolution and some fps set for dvd compatible encoding. I push the make dvd compliant to check and does report reloution and fps needs changing.
GUI what tab and option is the set video resolution size.
What tab and option is the video framerate, i haven't found either.
Midzuki
21st November 2010, 04:40
I'm thinking of pushing other videos containers/formats through avisynth script using avisource("filename") or directshowsource("filename") modes. But most videos will need resolution and some fps set for dvd compatible encoding. I push the make dvd compliant to check and does report reloution and fps needs changing.
GUI what tab and option is the set video resolution size.
What tab and option is the video framerate, i haven't found either.
You will have to tweak your AVS files, so that they output "DVD-compliant" framerates and resolutions. DVD-V~compliant framerates: 23.976 (with pulldown flags), 25, and 29.97 fps. MPEG-2~compliant framerates: 23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 fps.
Nexin
21st November 2010, 17:01
Re: Changing resolution and fps
That would be scripting avs more than i want to, happy with the two commands i use now. Asking hank, as other encoders do have these. Maybe hcenc has them now, just not yet available in the gui.
Richard1485
21st November 2010, 20:11
Thanks, Hank for the great encoder. :-)
I don't understand how zones work though. I understand that you have to find the start frame and click "set zone" but I don't understand how long this zone lasts. How do you set where the zone ends? I have a video with a number of sections that the encoder finds difficult and makes too blocky. I am setting the bitrate higher for those sections.
I have tried various matrices, lumgain and AQ without significant improvement, so that is why I am looking at zones.
EDIT: I found this in the manual.
Example *ZONE 3
1200 1.3
1500 1.
2700 0.5
This command raises or lowers the bitrate for parts of the video.
The example will raise the bitrate starting at frame 1200, reset to normal at frame 1500 and lowers
the bitrate starting at frame 2700.
I think I understand this. I click "set zone" every time I want to input a value. Quite which of these values is Zone 3, I don't know, because I cannot seem to see zone numbers in the GUI.
I don't understand what 1.0 is 1.0 of. Is it the value that you input for the maximum bitrate or for the average bitrate? When you set a maximum bitrate of of 8000 and you input 1.1 is the bitrate now 8800?
MilesAhead
21st November 2010, 20:31
Re: Changing resolution and fps
That would be scripting avs more than i want to, happy with the two commands i use now. Asking hank, as other encoders do have these. Maybe hcenc has them now, just not yet available in the gui.
I don't know much about changing frame rate, but resolution change is done with resizing and sometimes cropping.
There are many different resize filters available to AviSynth. Some work better for sizing up, and others better for sizing down. To just pick one for each scenario would limit the versatility of the encoder. The most agreement I've seen on resizers is that the Lanczos family of resizers is generally considered good for sizing up. Other than that it's in the eye of the beholder.
It may be good to look at some generated avs scripts for starting points. For example programs like FAVC, d2mp and for sizing down BD Rebuilder. Also Quick Avi Creator generates skeleton avs scripts with stuff you need like color space stuff and so may be worth a look. Quick Avi Creator is a bit unusual in that it outputs the same resolution that's input. If you have 720P .mkv input you'll get 720P xvid output if you select xvid encoding.
I haven't gotten into doing cropping and adding borders myself in scripts. If the source is 1080 and I'm downsizing to standard NTSC dvd then I'm just resizing to 720x480. If you have to adjust like fixing letterboxing then it's more complicated and you may want to use a program that generates avs script like FitCD.
edit: like you, I'm still at the point of using very simple scripts. I've been experimenting with this one and HC...
SetMTMode(2,0)
DirectShowSource("movie.m2ts",audio=false,fps=23.976)
BilinearResize(720,480)
Nexin
22nd November 2010, 18:59
While ok for avisynth what of dgindex.
I'm not saying hcenc should be an editor and do what an editor can do. BUt to have same or similar tools that others encoders have, that we are used to using.
MilesAhead
22nd November 2010, 20:04
While ok for avisynth what of dgindex.
I'm not saying hcenc should be an editor and do what an editor can do. BUt to have same or similar tools that others encoders have, that we are used to using.
I only used this Gui a few times awhile ago(I haven't gotten into batch processing.) But it may have some useful features:
http://forum.videohelp.com/threads/271726-Batch-processing-GUI-for-HCEnc
Nexin
23rd November 2010, 20:29
Batch processing (a hint maybe ?) ok will take a look at the help to see how. Normal process so far with hcenc is do one file, then move onto the next job.
MilesAhead
23rd November 2010, 21:16
Batch processing (a hint maybe ?) ok will take a look at the help to see how. Normal process so far with hcenc is do one file, then move onto the next job.
Programs like AvsToDVD use HC as encoder but offer one or two resizers. A Gui outside of HC to give it structure was more the idea.
One of the fastest one click encoders is FAVC. Unfortunately I seem to have the bad luck that about 10% of my encodes quit the remux before they are 100% done or the authoring is not totally complete. I might get a VIDEO_TS folder with 1:58 of movie instead of 2 hours. Others tell me it doesn't happen to them.
Might be what you want. You can insert stuff in the Advanced Tab like custom user resizer, and other avs lines at certain locations without doing it by hand. Then just kick off the batch file.
It's no longer being developed it seems. Which is a shame. You can set it to launch a copy of HC for each core. Kicks ass, when it completes.
Nexin
25th November 2010, 01:08
A Gui outside of HC to give it structure was more the idea.
Its' sounding more like hcenc gui isn't able to stand up, on it's own two feet.
AlanHK
1st December 2010, 15:54
I'm getting lockups when encoding some MKVs.
HC gets to "100%" and the M2v is apparently complete (it plays and seems to be the full length), but HC is in a loop: it sits at 100%, and consumes 100% of the processor, doing God knows what.
This has happened a few times, each time it was stuck for over half an hour before I noticed it and killed the HC process (the only way -- the HC window would never come up).
Nothing strange in the log (except that it reports version 0.24 instead of 0.25):
==================================================
---------------------------------------
| HCenc - MPEG2 encoder - rel. 0.24.0 |
---------------------------------------
MPEG profile@level: MP@ML
input: O:\Zipang_01.avs
output: s:\mpg\Zipang_01.m2v
--------------------
| encoder settings |
--------------------
profile: BEST
frames: 0 - 34070
framerate: 23.976
aspect ratio: 16:9
chroma format: 4:2:0
bitrate Kb/s: 2061
max. bitrate Kb/s: 8000
pulldown: yes, 23.976 --> 29.97
closed gops: no
VBV check: yes
scene change det: yes
interlaced: auto, TFF
goplen,B-pic: AUTO 12
dc_precision: 9
intraVLC: auto
scan method: auto
bias: 0
chapter frames: 0
time code: 0 0 0 0
CPU: MMX
priority: idle
SMP active: no
matrix: QLB
luminance gain: no
adaptive quantization: yes, strength 2
deadzone quantization: auto
------------------
| source stats |
------------------
nr. of frames in source: 34071
width*height: 720x480
fps: 23.976
nr. of frames to encode: 34071
frames to encode: 0 - 34070
---------------------
| encoding - pass 1 |
---------------------
pass 1 encoding time: 0:34:46 (2086.16 s)
fps: 16.3
--------------------------------
| encoding - intermediate pass |
--------------------------------
bitrate set to: 2061 kb/s
estimated output file length: 357516 kB
intermediate encoding time: 0.23 s
---------------------
| encoding - pass 2 |
---------------------
pass 2 encoding time: 0:27:49 (1668.62 s)
fps: 20.4
------------------
| encoding stats |
------------------
intra matrix used
8 16 19 22 26 27 29 34
16 16 22 24 27 29 34 37
19 22 26 27 29 34 37 39
22 22 26 27 29 34 38 42
22 26 27 29 32 36 40 50
26 27 29 32 36 40 50 61
26 27 29 35 40 50 59 75
27 29 35 40 50 59 75 89
non-intra matrix used
16 17 18 19 20 21 22 23
17 18 19 20 21 22 23 25
18 19 20 21 22 23 24 26
19 20 21 22 23 24 26 28
20 21 22 23 25 26 28 29
21 22 23 24 26 28 29 31
22 23 24 26 28 29 31 34
23 24 25 28 29 31 34 38
nr. of gops: 3098
nr. of frames: 34071
nr. of I-frames: 3098
nr. of P-frames: 9559
nr. of B-frames: 21414
average bitrate: 2061
minimum bitrate: 135
maximum bitrate: 7752
bytes in bitstream: 366610034
bits in bitstream: 2932880272
average Quantizer: 6.131
total CPU time: 0:54:08 (3248.44 s)
total elapsed time: 1:02:40 (3759.94 s)
==================================================
==================================================
---------------------------------------
| HCenc - MPEG2 encoder - rel. 0.24.0 |
---------------------------------------
MPEG profile@level: MP@ML
input: O:\Zipang_02.avs
output: s:\mpg\Zipang_02.m2v
--------------------
| encoder settings |
--------------------
profile: BEST
frames: 0 - 28855
framerate: 23.976
aspect ratio: 16:9
chroma format: 4:2:0
bitrate Kb/s: 2061
max. bitrate Kb/s: 8000
pulldown: yes, 23.976 --> 29.97
closed gops: no
VBV check: yes
scene change det: yes
interlaced: auto, TFF
goplen,B-pic: AUTO 12
dc_precision: 9
intraVLC: auto
scan method: auto
bias: 0
chapter frames: 0
time code: 0 0 0 0
CPU: MMX
priority: idle
SMP active: no
matrix: QLB
luminance gain: no
adaptive quantization: yes, strength 2
deadzone quantization: auto
------------------
| source stats |
------------------
nr. of frames in source: 28856
width*height: 720x480
fps: 23.976
nr. of frames to encode: 28856
frames to encode: 0 - 28855
---------------------
| encoding - pass 1 |
---------------------
pass 1 encoding time: 0:23:28 (1407.78 s)
fps: 20.5
--------------------------------
| encoding - intermediate pass |
--------------------------------
bitrate set to: 2061 kb/s
estimated output file length: 302794 kB
intermediate encoding time: 0.20 s
---------------------
| encoding - pass 2 |
---------------------
pass 2 encoding time: 0:22:23 (1343.13 s)
fps: 21.5
------------------
| encoding stats |
------------------
intra matrix used
8 16 19 22 26 27 29 34
16 16 22 24 27 29 34 37
19 22 26 27 29 34 37 39
22 22 26 27 29 34 38 42
22 26 27 29 32 36 40 50
26 27 29 32 36 40 50 61
26 27 29 35 40 50 59 75
27 29 35 40 50 59 75 89
non-intra matrix used
16 17 18 19 20 21 22 23
17 18 19 20 21 22 23 25
18 19 20 21 22 23 24 26
19 20 21 22 23 24 26 28
20 21 22 23 25 26 28 29
21 22 23 24 26 28 29 31
22 23 24 26 28 29 31 34
23 24 25 28 29 31 34 38
nr. of gops: 2641
nr. of frames: 28856
nr. of I-frames: 2641
nr. of P-frames: 7984
nr. of B-frames: 18231
average bitrate: 2061
minimum bitrate: 161
maximum bitrate: 7038
bytes in bitstream: 310479944
bits in bitstream: 2483839552
average Quantizer: 4.914
total CPU time: 0:44:34 (2674.08 s)
total elapsed time: 0:45:56 (2756.00 s)
==================================================
The first file completed normally, the second froze. Though the log shows "total elapsed time" so it apparently froze AFTER completing the encode.
This was part of a batch encode, using a command line :
P:\HCenc\HCenc_025 -i O:\Zipang_02.avs -o s:\mpg\Zipang_02.m2v -b 2061 -aspectratio 16:9 -pulldown -profile best -matrix qlb -frames all -noini -2pass -maxbitrate 8000 -log O:\henc.log -avsreload
And the AVS file was :
FFmpegSource2("Zipang_02.mkv",atrack=1)++DirectShowSource("Zipang_02.mkv").AssumeFPS("ntsc_film")
AmplifydB(4.16)
TextSub("Zipang_02_Track5.ass")
AddBorders(8,0,8,0)
Trim(3044,31879)
AudioFadeIn(50)
last ++ BlankClip(last,20)
The DirectShowSource() is hack to load the fonts embedded in the MKV in Windows, to be used in the ASS file, HC sees only the video from FFMPEGSource.
Though I realise that this complexity may be the cause of the problem.
I haven't experimented to simplify the script yet, I may if I have time.
poisondeathray
1st December 2010, 16:16
alanhk - can you try a different encoder to rule out avisynth/script/filter issue? or is it really a hcenc compatibility issue ? e.g. try xvid vfw in vdub, or x264 and see if it "hangs"
AlanHK
1st December 2010, 16:31
alanhk - can you try a different encoder to rule out avisynth/script/filter issue? or is it really a hcenc compatibility issue ? e.g. try xvid vfw in vdub, or x264 and see if it "hangs"
It may well be -- I also get hangs when encoding audio from the same scripts.
I'll try other video encoders tomorrow.
It's strange, and perhaps fortunate, that HC doesn't lock at the end of the first pass, but after (?) the second -- it can restart, but seems unable to just shut down the Avisynth process.
==========
I ran the same command line script on the same source file that had hung before, and this time it completed.
The M2V file was identical (I did a binary compare).
So presumably the hang is due to some weirdness with codecs in Windows. Still; HC has finished the encode, has written the log, but is somehow still waiting for something to let it shut down. Could it be a bit more aggressive and not just wait for a signal that obviously does not always come?
AlanHK
9th December 2010, 18:46
This thread doesn't look terribly active.
Anyway, different files, different error:
I'm just encoding an MP4 file, using FFmpegSource2.
FFmpegSource2("4_B.mp4",atrack=-1)
SSRC(48000,false)
AmplifydB(0.82)
Trim(741,0)
FreezeFrame(0,1,1)
BlankClip(last,32) ++last
LanczosResize(704,480).AddBorders(8,0,8,0)
I'm getting about 90% of the frames with
"Warning: Small mismatch found in pass 2".
HCenc - MPEG2 encoder - rel. 0.24.0
---------------------------------------
MPEG profile@level: MP@ML
input: O:\4_B.avs
output: s:\mpg\4_B.m2v
--------------------
| encoder settings |
--------------------
profile: BEST
frames: 0 - 64347
framerate: 23.976
aspect ratio: 16:9
chroma format: 4:2:0
bitrate Kb/s: 1800
max. bitrate Kb/s: 8000
pulldown: yes, 23.976 --> 29.97
closed gops: no
VBV check: yes
scene change det: yes
interlaced: auto, TFF
goplen,B-pic: AUTO 12
dc_precision: 9
intraVLC: auto
scan method: auto
bias: 0
chapter frames: 0
time code: 0 0 0 0
CPU: MMX
priority: idle
SMP active: no
matrix: QLB
luminance gain: no
adaptive quantization: yes, strength 2
deadzone quantization: auto
------------------
| source stats |
------------------
nr. of frames in source: 64348
width*height: 720x480
fps: 23.976
nr. of frames to encode: 64348
frames to encode: 0 - 64347
---------------------
| encoding - pass 1 |
---------------------
pass 1 encoding time: 1:01:34 (3693.52 s)
fps: 17.4
--------------------------------
| encoding - intermediate pass |
--------------------------------
bitrate set to: 1800 kb/s
estimated output file length: 589713 kB
intermediate encoding time: 0.26 s
---------------------
| encoding - pass 2 |
---------------------
pass 2 encoding time: 1:00:42 (3641.91 s)
fps: 17.7
------------------
| encoding stats |
------------------
*** WARNING, 58314 frames found with small mismatch errors
*** ERROR, 1568 frames found with large mismatch errors
intra matrix used
8 16 19 22 26 27 29 34
16 16 22 24 27 29 34 37
19 22 26 27 29 34 37 39
22 22 26 27 29 34 38 42
22 26 27 29 32 36 40 50
26 27 29 32 36 40 50 61
26 27 29 35 40 50 59 75
27 29 35 40 50 59 75 89
non-intra matrix used
16 17 18 19 20 21 22 23
17 18 19 20 21 22 23 25
18 19 20 21 22 23 24 26
19 20 21 22 23 24 26 28
20 21 22 23 25 26 28 29
21 22 23 24 26 28 29 31
22 23 24 26 28 29 31 34
23 24 25 28 29 31 34 38
nr. of gops: 5794
nr. of frames: 64348
nr. of I-frames: 5794
nr. of P-frames: 18376
nr. of B-frames: 40178
average bitrate: 1800
minimum bitrate: 134
maximum bitrate: 6204
bytes in bitstream: 604824107
bits in bitstream: 4838592856
average Quantizer: 8.562
total CPU time: 1:54:32 (6872.45 s)
total elapsed time: 2:02:20 (7340.14 s)
I've never seen more than a handful of frames with that error before.
The resulting M2V file seems okay... but obviously I'm wary after seeing all these errors.
I'll rerun it later to see if it's reproducible.
AlanHK
12th December 2010, 06:46
I notice that you can set the database location in the ini file, (*DBPATH) but doesn't seem to be a corresponding command line option.
Would be useful as my program files are on a drive without a lot of extra space. Just had to restart a 10 hour encode when the database filled it up.
Mug Funky
15th December 2010, 05:56
i've always just used echo commands and batch files to make my encodes through CLI. you can generate a .ini, run HC, then delete the ini (or keep it for logging purposes) from a batch file.
[edit]
try this:
@ECHO OFF
ECHO.
ECHO Encoding %~n1...
ECHO.
SET /P bitrate= please enter average bitrate:
ECHO.
SET /P max= enter max bitrate:
ECHO.
SET /P ratio= enter aspect ratio (enter 4:3 or 16:9):
ECHO.
SET interlaced=n
SET /P interlaced= interlaced? (y/n):
SET panscan=n
IF "%ratio%" NEQ "4:3" SET /P panscan= pan and scan? (y/n):
ECHO *INFILE %~dpn1.avs>"%~dpn1_settings.ini"
ECHO *OUTFILE %~dpn1.HCenc.m2v>>"%~dpn1_settings.ini"
ECHO *LOGFILE %~dpn1.log>>"%~dpn1_settings.ini"
ECHO *BITRATE %bitrate% >>"%~dpn1_settings.ini"
ECHO *MAXBITRATE %max% >>"%~dpn1_settings.ini"
ECHO *1PASS >>"%~dpn1_settings.ini"
ECHO *PROFILE best>>"%~dpn1_settings.ini"
ECHO *AUTOGOP 12 >>"%~dpn1_settings.ini"
ECHO *AQ 4 >>"%~dpn1_settings.ini"
ECHO *DC_PREC 10 >>"%~dpn1_settings.ini"
ECHO *CLOSEDGOPS>>"%~dpn1_settings.ini"
ECHO *NOSEQ_ENDCODE>>"%~dpn1_settings.ini"
ECHO *PREVIEW>>"%~dpn1_settings.ini"
ECHO *MATRIX mpeg>>"%~dpn1_settings.ini"
ECHO *ASPECT %ratio% >>"%~dpn1_settings.ini"
if %interlaced%==y ECHO *INTERLACED>>"%~dpn1_settings.ini"
if %interlaced%==n ECHO *PROGRESSIVE>>"%~dpn1_settings.ini"
ECHO *TFF>>"%~dpn1_settings.ini"
if %panscan%==y ECHO *PANSCAN 540 576 0>>"%~dpn1_settings.ini"
ECHO *WAIT 0 >>"%~dpn1_settings.ini"
ECHO "c:\Program Files\HC\HCenc_025_SSE4.exe" -ini "%~dpn1_settings.ini" -i "%~dpn1.avs" -o "%~dpn1.HCenc.m2v" >>"%~dp1\encode.bat"
just copypaste into an empty text file and save as .bat, then drag avs files onto it.
you'll have to add the DBPATH parameter and remove the 1pass line. not difficult.
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
qyot27
15th May 2011, 22:51
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
I've been experiencing a crash during the sampling pass with the C-interface branch of FFMS2 ('MT' is questionable now since much of that actually got committed to FFmpeg officially), but I don't entirely know whether it's an HCenc issue or an FFMS2 issue. It doesn't seem to happen on my computer (which uses XP, but I also don't do episode-length stuff on here due to the fact it would have to take hours for a single half-hour video), but it does on another Vista-based setup I have access to. I don't remember it happening with previous revisions of FFMS2, but said previous revisions had problems with the framerate conversion routines that caused a crash at the end of encoding.
The solution I found to avert this problem is:
Mount the FFMS2-using script as a folder with Pismo File Mount and the AVFS plugin.
Write secondary AVISource() script referring to the .avi in the mount folder.
Give the AVISource() script to HCenc.
Result: no crash.
Revgen
21st May 2011, 16:15
FEATURE REQUEST -
Support for "non-MPEG2 compatible" framerates and the ability to turn them into "MPEG2 compatible" framerates using RFF flags.
I want to encode a 19.98fps silent movie into a 29.97fps DVD-compatible movie using "soft telecine". Currently the only way I can do this is to use an outdated and buggy version of Mencoder that has Neuron2's DGPulldown feature included in the build. The video works fine with DVDLab Pro and DVD Styler and plays fine in both my standalones, but I'd rather do it with HCEnc instead since the only way to keep Mencoder from crashing is to encode the video into 4 chunks separately and combine with DGMPGDec. Way too messy.
manono
22nd May 2011, 06:46
I want to encode a 19.98fps silent movie into a 29.97fps DVD-compatible movie using "soft telecine".
I do this sort of thing quite a bit, although using CCE. After making the script for 19.98fps, add an 'AssumeFPS(23.976)' at the bottom and encode for 23.976. Adjust your bitrates upwards. For example, if the average bitrate is 4000, set it for 4800. 23.976/19.98=1.2. 4000x1.2=4800. Do the same for the max and min bitrates. When all done run the 23.976fps MPV through DGPulldown set for 19.98->29.97 and everything comes out OK.
Revgen
22nd May 2011, 08:43
I do this sort of thing quite a bit, although using CCE. After making the script for 19.98fps, add an 'AssumeFPS(23.976)' at the bottom and encode for 23.976. Adjust your bitrates upwards. For example, if the average bitrate is 4000, set it for 4800. 23.976/19.98=1.2. 4000x1.2=4800. Do the same for the max and min bitrates. When all done run the 23.976fps MPV through DGPulldown set for 19.98->29.97 and everything comes out OK.
Hmm...I didn't know that DGPulldown worked that way. I thought I had to feed it video that was actually 19.98fps. Thanks for the tip.
However, it would be nice if HCEnc could do the pulldown instead so I don't have to take extra steps.
Trixter
4th June 2011, 08:02
I'm trying to evaluate HCenc with other encoders (running a 3SSIM comparison) and I can't get HCenc to encode my source material in VBR mode (both 2-pass and 1-pass). It works fine in CQ mode, but when trying to encode my longform project (3.5 hours interlaced NTSC material, 376642 frames), it always hangs around 75% of the encode, with the log file stating that it's trying to reduce the bitrate into negative numbers.
I can try multiple parameters and post a log, but before doing so I wanted to know if there was a known limitation with really long projects. I tried both 0.25 and 0.26 beta.
Fishman0919
20th June 2011, 17:17
the HC026_beta_16-06-2011 release seems to have the HCenc_026.exe from HC026_beta_05-03-2011
manolito
20th June 2011, 17:49
the HC026_beta_16-06-2011 release seems to have the HCenc_026.exe from HC026_beta_05-03-2011
I don't think so. Rightclicking the executable and selecting 'properties' shows that the file has been created on 16-06-2011. Looks more like Hank just forgot to change the window title...
Cheers
manolito
hank315
20th June 2011, 23:49
I thought I updated the title bar, apparently not...
Now it is :)
techreactor
14th July 2011, 09:34
It seems that the ver0.25 is not able to control the bitrate with the Maxbirate command.
I encoded with *MAXBITRATE 9000, the DVD was skipping and freezing at a certain timeframe which left me perplexed,(I re-encoded 2-3 times removing parameters like Luma and AQ, just to be sure, but still it froze at the same frames) after checking on various things, checked only the video stream for bitrate in VLC player and found the bitrates jumping to 11000-12000 on certain frames during that specific playtime.
Will move back to 0.21, just wanted to report here.
Trixter
14th July 2011, 17:00
Why all the way back to 0.21? Why not 0.22 or 0.23? 0.23 added adpative quant, surely that would improve quality substantially.
hank, if I can provide a clip and .ini file that always produces the bug, where should I upload them to for analysis?
techreactor
15th July 2011, 05:00
Why all the way back to 0.21? Why not 0.22 or 0.23? 0.23 added adpative quant, surely that would improve quality substantially.
hank, if I can provide a clip and .ini file that always produces the bug, where should I upload them to for analysis?
I havent used .22 or .23 extensively whereas .21 I have, without any problems.
Richard1485
15th July 2011, 14:12
It would be nice to know which previous version of HCenc to use until a fix is released.
Taurus
15th July 2011, 19:10
@techreactor & Trixter:
how did you get this overshoot in maxbitrate?
I've just tested a few encodes I made in the past with Bitrate Viewer.
All maxbitrate are under choosen limit.
Example:
maxbitrate:9300 ->9286, a slight undershoot in all encodes.
average bitrate:6500 ->6500 in all encodes.
And no problems with hardware and software DVD players.
So what is so specific with your sources or settings?:confused:
Edit: maybe it's the decoder: directshowsource?
hank315
15th July 2011, 22:31
The max bitrate is based on a GOP level, so for a DVD this means about every 0.5 sec.
The average bitrate per GOP is checked, if it overshoots the max bitrate set, the GOP will be recycled with higher quantizers until it satisfies max bitrate.
For now I have no clue what's causing this because nothing really changed in the bitrate control.
Can you post the ini file and a part of the encoded m2v file where it overshoots, mediafire.com will be fine.
techreactor
16th July 2011, 10:47
@techreactor & Trixter:
how did you get this overshoot in maxbitrate?
I've just tested a few encodes I made in the past with Bitrate Viewer.
All maxbitrate are under choosen limit.
Example:
maxbitrate:9300 ->9286, a slight undershoot in all encodes.
average bitrate:6500 ->6500 in all encodes.
And no problems with hardware and software DVD players.
So what is so specific with your sources or settings?:confused:
Edit: maybe it's the decoder: directshowsource?
Nothing specific in the sources, in the same hardware/software environment if i switch to 0.23, HCenc works like a charm. Anyways once Trixter uploads, Hank can check himself and hopefully will find the problem.
techreactor
23rd July 2011, 13:29
The max bitrate is based on a GOP level, so for a DVD this means about every 0.5 sec.
The average bitrate per GOP is checked, if it overshoots the max bitrate set, the GOP will be recycled with higher quantizers until it satisfies max bitrate.
For now I have no clue what's causing this because nothing really changed in the bitrate control.
Can you post the ini file and a part of the encoded m2v file where it overshoots, mediafire.com will be fine.
@Hank,
I have been testing this further in the limited time I get. Few observations using the same source and environment.
- I was using A2Dvideosource() & spline64resize() to downsize but DVD used to hang and bitrate went over the defined in HC ini.
- I moved to Lanczos4resize and the bitrate control is well within the defined rate in ini, DVD now skips instead of hanging.
- Now testing with Lanczos (3 taps by default).
- Will test later with a low bitrate setting (6k) instead of 8k, just to see if HCenc works better at lower bitrates.
But I hope its not the same problem you rectified in 2005 in 015.
Problem:
However, at the middle of this scene, the DVD starts to stutter and then hangs, like pausing. Fast forward and the DVD continues to play.
I tried this on my PC and it played OK (my DVD player is Pioneer DV-563A). I tried burning with 2x and still had the problem.
Your Solution:
In fact it is a bug in HC which was introduced in HC015.
All software decoders and most HW-players will play it without any problem but some HW-players (some Philips, Koss and Pioneer types) don't like it.
It is solved in the next HC016 release
Coincidently both my players are Philips. :confused:
hank315
23rd July 2011, 19:40
In fact it is a bug in HC which was introduced in HC015.
All software decoders and most HW-players will play it without any problem but some HW-players (some Philips, Koss and Pioneer types) don't like it.
It is solved in the next HC016 release
I remember that one, motion vectors were too long, some HW players didn't like that.
But that's certainly solved.
hank, if I can provide a clip and .ini file that always produces the bug, where should I upload them to for analysis?
Could you please upload the clip and ini file, preferably at mediafire.com.
Trixter
23rd July 2011, 23:23
Could you please upload the clip and ini file, preferably at mediafire.com.
I have successfully reproduced the "infinite underflow adjustment" bug and am uploading to mediafire. It will take a few hours to complete the upload though (the clip has to be a bit large to reproduce the bug 100%) so I'll email again with links when it's finished and ready.
Trixter
24th July 2011, 00:48
Okay, everything necessary to reproduce the bug should be here:
http://www.mediafire.com/?1l9u8faf6okl3
Let me know if you have trouble accessing it.
hank315
24th July 2011, 08:43
OK, got the files, thanks, will investigate.
hank315
25th July 2011, 22:03
Try this one:
*INFILE h:\work\hcenc bug\_chromosphere_test_480i.avs
*OUTFILE H:\work\hcenc bug\test_output.m2v
*BITRATE 4600
*MAXBITRATE 9200
*FRAMES 0 3565
*PROFILE best
*GOP 15 2
*INTERLACED
*TFF
*INTRAVLC 2
*MATRIX mpeg
and:
AVISource("_chromosphere_test_480i.avi")
ConvertToYV12()
Seems the *CHROMADOWNSAMPLE command screws up, don't know why ATM.
Trixter
26th July 2011, 06:09
I'm afraid that .ini just makes things worse. Now it just hangs earlier in the 2nd pass, with a different error message:
http://img190.imageshack.us/img190/9941/hcenchang.png (http://imageshack.us/photo/my-images/190/hcenchang.png/)
Were you able to reproduce this on your setup? What does my file package do on your test/development machine?
TheSkiller
26th July 2011, 17:58
@Trixter You're still feeding HCenc with YUY2 (4:2:2), add ConvertToYV12(interlaced=true) at the end of your AVS script. This way HCenc can skip the chroma downsampling (as the chroma gets downsampled by AviSynth).
I'm going to download your file package and try to encode the thing.
Edit: OK, downloaded it. Changed ConvertToYUY2() to ConvertToYV12(true) and used your HCenc settings. Error at 86% (total) "underflow, fixing VBV", freezes.
Then I removed *CHROMADOWNSAMPLE from the ini, still the same error.
Then I used Hank's settings (GOP 15-2), which gives me the same error that you get, "VBV at critical level".
Trixter
29th July 2011, 15:42
Yeah, I was pretty sure *CHROMADOWNSAMPLE wasn't the problem; the issue is with bitrate (you can see the VBV buffer empty right when the problem happens). Besides, the sample clip has no chroma info anyway ;-) (joking, I'm sure that has nothing to do with it, it's a high-contrast clip with a lot of motion which is obviously difficult to encode)
Hank, any thoughts, progress?
hank315
1st August 2011, 00:36
@trixter
If I use the next HC.ini file:
*INFILE G:\hcenc bug\_chromosphere_test_480i.avs
*OUTFILE G:\hcenc bug\out.m2v
*LOGFILE G:\hcenc bug\out.log
*BITRATE 4600
*MAXBITRATE 9200
*FRAMES 0 3565
*PROFILE best
*GOP 15 2
*INTERLACED
*TFF
*INTRAVLC 2
*MATRIX mpeg
and AVS script:
AVISource("_chromosphere_test_480i.avi")
ConvertToYV12()
The encode finished without a problem.
This is a source which is pretty tough for MPEG2, quantizers are very high.
Just look at the next links:
HCenc encode (http://hank315.nl/files/HCenc026.png)
CCE encode (http://hank315.nl/files/CCE_basic.png)
If the *CHROMADOWNSAMPLE command is added, HCenc freezes at 69% in pass 2.
That's weird because the down sample routines aren't used, the source is already YV12.
Still investigating, I thought this would be an easy one but it's not :devil:
Trixter
18th September 2011, 04:11
I tried these settings exactly and it worked. Since that chunk of footage is actually part of a much longer video, I then used those settings with the full video and it hung :-(
I'm not sure what else to tell you. I certainly can't upload the 141G source file for you to test...
Trixter
18th September 2011, 04:13
BTW in your screenshots you show a program called MPEG Analyzer Pro. Where can I download that program? I searched google for a while but couldn't find anything that looked like that program.
hank315
19th September 2011, 22:07
Still investigating but I have to admit my time for it is very scarce ATM :(
MPEG analyser Pro is a pretty old program which I still use to analyse MPEG2 streams.
Development has stopped AFAIK, developer is Jean-Luc Pons, I don't know if it's available for download.
Trixter
26th September 2011, 16:32
It's not available for download, could you make it available somewhere?
Sharc
26th September 2011, 21:36
http://www.labdv.com/software/encoding-en.html
You must register for downloading
TheSkiller
26th September 2011, 23:08
MPEG Analyser looks neat. But is it just me or is registering on that site not free? "Download service is restricted to VIP user. // Register for 1 year $$$39.90" :mad:
Sharc
27th September 2011, 19:19
Looks like, yes. 3 months is USD 19.90.
It's just the only link I found for downloading. I don't have it myself.
If you should find 9 more useful downloads there it's 2 USD each :D
techreactor
7th April 2012, 12:50
Still investigating but I have to admit my time for it is very scarce ATM :(
Any luck with the new version ??, I see 0.26beta only.
techreactor
19th April 2012, 06:41
@hank, Also are there any plans to have a 64bit version of HC enc ?
With the new release of FFMpeg which has fixed many bugs and is available in 64bit version. FFMpeg has come hairline close to HCenc in terms of Bare eye Quality and encoding speeds have also improved drastically.
Hope to get the 64bit of HCenc someday. :)
smok3
19th April 2012, 08:11
@techreactor: care to share some complete ffmpeg command lines?
AlanHK
17th July 2012, 10:45
I encode in batch files and like to put all the parameters on the command line, and use "-noini" to make it independent of any ini file.
I'm just trying the lossless option, which you can set with "-lossless", but there does not appear to be an option to set the path of that or of HC's database. It then defaults to HC's program folder, and I don't have enough room to put a lossless file there.
Can you add -llpath and -dbpath to the batch options?
zambelli
17th January 2013, 22:39
Has anyone run into issues with 4:2:2 sources? When I use any YUY2 Avisynth source (regardless of whether I pick 4:2:0 or 4:2:2 output), HCEnc just crashes on me immediately. I've tried both 0.25 and 0.26beta versions.
Here is my config:
*INFILE d:\videos\sources\foo.avs
*OUTFILE D:\Videos\Sources\foo.m2v
*BITRATE 50000
*MAXBITRATE 50000
*FRAMES 0 10439
*PROFILE best
*AUTOGOP 15
*DC_PREC 10
*INTERLACED
*TFF
*CLOSEDGOPS
*LASTIFRAME
*INTRAVLC 2
*MATRIX mpeg
*LUMGAIN 1
*COLOUR 1
*PRIORITY low
*CHROMAFORMAT 422
Note that I'm actually trying to use the 4:2:2 mode to produce 50 Mbps 4:2:2 mezzanines, so ConvertToYV12() in Avisynth is not an acceptable workaround.
Carpo
19th January 2013, 18:39
Any news on an update version of this great app or is the beta the last we will see of development Hank?
Fishman0919
20th January 2013, 22:03
@techreactor: care to share some complete ffmpeg command lines?
Here's one I've used with ffmpeg and a sim ver with Mencoder... works well with encoding above 4500k
ffmpeg.exe -i "3.avs" -framerate 23.976 -aspect 16:9 -dc 9 -g 12 -qmin 1 -qmax 31 -maxrate 7500k -q:v 2 -b_strategy 1 -bf 2 -pre_dia_size 3 -dia_size 3 -me_range 24 -b_qfactor 1.0 -i_qfactor 1.0 -b_qoffset 0 -mbd rd -mbcmp 2 -cmp 2 -subcmp 2 -preme 2 -precmp 2 -subq 2 -skipcmp 2 -qcomp 0.7 -qblur 0 -scplx_mask 0.2 -p_mask 0.5 -last_pred 4 -bidir_refine 4 -deblock 0:0 -pass 1 -passlogfile ffmpeg -an -f mpeg2video pass1.m2v
ffmpeg.exe -i "3.avs" -framerate 23.976 -aspect 16:9 -dc 9 -g 12 -lmin 0.01 -mblmin 1 -qmin 1 -qmax 31 -qsquish 1 -maxrate 7500k -b:v 5000k -bf 2 -pre_dia_size 3 -dia_size 3 -me_range 24 -b_qfactor 1.0 -i_qfactor 1.0 -b_qoffset 0 -trellis 2 -flags:v +mv0+cbp -mbd rd -mbcmp 2 -cmp 2 -subcmp 2 -preme 2 -precmp 2 -subq 2 -skipcmp 2 -qcomp 0.7 -qblur 0 -scplx_mask 0.2 -p_mask 0.5 -last_pred 4 -bidir_refine 4 -deblock 0:0 -pass 2 -passlogfile ffmpeg -an -f mpeg2video pass2.m2v
zambelli
21st January 2013, 10:08
Also, has anyone done quality comparisons of HCEnc vs x262 encoder?
Fishman0919
21st January 2013, 16:59
Also, has anyone done quality comparisons of HCEnc vs x262 encoder?
Yes... HC
x262 is not there yet.
OtonVM
3rd April 2013, 16:30
I'm trying to encode video with HC but the resulting DVD doesn't work. I wonder if I'm using some incompatible settings but if I am I'm not getting a warning.
In any case, I encode the avs with these settings (HCenc 0.26 btw):
*INFILE d:\videos\to dvd\hc test\test.avs
*OUTFILE d:\videos\to dvd\hc test\test.m2v
*LOGFILE d:\videos\to dvd\hc test\test.log
*BITRATE 5500
*MAXBITRATE 9200
*FRAMES 0 4999
*PROFILE best
*AUTOGOP 12
*DC_PREC 10
*PROGRESSIVE
*PROG_SEQ
*TFF
*BIAS 10
*AVSMEMORY 500
*PULLDOWN
*INTRAVLC 2
*CUSTOMMATRIX
8 8 8 10 12 14 16 18
8 10 12 14 16 18 20 20
8 12 14 16 18 20 22 22
10 14 16 18 20 22 24 24
12 16 18 20 22 24 26 26
14 18 20 22 24 26 28 28
16 20 22 24 26 28 30 32
18 20 22 24 26 28 32 64
16 16 16 18 20 22 24 26
16 18 20 22 24 26 28 28
16 20 22 24 26 28 30 30
18 22 24 26 28 30 32 32
20 24 26 28 30 32 34 34
22 26 28 30 32 34 36 36
24 28 30 32 34 36 48 56
26 28 30 32 34 36 56 128
*LUMGAIN 1
*PRIORITY high
*CHROMAFORMAT 422
Then I import the m2v as asset in adobe encore which doesn't complain. But when I mux the file into a DVD structure and I try to play that in various players I get different results: MPC-HC with it's own decoder produces only a grey checkerboard (I guess macroblocks?), using ffdshow works fine, on the mac (see screenshot) the apple dvd player produces only a pink checkerboard (that can't be picked up by the screenshot), mplayer only a grey picture and VLC works fine. They all show subtitles.
And the main problem: my hardware player doesn't work or rather, like these software players it only shows subtitles.
http://i50.tinypic.com/30hv96e.jpg
Any ideas?
AlanHK
3rd April 2013, 16:46
*MAXBITRATE 9200
Max bitrate is usually 8000.
Technical Info for DVD-Video (http://www.videohelp.com/dvd#tech)
Total bitrate including video, audio and subs can be max 10.08 Mbit/s (10080 Kbit/s)
So with subs, and audio, I think you've gone over.
poisondeathray
3rd April 2013, 17:07
*CHROMAFORMAT 422[/CODE]
Any ideas?
422 for DVD ? Or was that a typo/ copy/paste error ?
OtonVM
4th April 2013, 09:43
422 for DVD ? Or was that a typo/ copy/paste error ?
Ha! That would be a typo wouldn't it? :)
No, I have no idea why I set that option, probably while I was testing different settings... Anyway, that was it, obviously...
Thank you!
colinhunt
31st May 2013, 10:35
Can anyone help me find (and remove) the bottleneck in my set-up?
I'm using HCenc to create DVD-compliant MPEG-2 streams from ProRes HD .mov files. Using high image quality settings my encoding rig does 16fps in both passes -- but CPU usage never goes above 10%.
Here's an example of a Avisynth script I load into HCenc:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\QTSource.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ColorMatrix.dll")
QTInput("X:\HDProRes.mov")
Spline36Resize(704,576)
AddBorders(8,0,8,0)
ColorMatrix(mode="Rec.709->Rec.601",Clamp=false)
I've also tested with ffms2:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ColorMatrix.dll")
FFVideoSource("X:\HDProRes.mov", threads=1)
Spline36Resize(704,576)
AddBorders(8,0,8,0)
ColorMatrix(mode="Rec.709->Rec.601",Clamp=false)
but fps and CPU usage remain the same.
Is there anything I can do to squeeze a faster encoding speed out of the system?
Groucho2004
31st May 2013, 10:50
Can anyone help me find (and remove) the bottleneck in my set-up?
I'm using HCenc to create DVD-compliant MPEG-2 streams from ProRes HD .mov files. Using high image quality settings my encoding rig does 16fps in both passes -- but CPU usage never goes above 10%.
Here's an example of a Avisynth script I load into HCenc:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\QTSource.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ColorMatrix.dll")
QTInput("X:\HDProRes.mov")
Spline36Resize(704,576)
AddBorders(8,0,8,0)
ColorMatrix(mode="Rec.709->Rec.601",Clamp=false)
I've also tested with ffms2:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ColorMatrix.dll")
FFVideoSource("X:\HDProRes.mov", threads=1)
Spline36Resize(704,576)
AddBorders(8,0,8,0)
ColorMatrix(mode="Rec.709->Rec.601",Clamp=false)
but fps and CPU usage remain the same.
Is there anything I can do to squeeze a faster encoding speed out of the system?
Things to check:
- How fast is the script itself? (test with AVSMeter (http://forum.doom9.org/showthread.php?t=165528))
- Have you enabled multithreading in HC?
AlanHK
31st May 2013, 10:57
Can anyone help me find (and remove) the bottleneck in my set-up?
Try using the lossless intermediate file.
It's probably lower res than your source, so the 2nd pass encode to MPEG should be faster. Anyway, it won't be slower.
It needs 10 or 20 GB per hour of video for the temp lossless file, see the settings if you need to specify where it goes.
colinhunt
31st May 2013, 11:05
Things to check:
- How fast is the script itself? (test with AVSMeter (http://forum.doom9.org/showthread.php?t=165528))
- Have you enabled multithreading in HC?
Thank you very much for taking the time to reply!
Gotta love this forum; one gets to learn new things every day :)
AVSMeter says my scripts are slooooooow. ffms2:
Frames processed: 436 (0 - 435)
FPS (min | max | average): 10.54 | 23.76 | 17.19
CPU usage (average): 5%
Thread count: 18
Physical Memory usage (peak): 201 MB
Virtual Memory usage (peak): 202 MB
Time (elapsed): 00:00:25.358
QTSource:
Frames processed: 362 (0 - 361)
FPS (min | max | average): 9.67 | 27.65 | 17.36
CPU usage (average): 7%
Thread count: 11
Physical Memory usage (peak): 245 MB
Virtual Memory usage (peak): 249 MB
Time (elapsed): 00:00:20.851
Of course, those are only a small sample from the start of the file.
As for HCenc multithreading... I have some reading to do.
Groucho2004
31st May 2013, 11:12
Please post the complete script you used for this test:
ffms2:
Frames processed: 436 (0 - 435)
FPS (min | max | average): 10.54 | 23.76 | 17.19
CPU usage (average): 5%
Thread count: 18
Physical Memory usage (peak): 201 MB
Virtual Memory usage (peak): 202 MB
Time (elapsed): 00:00:25.358
Also, which version of Avisynth are you using?
colinhunt
31st May 2013, 11:26
Please post the complete script you used for this test:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ColorMatrix.dll")
FFVideoSource("X:\HDProRes.mov", threads=1)
Spline36Resize(704,576)
AddBorders(8,0,8,0)
ColorMatrix(mode="Rec.709->Rec.601",Clamp=false)
Also, which version of Avisynth are you using?
It's 2.58, the non-MT one.
Groucho2004
31st May 2013, 11:32
Weird. I don't understand why 18 threads are utilized even though you specified only 1 thread for FFVideoSource.
Anyway, your bottleneck is clearly the decoding. Have you tried with "threads=4" or similar for FFVideoSource?
colinhunt
31st May 2013, 11:42
Anyway, your bottleneck is clearly the decoding. Have you tried with "threads=4" or similar for FFVideoSource?
I'm kinda sick of FFVideoSource because it bloody well re-indexes the 138GB source file *every* time I try to run an encode -- even with a .ffindex file visibly present in the same directory.
As for HCenc multithreading, I tried adding *SMP into HC.ini and reloading the .ini... but looking at "Current HC.ini" in "Settings 1" tab I don't see it there. Oh, hang on, could this be because I'm running the latest beta version, dated 16-06-2011?
colinhunt
31st May 2013, 11:48
I ran AVSMeter again, this time on a FFVideoSource script which had "threads=16":
Frames processed: 373 (0 - 372)
FPS (min | max | average): 20.73 | 23.74 | 21.26
CPU usage (average): 6%
Thread count: 18
Physical Memory usage (peak): 191 MB
Virtual Memory usage (peak): 193 MB
Time (elapsed): 00:00:17.547
And yet it pulls 18 threads out of somewhere on its own. Huh?
But notice how min FPS doubled compared to "threads=1" script, although max FPS remained the same.
Groucho2004
31st May 2013, 11:53
ColorMatrix(mode="Rec.709->Rec.601",Clamp=false)
Your version of ColorMatrix is horribly outdated. The change from bool to int for "Clamp" took place 6 or 7 years ago. That might also explain the strange threading behaviour.
colinhunt
31st May 2013, 12:04
Your version of ColorMatrix is horribly outdated. The change from bool to int for "Clamp" took place 6 or 7 years ago. That might also explain the strange threading behaviour.
Hmm, very possible. I downloaded it from http://avisynth.org/warpenterprises/ and the file is titled colormatrix_20070828.zip. I'll search for a newer one.
OK, found and installed v2.5, changed the script to "clamp=0" and ran it through AVSMeter: no change in FPS and # of threads AVSMeter reports.
Groucho2004
31st May 2013, 12:10
Hmm, very possible. I downloaded it from http://avisynth.org/warpenterprises/ and the file is titled colormatrix_20070828.zip. I'll search for a newer one.
Here. (http://bengal.missouri.edu/~kes25c/)
Just for testing, remove the ColorMatrix line and run AVSMeter again.
colinhunt
31st May 2013, 12:15
Just for testing, remove the ColorMatrix line and run AVSMeter again.
Ran two tests:
1) raised threads to 32: AVSMeter reports 34 threads. FPS and CPU usage remain the same.
2) threads at 32, commented out ColorMatrix line, ran AVSMeter: thread count 33, no change in FPS or CPU usage.
One more: Threads=32, commented out ColorMatrix, Spline36Resize and Padding:
Frames processed: 922 (0 - 921)
FPS (min | max | average): 18.17 | 54.40 | 29.34
CPU usage (average): 4%
Thread count: 33
Physical Memory usage (peak): 272 MB
Virtual Memory usage (peak): 274 MB
Time (elapsed): 00:00:31.429
colinhunt
31st May 2013, 12:20
Script:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\QTSource.dll")
QTInput("X:\HDProRes.mov")
AVSMeter:
Frames processed: 1036 (0 - 1035)
FPS (min | max | average): 11.07 | 93.67 | 30.59
CPU usage (average): 13%
Thread count: 10
Physical Memory usage (peak): 432 MB
Virtual Memory usage (peak): 435 MB
Time (elapsed): 00:00:33.864
Groucho2004
31st May 2013, 12:21
ProRes HD .mov files
Any chance you can cut a sample from that file?
colinhunt
31st May 2013, 12:38
Any chance you can cut a sample from that file?
I'm not allowed, sorry :/ ... but I can create one with exactly same specs this weekend, if that helps any.
colinhunt
2nd June 2013, 10:10
Here's a link to a file with the same codec, bitrate and resolution: http://www.sendspace.com/file/rvmjv8
It's a 1080p24 ProRes HQ .mov file, 7.5 seconds and 151 MB.
Happy testing! ;)
Groucho2004
2nd June 2013, 14:36
Here's a link to a file with the same codec, bitrate and resolution: http://www.sendspace.com/file/rvmjv8
It's a 1080p24 ProRes HQ .mov file, 7.5 seconds and 151 MB.
Happy testing! ;)
I get about 40 FPS with my i5 2500K @ 4GHz, 4 threads, ffms2.
It appears that Quicktime decoding is simply sloooow.
colinhunt
2nd June 2013, 17:11
I get about 40 FPS with my i5 2500K @ 4GHz, 4 threads, ffms2.
It appears that Quicktime decoding is simply sloooow.
Well, ProRes HQ 220, but yes, so it would seem. So who do I approach with a donation to write a much faster decoder?
Quarkboy
8th August 2013, 12:25
Hey everyone, I was wondering if someone could help here although maybe only Hank would know...
I'm trying to compile my own custom matrix.dll for experimental purposes on windows, but it looks like I need the Intel fortran compiler...
I tried using gfortran and made the .dll, but the encoder gives an error saying it can't find the EXTMATRIX function.
Looking into the DLL I realized that gfortran uses different conventions when it comes to function name exports and the exported function was being lowercased to extmatrix...
Does anyone know how to successfully compile a matrix.dll on windows? Maybe I could use C++ or some other language?
manono
8th August 2013, 12:57
What's a Matrix.dll? A quantisation matrix isn't a DLL. The ones in HCEnc are all CQMs. Or am I misunderstanding you? Care to show us the matrix you created? There are already quite a few available in HCEnc.
If you're looking to create custom matrices, maybe LigH's Custom Quantization Matrix Editor will prove useful:
http://forum.doom9.org/showthread.php?p=469040
Or maybe the Rockas Rebuilder Matrix Editor will do:
http://www.jdobbs.com/Pages/Downloads.htm
Quarkboy
8th August 2013, 13:02
What's a Matrix.dll? A quantisation matrix isn't a DLL. The ones in HCEnc are all CQMs. Or am I misunderstanding you? Care to show us the matrix you created? There are already quite a few available in HCEnc.
If you're looking to create custom matrices, maybe LigH's Custom Quantization Matrix Editor will prove useful:
http://forum.doom9.org/showthread.php?p=469040
Or maybe the Rockas Rebuilder Matrix Editor will do:
http://www.jdobbs.com/Pages/Downloads.htm
Read the last pages of hcenc's manual.
There is an option to manipulate the matrices procedurally based on the motion and luminosity per GOP. To do this you need to compile a custom dll. Sample fortran code is provided for this.
manono
8th August 2013, 13:07
Oh, OK then. Sorry.
techreactor
7th September 2013, 10:31
Still investigating but I have to admit my time for it is very scarce ATM :(
MPEG analyser Pro is a pretty old program which I still use to analyse MPEG2 streams.
Development has stopped AFAIK, developer is Jean-Luc Pons, I don't know if it's available for download.
@hank, any updates for HCenc in the planning.
Are you planning to integrate Intel Quick Sync Video (http://www.intel.com/content/www/us/en/architecture-and-technology/quick-sync-video/quick-sync-video-general.html) in HC Enc by using the Intel's Media SDK for its 4th gen processor, Intel claims that by using this, the video creation and conversion is 17x faster since its uses the dedicated media processing which is built right into their processor.
Handbrake started using it (in Beta) and some commercial converters are already on it.
hank315
9th September 2013, 21:53
I've recently started again doing some work on HCenc after not seeing the code for about 2 years.
Until now some small improvements are done.
Things I'm also thinking about:
- 64 bit version
It will improve speed, not because its 64 bit but more 128 registers available to work with.
This will take a while, all hand written assembler code has to updated and optimized.
- 4:4:4 color space
- Update bitrate and VBV control
For some high bitrate encodes this could be better...
- Trellis quantization
The articles I've read about it clearly show a full trellis will be slow as hell, if I ever finish it it will probably be some kind of pseudo-trellis.
And now find some time for it :)
Are you planning to integrate Intel Quick Sync Video in HC Enc by using the Intel's Media SDK for its 4th gen processor, Intel claims that by using this, the video creation and conversion is 17x faster since its uses the dedicated media processing which is built right into their processor.
This isn't easy to use/implement, also don't know if this will really improve performance.
Some dedicated asm code using the latest SIMD SSE/AVX instructions will probably be a better choice for HCenc.
manolito
9th September 2013, 23:36
Hi Hank,
good to see you back after such a long time...:)
I already thought you had abandoned HCenc for good.
HCenc 0.26 Beta is in almost daily use here - I only use it for DVD output, no problems whatsoever (I even hexedited out the 'Beta' from the title bar).
Welcome back!
manolito
Sparktank
10th September 2013, 04:23
Wonderful to see you are well (enough to post). :)
I had wondered about updated instruction sets for AVX.
My current machine I use HCenc on (mostly) has AVX instrcution set but SSE4 (4.2) is used instead.
64bit would make for an interesting update to play with.
Question regarding 64x HCenc: If the input is an AVS script, would the AVS version have to be x64 as well?
techreactor
12th September 2013, 14:01
This isn't easy to use/implement, also don't know if this will really improve performance.
Some dedicated asm code using the latest SIMD SSE/AVX instructions will probably be a better choice for HCenc.
Good to know that some changes are in the offing.
Currently the following converter are using it as per Intel: (http://www.intel.com/content/www/us/en/architecture-and-technology/quick-sync-video/quick-sync-video-consumer.html)
Arcsoft MediaConverter
Arcsoft MediaImpression
Badaboom Media Converter
Corel Digital Studio
CyberLink MediaEspresso
CyberLink PowerDirector
MainConcept
Movavi Video Converter
Roxio Creator
along with freeware's like Mediacode HQ and Handbrake, I personally have not used any of the above commercial softwares but reading the feedback posted by some endusers definitely mention the gains in terms of speed and time. Dvdfab has posted this comparison sheet (http://www.dvdfab.com/intel-quick-sync.htm)on their website.
You are the best judge of what will work better for HCenc.
Sparktank
24th September 2013, 11:02
Might I ask but a humble request for any future considerations?
Request:
If the source is an AVS script, would it be possible to copy the script to the designated *LOGFILE?
It would come in handy when doing multiple samples with different AVS scripting; such as, brightness tweaking, etc.
Fishman0919
3rd October 2013, 05:29
I've recently started again doing some work on HCenc after not seeing the code for about 2 years.
Until now some small improvements are done.
Things I'm also thinking about:
- 64 bit version
It will improve speed, not because its 64 bit but more 128 registers available to work with.
This will take a while, all hand written assembler code has to updated and optimized.
- 4:4:4 color space
- Update bitrate and VBV control
For some high bitrate encodes this could be better...
- Trellis quantization
The articles I've read about it clearly show a full trellis will be slow as hell, if I ever finish it it will probably be some kind of pseudo-trellis.
And now find some time for it :)
This isn't easy to use/implement, also don't know if this will really improve performance.
Some dedicated asm code using the latest SIMD SSE/AVX instructions will probably be a better choice for HCenc.
Oh yeah... nice to see around again.
ChiDragon
13th December 2013, 16:55
All of a sudden I'm getting a crazy Visual Fortran popup window when I try to encode more than 961 frames with HCenc 0.26 beta.
[EDIT: Err. I figured out the issue. The drive I'm writing to ran out of space. Perhaps this could be handled with a more elegant message.]
"Visual Fortran run-time Error
forrtl: severe (27): too many records in I/O statement, unit -5, file
Internal Formatted Write
Image PC Routine Line Source
HCenc.exe 00593B5A Unknown Unknown Unknown
Stack trace terminated abnormally."
Also, HCgui 0.26 crashes upon attempting to open a script whose return value is not a video clip (undefined), rather than rendering an error message.
Example:
BlankClip(30,720,480,"YV12",30000,1001)
X = 0
Sparktank
30th May 2014, 01:32
Is there any simple math to calculate the *LOSSLESS temp file?
I'd like to better guess a better place for it instead of going to largest place (usually USB 2.0 external with at least 500GB free space).
I use anamorphic resolution (NTSC) 704x480.
hank315
4th June 2014, 23:39
The size of the lossless file can't be calculated exactly, the size is variable, it depends on the compressibility of the source.
In your case (YV12 color space):
each plane:
704 x 480 = 337920 bytes (Y plane)
2 x 352 x 240 = 168960 bytes (UV planes)
total per plane: 506880 bytes
per minute:
23.976 x 60 x 506880 = 730 MB
Each frame is compressed, average compression: 40 - 50%, so per minute the file size will be approx. 330 MB.
Sparktank
5th June 2014, 00:37
Thank you, this should be plenty enough to work with.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.