Hitfilm and Cineform. What's it actually doing with the colour space?

PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast
edited April 2019 in General

This is really a question for @NormanPCN as he knows these things.

Cineform files apparently have a flag that indicates Video (16-235) or Full (0-255) range for the colours.

DaVinci Resolve "messes it up" slightly, or at least if I export  a clip that's using the Full range of 0-255 in Auto from Resolve and load into Hitfilm: it's been "double Fulled" and is very high contrast with the white and blacks truncated in the Histogram; whereas if I manually select Full or Video, it's correct for either range and Full just tops out at the top and bottom of the range, as it should.

To Hitfilm.... If I load in, stabilise and export a Cineform file  to Hitfilm - originally exported from Vegas - it's got less contrast when played in Media Player and also when loaded back into Vegas, so it's taken what was Full and made it Video.

If I load the two files into Vegas, they're clearly different, but if I load them into Hitfilm and mask half of one of them, put them on separate layers and put the scopes on them: they're both identical: Full again. So is Hitfilm not checking the flag?

So...how do I stop Hitfilm from mangling the output and compressing the colour space, which I then have to restretch in Vegas, when all I'm doing is a Replace Media on some stabilised footage?

And what is Hitfilm doing that it ignores the colour space 'flag' and treats everything as Full, when that's not always the case, but then exports everything as Video? I'm trying to use the least mangleable format that Hitfilm can deal with to pass between Hitfilm, Resolve and Vegas, but it's not making it easy.

As Hitfilm doesn't have the Selection Option on Export (or input, for that matter) for Full or Video range for Cineform files that Resolve has, is there anywhere in the clip's header that I can manually poke/hex edit so that Vegas (or Media Player) doesn't think it needs to compress it to Video?

Although that depends on the answer to the next question, which is: Is the colour space really compressed?  Or are the Cineform wavelets just modified in some way on import and it's stored in a "colour space agnostic" format?

