Log in

View Full Version : Understanding Color settings


osgZach
16th October 2013, 03:29
Hi,

I'm just trying to make sure I am avoiding unnecessary color space conversions, so I was wondering what might factor in to that with my workflow.

Currently, I use Virtualdub with a DirectShow input filter to allow me to open files as I please, but this is mostly to work with Blu-Ray sources and filter them through Neat Video to do some minor cleanup.

Neat Video works in RGB, so what I have been doing is adding a Convert filter in the chain after it, and then outputting to a lossless intermediate to encode later.

For the intermediate I am using UT Codec's YUV420 BT.709 selection as the compression format. But then I noticed in Vdubs log the Decompressor/Compressor format was listed as RGB888 which puzzled me.

Then I remembered I have always left Vdubs color settings to automatic, with the output using the input format.. So I changed the Compressor output to YV12 4:2:0 but this also begs the question, was Vdub applying a YV12 conversion in the filter chain, then converting back to RGB888 anyway and thus UT codec perform its own conversion to YV12 upon compression?

I am under the impression this was the case as loading up the intermediate with Avisynth's Info() says the intermediate is indeed YV12; so I am worried that I am introducing erroneous color space conversions into my workflow..

I'm also curious if I can leave the conversion filter out of the chain if I am setting the compressor output to YV12 anyway? Or just not worry about it because UT Codec will convert the format if it decides it is not correct anyway?

If anyone can assuage my confusion it would be appreciated.

raffriff42
16th October 2013, 06:57
I ran a test with two sources - first, an Avisynth script with YV12 output: Beginning dub operation.
[i] Dub: Input (decompression) format is: YUV420.
[i] Dub: Output (compression) format is: YUV420.
Ending operation.Then a Fraps (YUV mode) AVI: Beginning dub operation.
[i] Dub: Input (decompression) format is: RGB888.
[i] Dub: Output (compression) format is: YUV420.
Ending operation.The color model actually output to Virtualdub does not always match the MediaInfo report - it depends on the VfW or DirectShow decompressor. V-dub's Avi info box sometimes tells you what the incoming color format is, but I suggest this method: Video menu, full processing mode. Load the source file.
Video menu, Color Depth, select Input=auto (the default); don't care about Output at this time.
Filters menu, check "show image formats."
Add a Null processing filter in first (topmost) position and Enable it.
You will see an indication of the color model as seen by VirtualDub ("RGB32," "YUV420," etc)
If this is not correct or what you expected, try a different input plugin. I suggest the FFmpeg input driver (http://forums.virtualdub.org/index.php?act=ST&f=7&t=20025).
(EDIT - doom9.org link and discussion here (http://forum.doom9.org/showthread.php?t=165218))

The other neat thing about the filter box's "image format" indicators is that they helpfully tell you when any filter does automatic color format conversion - something to be avoided, unless it's really required.

osgZach
16th October 2013, 15:24
I think I tried FFinput in the past, but I had issues either with slow file seeking, or that + it causing issues and/or crashes..
This is bad because I need to be able to seek freely and as quickly as possible when using Neat Video as I am building a noise profile based on sampling points from dozens of frames.
I may decide to try it again at some point though.. Maybe it has improved (I see it appears to be actively worked on)

But FWIW with the DirectShow plugin, opening source .MTS and using a null filter shows it as incoming RGB24.

Something else that confused me is, in my video chain Neatvideo is listed as RGB32 output, but when I put a YV12 convert filter after it, both the Input and Output read as YV12, whereas I would have exptected to see In:RGB32 -> Out: YV12. But I assume that is just how that looks.

At the end of the day I am assuming I just need to set YV12 as the default compressor output under Color Depth when I am working to output such files..

My files are certainly turning out beautifully in any case.

edit: I did give FFinput a try and it imports the video properly as YV12, and does seem a bit faster than the Dshow plugin. The only problem is it locks up while making random seeks, which I unfortunately need to do, to use my Neat Video filter.