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:
    VGRADEUTILS=<PATHOFSCRIPTLIB>/vgradeutils  vgrade <PARAMETERS>
vgrade, so it can find the file vgradeutils (see installation), so you can just call
   vgrade <PARAMETERS>
	@EXTRACT
		@ffm
		hqdn3d=luma_spatial=4
	@HISTO
		@gm
			LUT BMLUTX
	@AUTOCOLOR # only color options here!
		@im
			# LEVELS M,M,1 M,M,1 M,M,1
			LEVELS A,A,1 A,A,1 A,A,1
	@PREVIEW
		@ffm
			unsharp=lx=3:ly=3:la=1.3:cx=3:cy=3:ca=0.6
	@FINAL
		@ffm
		# DESHAKE
		hqdn3d=luma_spatial=4
@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.
With your video script in video.vs and your raw video in rawvideo.mov, a call like
	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid extract rawvideo.mov
/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.
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 rawvideo.mov
/preview/dir/hist/*.
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 rawvideo.mov
/preview/dir/myvid/color/png (24 bit color). Histograms are found in /preview/dir/myvid/color/hist.
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.
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 
Review the results of this phase is in
	vgrade -s video.vs -pdir /preview/dir -odir /output/dir -oname myvid preview rawvideo.mov
/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.
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 rawvideo.mov
/output/dir/myvid.j.mov.
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 rawvideo.mov
vgrade call.
Good luck and have fun. And if it works (or doesn't) don't hesitate to drop me an mail.