Comments

  • NormanPCNNormanPCN Website User Posts: 3,945 Enthusiast
    edited April 2019

    Some years ago I noticed that Cineform apparently does have a range flag. The Cineform VfW encoder showed something like that. The Vegas native did not offer it. Hitfilm does not offer it.

    "So...how do I stop Hitfilm from mangling the output and compressing the colour space"

    You can't.

    With apps like Vegas 100% of the levels decisions are up to the user. It does nothing to the data on input and does nothing to data on output. Weather or not that is "correct" is entirely up to the user. They are supposed to know what they have for input, what they are supposed to have on edit and what the output is supposed to be. Make adjustments as necessary. 

    Hitfilm tries to hide the whole levels mess from its users. Kinda the polar opposite of other(s). It promotes media levels to full range on input. Well, we do get some option to select levels on input of AVC these days. It's output is always video levels. There are exceptions. Image sequences stay full range on output. They are what they are on input. Image files are outside the fray of video and Hitfilm seems to leave that alone. There is some confusion, and maybe inconsistency, with respect to the intermediate formats and Hitfilm. Native Cineform being one where Hitfilm does the whole levels compression on output.

    I have a levels test project with various media with video and full range levels encoded, with range flags when available,  to test clipping of Hitfilm input. I mostly duped the project in Vegas for comparison. I've not looked at this is years.

     

  • Triem23Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 18,267 Ambassador
    edited April 2019

    I'm just gonna tag in @DannyDev because this thread is going to eventually generate some Wishlist requests. I'll add more input after work, but I gotta get driving now. 

  • PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast
    edited April 2019

    @NormanPCN OK, you saying Hitfilm always tries to expand to Full might explain my results slightly and Hitfilm is reading the flag.

    If the Flag can be Video, Full or ??? and not simply 1 or 0, then when I load in Video, it expands to Full, when I load in Full, it leaves it alone - so both look the same on the scopes -  and when I load in Auto, or ???, that was actually Full, it guessing - wrongly - that it's Video and expands it to Full x2.

    So, for the Wishlist: we need overrides on input (" Hitfilm says it's this. Agree or Change?" ) and Selections on output, so I can actually get the Full I want.

    The same as we've needed for variable FPS footage. Or at least it saying "I've guessed it's this FPS, if wrong, go and Conform it elsewhere and try again"

  • AramMAramM Website User Posts: 154 Enthusiast

    Let me add that some cameras do a hybrid 16-255 (some Sony cameras at least), so being able to select that option would be great.

  • NormanPCNNormanPCN Website User Posts: 3,945 Enthusiast

    Hitfilm has overrides on video levels for AVC media. Auto, Studio, Full and Superwhites. That is not offered for any other codec AFAIK. Many/most codec data streams cannot identify full/studio.

    With Apps like Vegas sending media to apps like Hitfilm you have to be careful. Vegas will happily encode full range data into a file and mark the file as studio levels. Most common with AVC media output. AVC media supports such a full/studio flag.

    Vegas will do it with other codecs like Cineform/DNx. In such a situation the data is already full and Hitfilm will do another expansion on load. Heck, I've used Vegas to create files for testing. Files with full range data when studio is expected.

    As stated Vegas requires you to know everything about your input and what levels the output encoder expects. Vegas does not document what the encoder expects worth a ****. These things are usually learned by... a why is this messed up question, and then you learn why, and then make adjustments. Been there. Done that.

    I kinda like that Hitfilm tries to hide the abomination that is video levels in the digital world. What I would prefer is that Hitfilm keep such behavior, AKA "auto", and allow us to override the that will a setting. All input, and all output.

  • PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast

    How the heck in this era of dealing with video files is all this still such an omnishambles by all parties involved?

    If something is undefined in the "standard", why don't programs provide overrides for their "guesses"? :(


  • PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast
    edited April 2019

    I've been struggling with some clipped whites on UHD MP4 files in Hitfilm, which I thought was weird, until I installed the Demo of ColorFast2 to have a consistent RGB parade in both Hitfilm and Vegas and...of course: Hitfilm's clipping the whites. The same whites that Vegas did not clip.

    MP4 loaded into Vegas.
    https://oi854.photobucket.com/albums/ab106/pickaname2/Vegas Parade.jpg
    MP4 loaded into Hitfilm.
    https://oi854.photobucket.com/albums/ab106/pickaname2/Hitfilm Parade.jpg

    I can't get those whites back. So I tried exporting from Vegas as Cineform AVI and loading that into Hitfilm. No Clipping. Yay!
    Exported from Hitfilm and loaded back into Vegas and... the colours are compressed (Full>Video) and it's lacking in contrast.

    But, are they really compressed? Yes, they are. Because the same file loaded back into Hitfilm is automatically stretched back out from Video>Full and now the Histogram is full of notches. So less actual colours, more banding on skies etc.

    It looks like, that in order to prevent Hitfilm making arbitrary, hidden, destructive, changes to everything I try it with, I'll have to resort to PNG sequences if I'm going to use it for anything at all.

    So yes, Wishlists for "Leave the **** colours alone!" switches would be very useful for anyone who would like to have any sort of control over the input and export of their files.

    AVI from Vegas, into Hitfilm.
    https://oi854.photobucket.com/albums/ab106/pickaname2/Orig AVI.jpg

    That AVI exported from Hitfilm and loaded into Vegas. Less contrast, Full>Video levels applied automatically.
    https://oi854.photobucket.com/albums/ab106/pickaname2/Hitfilm to Vegas.jpg

    Same file loaded directly back into Hitfilm. Automatically expanded from Video>Full, but with gaps in colours.
    https://oi854.photobucket.com/albums/ab106/pickaname2/Hitfilmed AVI.jpg

    Original Parade in Vegas
    https://oi854.photobucket.com/albums/ab106/pickaname2/OrigVegas.jpg

    After Hitfilm has Compressed it and Levels Video>Full applied in Vegas to correct the contrast (Same as Hitfilm does automatically to it's own compressed exports when reimported)
    https://oi854.photobucket.com/albums/ab106/pickaname2/ReexpandedVegas.jpg

  • PalaconoPalacono Website User, HitFilm Beta Tester Posts: 3,442 Enthusiast
    edited April 2019

     Anyone able to comment on this being a bug, expected behaviour - in which case: document what it's doing, so we can work around it without having to test every possible format -  or going to change, ever?

    I'm currently reduced to exporting JPGs between Hitfilm and Vegas, as they stay the same throughout (initially exported from Vegas, as Hitfilm messes up the original .MP4 Levels on import).

    The bonus, to offset the huge storage increase is: faster forward and backwards scrubbing in both, and mocha positively flies along, but's it's all a bit of a faff when I could also use Cineform, if the levels stayed consistent throughout and Hitfilm didn't blow out the highlights when I import my MP4s.

    This must be affecting everyone with everything they import and export, so how does anyone do any consistent colour correction?

    @Triem23 @DannyDev @CedricBonnier

Sign In or Register to comment.