Contents:
Direct YUY2 handling with CinemaCraft Encoder
Field Threshold
Full Size Output Buffer
New Configuration Dialog
Installation
Now CCE did two things wrong with Huffyuv: It called a unimplemented function to check if Huffyuv could handle the YUY2 output format. And it gave a negative height in the info structure.
Wanton (thanks guy!) implemented the missing function and did some quick hack to return success on the query, regardless of the wanted output format. This way the whole thing worked with CCE but stopped working with almost any other application.
I used this hack and started to fire up the debugger. After a while it was clear that CCE wanted a bottom-up bitmap - not a top-down bitmap as given in the request info!
I followed the original Huffyuv development scheme and added a 3rd application flag. The "ignore-top-down-request" flag is activated when Huffyuv encounters an application called ccesp.exe or ccespt.exe. If enabled, Huffyuv will convert any negative height to its absolute value and use it througout the whole decompression. Enable the debug output window to see this.
If the "always suggest rgb output format" switch is disabled, Huffyuv and CCE will now use YUY2 encoded frames,
thus avoiding the
Note: CCE is so buggy (or smart?) that it requests YUY2 for the advanced configuration and the cut/add avi
dialog, too. Of course it gets what it wants but is then unable to display it. So if you need to use these,
please enable the "always suggest rgb output format" checkbox.
Of couse you should disable it again when you are going to do your 9-pass encode ;)
UPDATE: You can leave the "always suggest rgb output format" checkbox enabled!
If you do, CCE will still use YUY2 for encoding but RGB for all the dialogs, thus making everthing perfect!
(You have to disable YUV decoding in CCE - under Options -> Misc to use RGB instead of YUY2 for encoding
with Huffyuv from now on. I wonder who could possibly think about disabling that ;).
Lemme say this again: It does not matter if you enable or disable the "always suggest rgb output format" checkbox in the Huffyuv configuration dialog! Huffyuv and CCE will always use YUY2 for encoding but fall back to RGB for CCE dialogs that display video if the "always rgb output format" checkbox is on!
NOTE:I thought I might add a warning at this point: don't use YUV encoded AVI files in tv color-range and CCE (affected: v2.62, untested: 2.50). Even if you set 0-255 for lumiance level it will squeeze it to 16-235. You will notice that in your final encode anyway. Please use pc color-range in your AVI-file and 16-235 "squeeze" in CCE.
I simply added another entry in huffyu.ini and added a way to edit it in the configuration dialog.
If you're processing NTSC video, you should set it to 240, so that material with more than 240 lines will use
interlaced compression. For PAL the original value of 288 is right.
If you are doing progressive material, setting it to 480 or 576 lines will compress even video at this resolution
progressive. This should result in better compression.
Warning: There is only this global setting, Huffyuv does not store this setting in the individual
avi-files!
See VirtualDub Knowledge Base -
PRB: Access violation when capturing with Huffyuv video codec for further information.
I added another entry to huffyuv.ini and a checkbox in the config dialog.
The default is enabled (at least until I find out if it impacts performance somehow).
UPDATE: This is a quote from stuff I found on the net:
Field Threshold
When I added the YUY2 stuff described above, I discovered a hardcoded threshold that will trigger progressive
or field based compression. Something that was not acceptable, as
You can change the value to any number between 1 and 16384.
Decoding a video with 480 lines, compressed interlaced with a 288 threshold after setting a new threshold
of 480 lines will fail and vice versa!
Full Size Output Buffer
Original Huffyuv has a fatal flaw that might lead to crashes due to buffer overflows.
I knew this before but I always have been to tired to actually understand the code segment.
Until lately when I had a bright day ;)
If you experience the error described in the VirtualDub Knowledge Base, enable this option.
(As I own a license of that program, I could try it myself, but as usual I am a lazy ass. ;)