VGrade Project

A Simple High Quality Video Grading System

[ Home ]       [ Example Videos ]       [ Usage ]       [ Installation ]       [ Download ]       [ Presentations ]       [ Contact ]



Put vgrade, foto_histoparms and foto_Video in your path and call it like this:

or edit appropriate line of vgrade, so it can find the file vgradeutils (see installation), so you can just call

   vgrade <PARAMETERS>


You must get the appropriate Color Lookup Tabels (LUTs) for your camera and convert them to Hald-CLUTs. See installation.

Video Scripts

You must write the right VGrade Video Script for your video material. This may need some trial-and-error. Start with the a simple script like

	@AUTOCOLOR # only color options here!
			# LEVELS M,M,1 M,M,1 M,M,1
			LEVELS A,A,1 A,A,1 A,A,1
The keywords @EXTRACT, @HISTO, @AUTOCOLOR, @PREVIEW and @FINAL denote the various phases of the video conversion.

Within the phases you may use @im for calling imagemagick, @gm for calling graphicsmagick, @ffm for ffmpeg and gmic for GMIC. Not all combinations will make sense.

The lines below these are simply options to the corresponding conversion program, newlines are removed and the options are concatened. For convenience there are macros like LEVELS, LUT and DESHAKE to abbreviate long option strings. LEVELS furthermore initiates automatic grading via linear histogram stretching.

# in a script initiates a comment, so all characters after a # are ignored.

Have a look at the example video script at the dowload page.

Extraction Phase

With your video script in video.vs and your raw video in, a call like

	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid extract
initiates the extraction of example frames from the raw video. After this step you find the example frames in /preview/dir/myvid/raw/tif (48 bit color) and /preview/dir/myvid/raw/png (24 bit color). Histograms are found in /preview/dir/myvid/raw/hist.

Histogram Calculation Phase

After successful execution of the extraction phase, next step is to calulate the histogram data of your video to find the lightest and darkest spot in your video. With the LEVELS command in your video script, these will be color-stretched to white and black accordingly. Histogram phase is initiated with

	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid histo
The frames, the histogram calculation is based upon are stored in /preview/dir/hist/*.

Autocolor Phase

With the histogram data (that are stored in /preview/dir/hist/histodata.txt), automatic color correction according to the LEVELS commands in the video.vs is performed via

	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid autocolor
The results of this phase is stored in /preview/dir/myvid/color/png (24 bit color). Histograms are found in /preview/dir/myvid/color/hist.

Hand Grading Phase

Now the LUTS that are used for the actual grading of the video can be generated. This is simply done by editing the files in /preview/dir/myvid/color/png. So call

	geeqie /preview/dir/myvid/color/png

Load the images into gimp via a right mouse-click and a call to "Edit -> GNU Image Manipulation Program". Edit the image as you wish, but strictly stick to the "Color" menu of GIMP for not damaging the LUT. Resizing, sharpening etc. are for obvious reasons taboo. However any color changing step in any color space you wish is perfectly allright. Save your image with "Overwrite ..." in GIMP and close GIMP.

After that never forget to regenerate the LUTs in Geeqie: Select the images you want to grade like the edited image in Geeqie (so you select at least the image you just edited) and call the appropriate "Edit -> theM VGrade Apply ..." by right mouse-clicking the images and using the context menu.

Proceed until all sample frames are graded to your taste.

Preview Phase

For the preview, not only the color grading you created in the last phase is applied, but also all image enhancements you have defined in your video.vs. Execute the preview phase with

	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid preview
Review the results of this phase is in /preview/dir/myvid/preview/png (24 bit color) and /preview/dir/myvid/color/hist (histograms) to see, how a the sample frames will be rendered in your final video. If they do not yet suit your taste, backtrack to one of the steps above.

Processing Phase

As soon as you are satisfied with the previews, you can process your final video clip with

	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid process
Expect this phase to take some time, typically a frame rate of 1-10 frames per second can be acchieved with usual amateur computer hardware. Find the resulting video in /output/dir/

Running More Than One Phase at Once

It is possible to combine more than one phase to let more than one calculation be performed automatically. In particular, a call of

	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid extract histo autocolor preview
may calculate the previews with only one vgrade call.

Man Pages

Good luck and have fun. And if it works (or doesn't) don't hesitate to drop me an mail.