Pardon my ignorance, but I just got the latest svn of kdenlive from the ubuntu repository and I now have a tab that is called vectorscope and I was wondering what it does.
Thanks,
Lexen
Pardon my ignorance, but I just got the latest svn of kdenlive from the ubuntu repository and I now have a tab that is called vectorscope and I was wondering what it does.
Thanks,
Lexen
Hi Lexen,
In the current SVN version there are 4 new tabs. They are basically all used for color correction.
The Vectorscope is mainly used for two things:

The way the vectorscope works is maybe new for most. Black is in the middle, but so is white. Actually everything with no saturation (all greys as well). The further away a point from the center, the higher its saturation. Independant of its brightness. The angle defines its color; Top left is red, right is blue, bottom left is green. You can put a sample YUV plane on the background for illustration.
There are two points for every color; one for 100% saturation and one for 75%. Colors in videos for broadcast must not, as far as I know, exceed the 75% marks (See links at the end why.). But you may want to be as close to them as possible to get well saturated colors. By right-clicking on the scope you can also display a 75% polygone.
This won't be of importance for most of us though :) And at the moment I don't guarantee for 100% correctness.
In the image above I've shot a neon lamp at 5500 K, so it is not white but, yes, what? You can see it in the Scope. This can be corrected with e.g. curves or 3 point color correction. Latter could be improved to show 3 wheels with YUV background, so you just need to put the color selector in the same direction as the scope shows to remove the color cast.
Gain is used to zoom in, allowing very precise corrections.
The vectorscope is using the YUV color space.
Next is the Waveform Monitor. This is a cool one because it may look very crazy. What it does is basically taking the first column of pixels of the input image, calculate the Luminance of every pixel, and then plot it on the waveform, also in the first column. Same for the second column etc. So if you have a 720p input, there will be 720 pixels in the first column of the Waveform as well. The Waveform is used if you want to

For example, in the image above the luminance never reaches 0, so it could be stretched (e.g. with the Curves filter) to go from 0 to 255.
Next, the RGB Parade. This is basically the same as the Waveform, but it shows the RGB channels separately. It also displays the min/max values (what the waveform is not doing yet). Here you can see that the Blue channel does indeed spread the entire range of 0-255, but as blue is only weighed 11% when calculating the Luminance, and both Red and Green start at 6 and 8, respectively, the Waveform does not show as much as the RGB parade. Which can be used to
Which means that it is pretty mighty. Detecting the color of color casts is easier in the Vectorscope however. Imho :) Clipping happens if a color component (R/G/B) reaches the maximum brightness value (255 for 8-bit input) and would actually be even higher if it could. But it cannot, which results in loss of information (which you want to preserve as long as possible).

In the above image the parade shows that in the left part of the image blue is quite low, and there are bright spots on the right with more blue (which is the sky).
Here another image of the neon video, showing how the RGB parade exposes color casts.

Last thing is Histogram, previously called Levels here but renamed now, something most will be familiar with, as pretty every image editing program can show these too.

