Revolver is a digital video synthetiser. It inputs valid c++ code snippet and turns it into a values/pixels. Something similar as GLSL is doing to your screen on GPU but computed and dumped onto disk by CPU.
Q: That is crazy.. why would you do that? ..it is so much slower
A: Yup, but it is sort of tricky to get 16-bits-per-channel pixel out of your GPU ..and it is much more fun! ;)
-i formula.txtsetting input program textfile-o output.mkvsetting output videofile
-s 720x576output size-f 1998x1080actual framesize (adding letterboxes / pilarboxes to-s)-r 24000/1001or i.e.-r 23.97602397602397602397to set framerate (defaults on PAL 25)-p yuv444p16lesetting pixelformat of the output (seeffmpeg -pix_fmtsfor full list)-t 3600how much seconds to render i.e.-t 01:30:00gives 1 hour and half-q 1do no show live preview (render mode)
Is basicly the body of C++ function, triggered once for each rendered pixel per frame rendered. There is some preprocessing going on which gives you following variables:
Rred pixel valueGgreen pixel valueBblue pixel valuemaxdefault to 65535 which is maximum value in color-range in 16-bitxx coordinate of current pixelyy coordinate of current pixelframeCountnumber of frames passedwidthwidth of pixel areaheightheight of pixel areapixels[]access to all pixel values
Roughly speaking any of valid C++ code is allowed here. For instance you can use math i.e. including <math.h> functions as well. If you need to extend libraries used by this snippet add them to blueprint.h file. Defining classes or other functionas are so far out of scope, it is quite easy to extend it if needed.
If the code is invalid it will prints out compiler error to console.
ffmpegswiss army knife for videompvmodern videoplayerg++c++ compiler
git clone https://github.com/K0F/revolvercd revolvermake
./revolver -i formulas/1.txt -s 4096x2160 -p yuv444p16le -r 24 -o My4kBlockBuster.mkv
It outputs FFV1 codec in Matroška container, later you can convert such MASTER into DPX series, DCP or ProRes to use it in whatever professional video editor of your choice.
It works on Linux only (MacOs would possibly do as well, untested)
Kryštof Pešek aka kof, 2019