CamMark comes as two command line programs, one for the actual camcorder simulation, and one for the calibration of certain distortions from a given pair of reference/copy videos or images. However, please note that CamMark comes with a well-defined set of presets, which obviates the need to create your own calibrations unless you want to explicitly simulate a certain existing setup.
The graphical user interface, which was part of the original first version of CamMark, was removed in version 1.1 and will be replaced soon by a CamMark web service, offering a web-based interface to an entirely server-side processing.
The CamMark simulation tool reads input in form of video files or a set of single frames, simulates typical artifacts from cam-cording to it such as spatial and temporal distortions, and writes the result in form of a video or set single frames.
CamMark[.exe] scenario-file source-file [output-file]
.avi
for outputting a video file,
or .png
for outputing PNG-compressed single frames.source-file-without-ext_sim.avi
bin\CamMark.exe scenarios\example_everything-specified.xml input.mp4
./bin/CamMark scenarios/example_everything-specified.xml input.mp4
The input can be specified as a relative or absolute path to an existing media file. CamMark can read any video format natively supported by ffmpeg. This includes a broad selection of codes and containers, and should cover all typically used formats.
Alternatively, a set of single frames can be specified, in any common image format (PNG, JPEG, BMP, TIFF, ...).
CamMark will automatically detect a frame sequence if the file names contain a running index, starting at zero, with a fixed number of digits.
There is no requirement on the number of digits other than being fixed, and the index can be in any part of the file name.
However, auto-detection only works if the first frame of the sequence is specified as source file,
and its running index has to be zero (so 0000
for a four-digits index).
frm-0000.png
, frm-0001.png
, frm-0002.png
, ...frm00.jpg
, frm01.jpg
, frm02.jpg
, ...000000.bmp
, 000001.bmp
, 000002.bmp
, ...000000-sample.tif
, 000001-sample.tif
, 000002-sample.tif
, ...frm-00000-mod.png
, frm-00001-mod.png
, frm-00002-mod.png
, ...As output, either a video file or a set of single frames can be generated. The parameter is the desired output file name, which can also contain a relative or an absolute path. CamMark will try to create any directories that do not exist before creating the output file.
If specifying a file name with .avi
extension, an MPEG-4 compressed video is written into an AVI container.
Note that there is currently no option to change the video codec, container, or encoding parameters.
To write a sequence of PNG-compressed single frames, specify a file name with .png
extension.
In this case, a running 6-digit index separated by an underscore is automatically prepended to the filename.
/path/to/file/out-frms.png
will thus create the frame sequence /path/to/file/000000_out-frms.png
, /path/to/file/000001_out-frms.png
and so on.
The entire configuration of a CamMark simulation run is specified in a so-called scenario. The scenario is provided in form of an XML file, each simulated distortion having a separate XML tag. An XML scenario file, which is configuring all supported distortions as an example, is included in the distribution.
The general structure of the scenario XML file is as follows:
All configuration data is contained within a <Scenario>
tag.
There are currently two distortion-independent tags (<CaptureTimespan>
and <OverrideSourceFPS>
),
plus a seperate tag for each distortion to configure (<SpatialDistortion>
, <TemporalDistortion>
,
<AutomaticGainControl>
, <AutomaticWhiteBalance>
, <ColorFilterArray>
, and <Defocus>
).
A distortion is only applied if the according tag is specified and its enabled
attribute set to true
.
A detailed description of each of these tags is given further below. An example of a temporal distortion configuration can be seen here:
Instead of specifying each distortion's configuration manually, presets can be used.
A preset is nothing else than XML configuration data that is seperately stored and can be easily included by using the preset
attritute in the distorion's configuration tag:
The preset file can be specifed with an absolute or relative path. If the preset file my-temporal-preset.xml
contains the following XML, the configuration is effectively the same as in the previous section's example:
CamMark already comes with a useful set of presets for each distortion, that can be used without having completely understand each distortions configuration.
It is also possible to specify a preset and further configuration tags at the same time. In this case, the directly specified tags have precedence over the tags from the preset. In other words, directly specified tags override tags that are specified in the preset. This way, you can use a preset but still adjust the scenario to your needs.
The following sections describe each distortion's individual configuration.
<CaptureTimespan start-time="float" end-time="float" /> (opt.) <OverrideSourceFPS value="float" /> (opt.)
<SpatialDistortion enabled="boolean"> <DisplayResolution width="int|string" height="int|string" aspect-ratio-mode="string" /> (opt.) <CameraResolution width="int|string" height="int|string" /> (opt.) <TransformationFile path="filename" background-insertion="boolean" /> (opt.) <SoftenBorders extend-border-px="int" fade-border-px="int" /> (opt.) </SpatialDistortion>
"source"
is specified, the source video's width/height is used directly.
"calib"
is specified, and a transformation file is used, the original width/height of the monitor that was used to calibrate the transformation is used."Letterbox"
, "Crop"
, and "Resize"
.
If the attribute is omitted, letterboxing is used."source"
is specified, the source video's width/height is used directly.
"calib"
is specified, and a transformation file is used, the original width/height of the camera that was used to calibrate the transformation is used.3
is used.3
is used.<TemporalDistortion enabled="true"> <Display refresh-rate="float" fading-time="float" vsync="boolean" /> (opt.) <LCDBacklightDimming pwm-duty-cycle="float" pwm-frequency="float" /> (opt.) <Capture fps="float" exposure-time="float" readout-time="float" /> (opt.) </TemporalDistortion>
59,94
or 60
Hz,
this avoids distortions from frame timing adjustments or tearing to be simulated unless explicitly wanted.true
, as almost all players do this to avoid tearing artifacts.
Simulating v-sync is only useful if the simulated display's refresh rate is different to the source video's frame rate.0.0
and 1.0
, representing a percentage of time that the pulse-width-modulated LCD backlight is on.
The percentage directly corresponds to the simulated LCD brightness, with 100% (1.0
) being the highest brightness, and 0% (0.0
) being enirely dark.
1.0
is used (no dimming).180
Hz is used, as this is a typical frequency for LCD backlights to operate on.<AutomaticGainControl enabled="true"> <Method name="string" /> (mandatory) <LowerBound count="int" thresh="float" adjust="float" /> (mandatory) <UpperBound count="int" thresh="float" adjust="float" /> (mandatory) </AutomaticGainControl>
"Mean-Threshold-Offset-FixAdjustment"
and "Mean-Threshold-Offset-PecentualAdjustment
.
Both specify a lower and an upper threshold of the overall frame brightness (thresh).
If the actual frame brightness violates this threshold for count frames, the gain (currently simulated via an offset) is adjusted (adjust).
FixAdjustment
method, the offset is simply adjusted by a fix value,
while the PecentualAdjustment
adjusts based on how far the actual brightness is away from the threshold.0
and 255
.
The value specified for the upper bound must be greater than the value specified for the lower bound.0.0
to 1.0
.<AutomaticWhiteBalance enabled="true"> <Method name="string" /> (mandatory) </AutomaticWhiteBalance>
"Grayworld"
and "Weng"
.
<ColorFilterArray enabled="true"> <Method name="string" /> (mandatory) <AAFilter enabled="boolean" /> (opt.) </ColorFilterArray>
"SimpleBayer"
, simulating the typical sampling artifacts from the original Bayer color filter array.enabled
attribute to false
.true
, an anti-aliasing filter is simulated in front of the color filter array.
<Defocus enabled="true"> <GaussianBlur kernel-size="int" sigma="float" /> (opt.) </Defocus>
kernel-size
is specified, the standard deviation sigma
is automatically calculated from the filter size.sigma
is specified, the kernel-size
is automatically calculated from sigma.