What it does is just statistics. For R, it counts how many pixels have an R value of 0, how many have an R value of 1, of 2, etc., until 255. This leads to the graph above. The vertical bars visible there is not a fault of kdenlive but of the camera; I don't know what exactly it is doing there, perhaps some preprocessing I forgot to switch off. It does not show up on all videos.
As Waveform, it can be used for
More on Wikipedia:
Further Reading: e.g. Color Correction for Video also on google books
In all scopes, you can enable Auto-Refresh (via right-click), causing the scope to be refreshed for every incoming frame. Realtime makes the calculations faster but less accurate. And at the moment it is not working perfectly because it will make the monitor play faster.
Simon
Disclaimer: No guarantee for correctness, already past midnight.
Just bumped into this thread, great to see some scopes being created for kdenlive.
Are your scope examples just straight video imports into kdenlive or have you applied any effects to them?
These are direct imports from my Nikon D90.
D90, by that I guess you mean video from D90? mjpeg?
Stream #0.0: Video: mjpeg, yuvj422p, 1280x720, 24 tbr, 24 tbn, 24 tbc
Stream #0.1: Audio: pcm_s16le, 11025 Hz, 1 channels, s16, 176 kb/s
;)
Why do you ask?
Looking at the scopes, which are great btw. :-) It's clear that something is not right, the gaps in the histogram, the clipped highlights and blacks suggests either the Yxxx to RGB conversion method used for the scopes is stretching the levels or kdenlive is.
If the video in your example has had no filters / effects added then the scopes should reflect the levels within the source video files, there would be no stretching of levels.
In reality, if one was to encode back out to a Yxxx video space, without applying any filters or effects the source levels should remain as input? but I don't think the scopes show source levels.
Is FFmpeg being used to do the Yxxx to RGB conversion for the scopes, if so then that would explain the stretching, swscale is bad at doing the Yxxx to RGB conversion with regard to NLE use.
However, what would be worse is if kdenlive does the same stretched conversion when it applies effects like the Frie0r plugins which work in RGB and at 8bit not 32bit float precision too I believe.
Great scopes though. :-)
Take a look at this discussion on kdenlive-devel:
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTim4QJy6Uc...
You might want to point out your doubts on libswscale color space conversion quality there.
It might just be that a 256 level histogram is drawn to more than 256 pixels wide, causing the gaps in the drawing, even when there are none in the video?
Scaling the Histogram sadly (would be better than loosing color information ;)) does not create any gaps. They are caused by some RGB -> YUV or vice versa conversions. You can also right click in the Histogram and check "Unscaled" to make sure scaling is not the problem.
@yellow Thanks :)
It seems you know the ffmpeg internals regarding color spaces quite well?
At the moment I'm receiving RGB images from mlt. No filter was applied to the scope above. So I guess it is no stretching but simply the loss of information of the color space conversion.
And yes, everything is working with 8bit at the moment. Unfortunately. Would be great with 32bit.
The original footage is available here: http://kdenlive.org/video-editor/nikon-d90
Interesting is, though, that e.g. 8:17 shows no gaps, but 8:18 does. 8:21-23 neither. Can you confirm that? Because that is weird.
Granjow
Ok, this is interesting but, what's the practical use for a desktop purpose?
What are the advantages of these features on kdenlive?
Thanks :)
I was thinking about the cause of the histogram gaps, and I think I found a very probable answer: it is the MPEG quantization.
If you get your hands on some uncompressed video, try that.
(maybe here is something useful: ftp://ftp.crc.ca/crc/vqeg/TestSequences/)
Recently got back from vacation, Granjow, just looking at the D90 files now.
Marko, I don't think it's mpeg quantization, I have a lot of HD HDV mpeg2 and HDSLR mpeg4 (h264AVC) and see no gaps in the histogram in other editors. But then this is mjpeg.
**EDIT**
Looked at the berries shot, did a Yxxx to RGB conversion using AVISynth and I wonder if changes have been made to the histogram scope as I see no gaps in the histogram using the latest kdenlive-svn build. So AVISynth and kdenlive-svn conversion to RGB look very close apart from the kdenlive histogram having a very combed appearance compared to AVISynth which I put down to 8bit rounding errors compared to 32bit in AVISynth and that the kdenlive RGB frame has half the unique colour information compared to AVISynth version.
Both attached are frame 210[8:18]
Yeah, I forgot that the MPEG quantization is done in frequency space, so it gets somewhat masked in the IDCT.
This morning I made a commit in mlt git to add certain swscale flags that removes the gaps or banding that we were seeing above. Please give it a test.
Will test, could you give a bit more info on the flags and how the gaps/banding are removed? Can't find it in the commit logs or kdenlive CIA.
You cannot find anything in Kdenlive logs because the change took place in MLT the NLE framework Kdenlive is based on.
Have a look at this commit diff:
http://mltframework.org/gitweb/mlt.git?p=mltframework.org/mlt.git;a=comm...
And this log in general:
http://mltframework.org/gitweb/mlt.git
Slaps head, duh! It was late when I posted. :-)
Thanks for the links, altough I have no experience of such things, it looks like changes to improve the accuracy of the conversion calculations to reduce rounding errors and a slightly better interpolation.
I guess this is about speed of response on the timeline for playback and particularly when adding effects and transitions versus a 'better' or 'best' conversion to RGB and holding onto more data? A balance between costly calculations in time(depending on CPU/GPU power) versus what might be invisible loss to the eye?
Does Yxxx use less resources than RGB? Obviously RGB playback in the media player on a PC, through an LCD TV screen or projector?
Out of interest why not convert to RGB at import doing a 'best' conversion then go back to Yxxx at encode out (generally) and all the calculations of effects in between, which I guess are done in RGB space, done on best conversion from original Yxxx camera files?
I'd think it very rare for anyone to want to just edit and encode out staying Yxxx, if that's at all possible?. I'd assume a fully fledged NLE would be all about adding effects, colour correction, grading, transitions etc that are all done in RGB space or is it a back and forth from Yxxx to RGB to Yxxx each time an effect is added?
Is there other performace hits with regard to just doing a conversion to RGB at inport?
Sorry for the questions, not meant as argumentative. :-)
Ok, compiled kdenlive from svn and tested with same frame [210].
A lot of combing in kdenlive, is this is just the histogram code or kdenlives Yxxx to RGB conversion?
But good news (I think?) is a far higher unique colour count in Gimp, nearly the same count / colour fidelity as I get from AVISynth doing a full range conversion. But whether the Gimps tool is anything to go by in determining quality of conversion I'm unsure. Also the frame I extracted from kdenlive to test was via the 'Extract Frame' menu item. Does that frame capture method use the same conversion code?
Finally another thought, does kdenlive handle the full range [0 - 255] of Yxxx data in the conversion to RGB and leave the levels alone, passing them through or just 16 - 235 Yxxx expanded to 0 - 255 RGB then squeezed back again?
Dear Yellow,
I assume you are the author of the http://blendervse.wordpress.com/ blog?
I am working on improving color handling in MLT, and its usage of swscale. Thank you for your testing and feedback.
Re: does kdenlive handle the full range [0 - 255] of Yxxx data in the conversion to RGB and leave the levels alone, passing them through or just 16 - 235 Yxxx expanded to 0 - 255 RGB then squeezed back again?
Currently, it is scaling to and from full range RGB. Part of the reason for this is because it wants to accept full range RGB sources like rendered image sequences and digital photos and keep them compliant with ITU Rec 601 (and eventually 709) YCbCr broadcast limits when converted. Another major application of MLT is for video playout server via SDI and ASI at television broadcasters. Also, the color space converter does not know if RGB is full range or not, and depending on filters used, color space of source and output, it might have to do multiple conversions, so the conversions do need to be symmetrical.
Also, you should know that currently all YCbCr conversions are done according to ITU Rec 601, and not yet 709. However, I have been studying this, and I will be adding some things to MLT like new image types that indicate RGB gamut and YCbCr transfer function. Also, some source plugins will be modified to default to one or another based on heuristics like spatial resolution to guess at the correct YCbCr transfer as well as accept an override parameter. Finally, I will also need to add a color space to the profile to choose Rec 601 vs 709. Of course, this will take a little time, but I expect it to be done by end-of-year.
Dan
re blog, Yes, that's me.
Thank you for your time replying. Great news, on the MLT developments and progress.
Dan, regarding kdenlive converting HD sources using BT601 and contrast stretching, you mentioned that hopefully this will be addressed, earliest end of year, cooking the coefficients. Had you considered using a 3D LUT system for the conversions, this could handle 601, 709, linear, sRGB, log.
yCMS is a free colour management system that I currently use with AVISynth. http://forum.doom9.org/showthread.php?t=154719
I already have in a branch near ready for merge and push that adds a colorspace field to the project profile, reads input's colorspace, does colorspace normalization of inputs (e.g. 601<->709), and sets colorspace on output (not many encoders in ffmpeg utilize this). The "full range" luma option (not scaling) in my branch is half-baked. In swscale, it works going to RGB but not from, but also my version is a few months old.
I generally do like to have more than one implementation of fundamental services like this; however, I am low on bandwidth. I may look into that. I already heard about ColorMatrix as well. What do you think of that? yCMS is not open source, but there is t3dlut. Do you want to help port either of those? The fact that most AVISynth filters support YUY2 makes it rather easy since that is what MLT uses (besides RGB and RGBA).
I'm really sorry for the dumb question, I didn't want to start another thread: I'm exited by the new color correction tools but I really can't understand how to use them, I feel very dumb :-( I mean, looking at them it seems they have just a visual/statistic function. I don't have your knowledge about color depth and so on but I really can't understand where I have to go to tweak some sliders to change color values etc.
Can you please help this poor 2-years Kdenlive proud user? Maybe a little video tutorial just to understand where to put... the arrow of my mouse...
You'll never understand how dumb I feel... I've been waiting for so long for this features and now I cannot manage to use them!!!
Thanks so much for all your hard work,
Ignazio
http://kdenlive.org/users/granjow/introducing-color-scopes-waveform-and-...
An entry about the Vectorscope will follow soon.
This is a very deep topic, and it took me days to learn the things I know now about scopes, color, etc. And it's still only a tiny part I know. No need to feel dumb.
Simon
Dan, that's very exciting news. Really excellent. Sorry I'm no coder. :-(
lordofthestrings, Granjow has done a great job with the tools and write on there use. The scope tools are really for analytical use first and foremost. Steve Hullfish / Jamie Fowlers book 'Color Correction For Video' is a good starting point.
But they're not only for attempting to 'correct' bad camera work. :-) Failure to expose sufficiently, failure to manual white balance before shooting etc which should be done in camera.
They also come in useful when for example you have numerous shots through the day or series of days with differing lighting conditions, especially exterior shots in uncontrolable lighting, at different times of day and you want them to 'look' cohesive after you've done the edit and rearranged them all out of sequence. The scopes give you another view of colour casts, light levels, etc to analyse how you approach unifying the clips in conjuntion with masks, curves, 3 way colour tool etc.
Take a look at www.prolost.com scroll down a bit to the recent Colorista II vimeo tutorials Stu Machwitz does, that will explain a little further the idea's and purpose of the then look how you can emulate those.
Thanks a lot Granjow and Yellow. Actually I read the article but I'll go over it again to better understand.
Anyway, I think I miss something: you wrote about a new effect: "SOP/Sat". Is this the reason I can't find where to tweak to get color grading? I don't have that effect... Should I have to upgrade someway my effect list? Is it a Frei0r plugin? Shall I have to uninstall Frei0r and get a newer version of the Frei0r plugins?
I'm sorry for my English (I'm Italian), I hope you understood what I was trying to ask.
Thank you so much,
Ignazio
Now I've found on this thread:
http://www.kdenlive.org/forum/color-correction
a post by user "ttill":
"Just a quick note: For those new color correction you do not only need a recent version of Kdenlive but also of frei0r."
Is that the answer I'm looking for?
Yes.
Thanks a lot man,
I just saw that the last Frei0r was released yesterday and read the release notes.
Just one last question, please:
I added the new Sunab repo to install the latest stable Kdenlive 0.7.8. Now I'm at work and can't verify on my home pc but should I expect an automatic upgrade notify from the Ubuntu update manager about Frei0r or should I add this repo I just found?
https://launchpad.net/~sunab/+archive/sunab2 (I don't know right now if it's different from the one I added yesterday, but It has Frei0r 1.2 - compiled about 5 hours ago)
Ignazio
Hi,
glad to see people using my packages, but I recently moved kdenlive packages to better named ppas :
ppa:sunab/kdenlive-release for stable versions
ppa:sunab/kdenlive-svn to track svn trunk (empty at this moment)
I have already updated the download section of this website.
I looked around Frei0r plugins 1.2, and the packaging is now ok (had some problems), the packages will be in the related ppas probably tomorrow.
Sunab.
Sunab, people like you give a strong chance to newbies to move fearless towards free software. I can't wait to try the new tools. Thanks a lot for your work.
So, if I understood right, I just have to use the repo in the download section and wait for frei0r update to come. Great.
Can you tell me please what are ffmpeg-debian and ffmpeg-extra? Can I install them? Are they newer than the ffmpeg packages we find in the official Lucid repository?
Ignazio
@lordofthestrings,
You understand right, you just have to wait. (and reload your package manager to get the update).
About your ffmpeg question : be VERY careful! ffmpeg and the related libraries (libavformat, libavdevice, libavcodec,libpostproc, libavfilter, libswscale) are a the basement of many applications. FFmpeg is a very active project, and dealing with new video/sound codecs and conatineers requires breaking compatiblity with previous versions. This means that if you upgrade your distro ffmpeg versions you may expect breakage in all programs depending on ffmpeg libs. My advice for a newcomer is not changing from the official ffmpeg version of your distro.
About extra libs, they are in official repositories, they bring support for restricted (with patents in some part of the world) codecs/formats. My kdenlive packages forces (it is very bad, I know) installation of ffmpeg extra libs, to ensure that a wide range of codecs will be available. One note about the aac encoder, it is not activated in the ubuntu repositories even with extra libs (so the kdenlive H264/aac encoding profile is disabled). If needed you may want to use the Medibuntu repositories which contains the SAME ffmpeg version but with an acc encoder activated (note : relative poor quality)
Sunab.
Hi Sunab, thanks for the PPA, but I' having a bit of difficulty, everything is working except the frei0r plugins are not listed in the effects list, the folders are there just no contents. I've uninstalled and reinstalled but no good. I have the Frei0r 1.22git.
@yellow,
what happens if you type a letter for example "a" (without quotes) in the search bar at the top of effects list ? Are you using GTK+ style for KDE wigdets? Using Maverick or Lucid?
sunab, thanks, typing a letter does it, no problem. :-)
But simply clicking on a folder like "Audio" does nothing? The folder is expected to deploy itself when clicked...
Please check what happens if you select a folder and then press Enter.
On the laptop I can open folders in the effect list with single clicks. On the PC, where I've set KDE to use double clicks for opening files/directories/etc., I have to press enter in order to open a directory in there.
If it is the same there, then this really is a bug and not just an anomaly found on my PC ;)
On my laptop I have no problem with deploying effects folders when I set Oxygen sytle in KDE systemsettings, but when I select the GTK+ style(I use a Gnome, sorry), the effects folders seem to be stuck, and will not deploy until I use the search bar or press enter.
@Granjow, on your PC you seem to have the same behaviour. Theme related?