Log in

View Full Version : QTSource, YV12 -> RGB, Luma Scaling - Help


Yellow_
25th April 2010, 15:12
Hi

New camera, new agro. :-) h264 AVC in Quicktime, Canon T2i/550D

I need to use h264 AVC video sources with a compositor that only handles RGB. Last camera I was doing this with was HDV mpeg2 and successfully did it without luma scaling using VDubMod, AVISynth ConvertToRGB and PC.709, save as image seq or uncompressed AVI.

I'm doing the same process now for the AVC QT's using Apples latest version of QT on Win XP. I'm using QTSource.dll (v. 0.0.8 from the authors site dated about 2007) and convert with PC.709.

I export as .png image seq's via Vdub 1.9.8, a few frames at first as a check.

I check them in ImageJ for the numeric histogram list it gives and The Gimp for it's histogram and Colour Cube Analysis.

I don't really consider this pixel peeping, I'm trying to maintain the quality of the 8bit sources with emphasis on grading later, not playback.

Here's the problem:

I'm getting scaled luma, evident by the clear, equally spaced gaps across the histogram in the Gimp. But the ImageJ histogram numeric list shows values from 10 to 255, suggesting there has been no luma scaling.

But doing a colour cube analysis in The Gimp on the png shows I have about 60000 unique colours, typical of the sort of values from using FFMPEG. Which I refuse to put near my camera sources.

Now if I do the same process using Avidemux, which reads the QT AVC in and I save it as YV12 Raw AVI and do the ConvertToRGB AVIsynth process I get no scaling, no gaps in the histogram and about 130000 unique colours, double that of the QTSource route.

This is not unusual, my HDV sources converted 'correctly' ie no scaling would yield 130000 ish unique colours per 1920x1080 frame .png. If I put FFMPEG anywhere near this process even for YUV->YUV conversions I'd loose half the unique colours.

So back to QTSource problem, what I think is happening is a 16 - 235 to 0 - 255 luma scaling and then a second luma scaling back to YV12 sort of levels. Giving me gaps in the histogram that shouldn't be there.

Does QTSource (QTInput) do anything here? Or just get the frames from QT. Is it getting them via the Player? Could that do a YV12 to RGB conversion before AVISynth gets it?

Other question, I can't find much info on Avidemux YV12 RAW format, should I use this and forget the whole QTSource route? Bearing in mind I'm looking for the best quality conversion I can having to go from YV12 to RGB.

Also why does FFMPEG make what appears to be such a poor job of YUV->YUV conversions with regard to reduced unique colours? Giving half what I get avoiding it. :-)

I'm a noob to all this so I may well have totally got it wrong. Feel free to tell me the Gimps Colour Cube Analysis is pointless, that I'm wasting my time. Gotta learn some how. :-)

Blue_MiSfit
25th April 2010, 22:48
Don't use QTInput to load H.264 in an MOV container. I've had lots of issues with scaled luma values when working with MJPG and ProRes sources.

I'd suggest remuxing your MOV to an MKV, and using DSS2 or FFMS2 to open it. This will give you untouched YV12 in AviSynth.

Is your source TV or PC levels? If it's TV, I suggest using the following:


DSS2("movie.mkv")
ConvertToRGB32(matrix="rec.709")


change the matrix to pc.709 if your source is actually pc range. If you want to scale (smoothly) before the conversion, add this:


SmoothLevels(preset="tv2pc")


though... you probably shouldn't have to.

~MiSfit

Yellow_
26th April 2010, 00:31
Blue_MiSfit, thanks for the info. I'll avoid QTInput if that's where the luma scaling problem is.

Remuxing to mkv, is there an advantage over using an .avi with YV12 raw out of Avidemux? Although it does mkv as well.

**EDIT** Read up on AVI limitations and matroska to solve those problems. Also see that YV12 Raw out of Avidemux is not Windows compatible. As I'm doing all this on Linux + Wine.

For batch conversion type situations what CLI tool would you suggest?