Made the decision to finally fix the chromakey HSV plugin.  Like most contributions, it was unfinished & didn't work.  Contributors all tend to submit partial code as feature requests & expect someone else to finish their work.  Young lion invested a lot of effort porting it to OpenGL but assumed the algorithm worked.

Chromakey was 1 of the things video editors just are supposed to do, whether or not lions ever used it.  There was once a belief lions would have enough money to have a larger space with a movie studio area, but it never happened so chroma keying never got used.  Nowadays, contour algorithms arguably do a better job than chroma keys.

Chroma keying is the bread & butter of some gootubers but usually gives way to practical views in order to show how rich they are.  You'd think chroma keying would be everywhere on the tube but gootubers spend a lot of money to show they live in a certain place & go to certain places.  Gootubers ended up being very location based.

The original Broadcast 2000 had a HSV based chroma keyer.  Lions got better results using RGB & the Gimp always used RGB.  Eventually, there were claims in the industry that HSV did a better job. 

https://resources.avid.com/SupportFiles/attach/Symphony_Effects_and_CC_Guide_v5.5.pdf

 page 691

The key development in fixing the chromakey HSV was the AVID document for the Spectra Matte. That showed how to use a color swatch to test it, revealing how the paramaters defined a wedge.  There was no way to test chroma key without a color swatch plugin.  That ended 25 years of grief.

The trick with the HSV plugin is it has to combine the contributions of hue, saturation, & value to a final alpha value.  In the RGB plugin, it used the hypotenuse in a color cube.  In the HSV plugin, it was using the maximum alpha of all 3 channels.


It's possible that the spill light control needs to factor in saturation & value instead of just hue.  As written, it just created a wedge of desaturation based on hue.  Knowing what to do without having the Avid plugin, a test user base, or some kind of test footage is impossible.  There is limited test footage on the tube.

If the spill light is supposed to be the color that it's trying to mask, it should be defined by the full color cube.  Helas, there are many differences between Cinelerra & the original Avid implementation.  It's not clear if the differences really matter.  Avid bases the spill control on saturation + hue but not brightness.  They start the point of the wedge on the saturation level.  There was no way to get all this right before the color swatch.

It might be easier to have the user drag 4 corners of a wedge on a color swatch instead of manipulating sliders, but this is a very rarely used plugin. 




HSV chroma key


RGB chroma key




Lions would agree the HSV chroma key does a much better job with this test footage.  The spill light compensation is a win.  The RGB chroma key couldn't cope with the uneven background but it might be useful for luma keying or CGI.

The color swatch also revealed problems with the RGB chroma keyer, manely the value computation wasn't working.  It seems the luma from YUV mixing is not useful in chroma keying.  The HSV value is the maximum of the 3 channels while the value in YUV is a scaling of the 3 channels.  The YUV value is more useful in converting to greyscale.




It should be making blobs in chroma mode & donuts in value mode.  Navigating a color cube using the swatch is a trippy experience.

Testing chroma keying was another moment when lions considered dropping YUV support.  Stuff like this is always going to be in RGBA float to get the most precision.  There's no speed impact in OpenGL.  Both float & YUV run at 10fps in software mode.  YUV has just been a pain in the mane.

https://growmane.blogspot.com/2022/08/destined-to-be-1-of-great-movies.html

The last note about dropping a colorspace was in 2022 right before a lot of stuff was moved to OpenGL.  For high speed playback, it originally byte shuffled ffmpeg to YUV888 in software & then to BGR8888 in OpenGL.  YUV888 was necessary as a common file ingesting format.  The last note goog can find is that use case.

The file readers now go straight from ffmpeg to OpenGL with no software byte shuffling.  A way was found to read planar colormodels in the GPU.  The 4k titanic stress test goes at 60fps in YUV888 or RGBA8888.  YUV888 now only exists for software mode or effects which only work in software & keep YUV intact.    The lion kingdom is the only user of the OpenGL mode while everyone else is using software only, so YUV is definitely still needed.

Histogram only uses RGB so it doesn't need YUV888. No visualizers need YUV.  Motion tracking keeps YUV intact & definitely isn't usable in RGB float.  That might be the only one using YUV.

--------------------------------------------------------------------------------------------------------------------------

All the openGl routines should be RGBA float only.  In a pure OpenGL pipeline, there's always a colorspace conversion when the file is read.  It calls Playback3D::convert_cmodel since no file uses the intermediate colorspace.  OpenGL only needed other colormodels when the colorspace conversion was in software.

There would be some mangling of all the opengl routines to only handle RGBA.  Whether to keep the alpha multiplies for RGB mode would need some testing.  Titler would be difficult, since it shares a software renderer with the opengl pipeline.

The only case where overhead would increase is a pipeline that starts in software mode.   That still uses a software converter to read from the file.  It would need a VFrame::to_texture + VFrame::draw_texture to ingest it in the GPU where previously it just needed VFrame::to_texture. That is such a slow case, it might not care about an extra VFrame::draw_texture.

Conversion of the openGL routines to just RGBA would be the realization of the original vision of Broadcast 2000.  That assumed confusers would be fast enough to just support RGBA.

-------------------------------------------------------------------------------------------------------------------

An extra memcpy could be avoided if filefork mode was a runtime option.  It has to copy from ffmpeg's private frame buffer to a shared memory buffer before ingesting it into GPU memory.  The mane application could be 8k playback. 

Other file readers decode directly into the shared memory & don't need a memcpy to use fork mode.  They wouldn't benefit from a runtime option.

  The number of different pathways being used to achieve the most optimized playback is another example of how advanced something with no monetary value can be.


----------------------------------------------------------------------------------------------------------------

https://www.sfgate.com/centralcoast/article/santa-barbara-upscale-mall-affordable-housing-18611547.php

Wealthy California town converting a dying mall to solve its housing crisis

Outdoor mall the lion kingdom went to many decades ago is being turned into a housing development.  No doubt low income & over 55 only.  They're not building any more market rate apartments in Calif*.  The mall architect also designed the HFAC. 

It was the best of times & the worst of times.

----------------------------------------------------------------------------------------------------------------


It was a seminal moment when the lion kingdom saw that in a magazine.  It was amazing how such convincing alternate realities were created by such low cost methods. 










Comments

Popular posts from this blog