Skip to content
Yinhang Liu edited this page May 13, 2020 · 210 revisions

1. FFmpeg-xcam

To enable compilation of xcam filter you need to configure FFmpeg with --enable-libxcam.

Common parameters:

inputs      : The number of inputs
              Range   : [1 - 6]
              Default : 1
w           : Output video width. If the value is 0, the corresponding input width is used for the output.
              Range   : [0 - INT_MAX]
              Default : 0
h           : Output video height. If the value is 0, the corresponding input height is used for the output.
              Range   : [0 - INT_MAX]
              Default : 0
fmt         : Pixel format
              Range   : [auto, nv12, yuv420]
              Default : auto
name        : Handler name
              Range   : [3dnr, waveletnr, fisheye, defog, dvs, stitch, stitchcl]
              Default : stitch
allocoutbuf : Whether or not to allocate output buffer
              Range   : [0, 1]
              Default : 1
params       : Private parameters for each handler. Usage: params=help=1 field0=value0 field1=value1 ...
1.1 3D denoising test
$ ffmpeg -i input.mp4 -vf "xcam=name=3dnr:fmt=nv12" output.mp4
1.2 Wavelet denoising test
$ ffmpeg -i input.mp4 -vf "xcam=name=waveletnr:fmt=nv12" output.mp4
1.3 Fisheye calibration test
$ ffmpeg -i input.mp4 -vf "xcam=name=fisheye:fmt=nv12" output.mp4
1.4 Fog removal test
$ ffmpeg -i input.mp4 -vf "xcam=name=defog:fmt=nv12" output.mp4
1.5 Soft, GLES and Vulkan stitching

For four inputs, the calibration files(intrinsic paramters and extrinsic parameters) should be stored in "FISHEYE_CONFIG_PATH" directory, and then export the path:

        export FISHEYE_CONFIG_PATH=/etc/xcam/calibration

Private parameters:

module      : Processing module
              Range   : [soft, gles, vulkan]
              Default : soft
fisheyenum  : Number of fisheye lens
              Range   : [2 - 6]
              Default : 3
cammodel    : Camera model
              Range   : [cama2c1080p, camb4c1080p, camc3c8k, camd3c8k]
              Default : camc3c8k
levels      : The pyramid levels of blender
              Range   : [1 - 4]
              Default : 1
dewarp      : Fisheye dewarp mode
              Range   : [sphere, bowl]
              Default : sphere
scopic      : Scopic mode
              Range   : [mono, stereoleft, stereoright]
              Default : mono
scale       : Scaling mode for geometric mapping
              Range   : [singleconst, dualconst, dualcurve]
              Default : singleconst
fm          : Feature match mode
              Range   : [none, default, cluster, capi]
              Default : default
fmframes    : How many frames need to run feature match at the beginning
              Range   : [0 - INT_MAX]
              Default : 120
fmstatus    : Running status of feature match
              Range   : [fmfirst, halfway, wholeway]
              Default : wholeway
help        : Printf usage
              Range   : [0, 1]
              Default : 0

1) Soft stitching
  a. One input
     $ ffmpeg -i input.mp4 -vf "xcam=inputs=1:name=stitch:w=1920:h=960:fmt=nv12:allocoutbuf=1:params=help=1 module=soft cammodel=cama2c1080p fisheyenum=2 levels=1 dewarp=sphere scale=dualconst fm=capi fmframes=120 fmstatus=fmfirst scopic=mono" output.mp4
  b. Three inputs
     $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -filter_complex "xcam=inputs=3:name=stitch:w=7680:h=3840:fmt=nv12:allocoutbuf=1:params=help=1 module=soft cammodel=camc3c8k fisheyenum=3 levels=1 dewarp=sphere scale=dualconst fm=cluster fmframes=120 fmstatus=fmfirst scopic=stereoleft" output.mp4
  c. Four inputs
     $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex "xcam=inputs=4:name=stitch:w=1920:h=640:fmt=nv12:allocoutbuf=1:params=help=1 module=soft cammodel=camb4c1080p fisheyenum=4 levels=1 dewarp=bowl scale=dualconst fm=capi fmframes=120 fmstatus=fmfirst scopic=mono" soft-stitch.mp4

2) GLES stitching
  a. One input
     $ ffmpeg -i input.mp4 -vf "xcam=inputs=1:name=stitch:w=1920:h=960:fmt=nv12:allocoutbuf=1:params=help=1 module=gles cammodel=cama2c1080p fisheyenum=2 levels=1 dewarp=sphere scale=dualconst fm=default fmframes=120 fmstatus=fmfirst scopic=mono" output.mp4
  b. Three inputs
     $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -filter_complex "xcam=inputs=3:name=stitch:w=7680:h=3840:fmt=nv12:allocoutbuf=1:params=help=1 module=gles cammodel=camc3c8k fisheyenum=3 levels=1 dewarp=sphere scale=dualconst fm=default fmframes=120 fmstatus=fmfirst scopic=stereoleft" output.mp4
  c. Four inputs
     $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex "xcam=inputs=4:name=stitch:w=1920:h=640:fmt=nv12:allocoutbuf=1:params=help=1 module=gles cammodel=camb4c1080p fisheyenum=4 levels=1 dewarp=bowl scale=dualconst fm=default fmframes=120 fmstatus=fmfirst scopic=mono" soft-stitch.mp4

3) Vulkan stitching
  a. Four inputs
     $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex "xcam=inputs=4:name=stitch:w=1920:h=640:fmt=nv12:allocoutbuf=1:params=help=1 module=vulkan cammodel=camb4c1080p fisheyenum=4 levels=1 dewarp=bowl scale=singleconst fm=default fmframes=120 fmstatus=fmfirst scopic=mono" soft-stitch.mp4
1.6 OpenCL stitching

For four inputs, the calibration files(intrinsic paramters and extrinsic parameters) should be stored in "FISHEYE_CONFIG_PATH" directory, and then export the path:

        export FISHEYE_CONFIG_PATH=/etc/xcam/calibration

Private parameters:

res         : Resolution mode
              Range   : [1080p2cams, 1080p4cams, 4k2cams, 8k3cams, 8k6cams]
              Default : 1080p2cams
dewarp      : Fisheye dewarp mode
              Range   : [sphere, bowl]
              Default : sphere
scale       : Scaling mode for geometric mapping
              Range   : [local, global]
              Default : local
fisheyenum  : Number of fisheye lens
              Range   : [2 - 6]
              Default : 2
fisheyemap  : Enable fisheye map
              Range   : [0, 1]
              Default : 0
fm          : Enable feature match
              Range   : [0, 1]
              Default : 1
lsc         : Enable lens shading correction
              Range   : [0, 1]
              Default : 0
seam        : Enable seam finder in blending area
              Range   : [0, 1]
              Default : 0
help        : Printf usage
              Range   : [0, 1]
              Default : 0

1) One input
   $ ffmpeg -i input.mp4 -vf "xcam=inputs=1:name=stitchcl:w=1920:h=960:fmt=nv12:params=help=1 res=1080p2cams dewarp=sphere scale=local fisheyenum=2 fisheyemap=1 fm=1" output.mp4

2) Four inputs
   $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -filter_complex "xcam=inputs=4:name=stitchcl:w=1920:h=640:fmt=nv12:allocoutbuf=1:params=help=1 res=1080p4cams dewarp=bowl scale=local fisheyenum=4 fisheyemap=1 fm=1" soft-stitch.mp4

3) Six inputs
   $ ffmpeg -i input0.mp4 -i input1.mp4 -i input2.mp4 -i input3.mp4 -i input4.mp4 -i input5.mp4 -filter_complex "xcam=inputs=6:name=stitchcl:w=7680:h=3840:fmt=nv12:params=help=1 res=8k6cams dewarp=sphere scale=local fisheyenum=6 fisheyemap=1 fm=1" output.mp4

2. Test-surround-view

Usage: test-surround-view --module MODULE --input input0.nv12 --input input1.nv12 --input input2.nv12 ...
  --module            processing module, selected from: soft, gles, vulkan
                      read calibration files from exported path $FISHEYE_CONFIG_PATH
  --input             input image(NV12)
  --output            output image(NV12/MP4)
  --in-w              optional, input width, default: 1280
  --in-h              optional, input height, default: 800
  --out-w             optional, output width, default: 1920
  --out-h             optional, output height, default: 640
  --topview-w         optional, output width, default: 1280
  --topview-h         optional, output height, default: 720
  --fisheye-num       optional, the number of fisheye lens, default: 4
  --res-mode          optional, image resolution mode
                      select from [1080p2cams/1080p4cams/8k3cams], default: 1080p4cams
  --blend-pyr-levels  optional, the pyramid levels of blender, default: 2
  --dewarp-mode       optional, fisheye dewarp mode, select from [sphere/bowl], default: bowl
  --scopic-mode       optional, scopic mode, select from [mono/stereoleft/stereoright], default: mono
  --scale-mode        optional, scaling mode for geometric mapping,
                      select from [singleconst/dualconst/dualcurve], default: singleconst
  --fm-mode           optional, feature match mode,
                      select from [none/default/cluster/capi], default: none
  --fm-frames         optional, how many frames need to run feature match at the beginning, default: 100
  --fm-status         optional, running status of feature match,
                      select from [wholeway/halfway/fmfirst], default: wholeway
                      wholeway: run feature match during the entire runtime
                      halfway: run feature match with stitching in the first --fm-frames frames
                      fmfirst: run feature match without stitching in the first --fm-frames frames
  --frame-mode        optional, times of buffer reading, select from [single/multi], default: multi
  --save              optional, save file or not, select from [true/false], default: true
  --save-topview      optional, save top view video, select from [true/false], default: false
  --loop              optional, how many loops need to run, default: 1
  --help              usage
2.1 2cameras tests
1) GLES module
  a. NV12 output
   $ test-surround-view --module gles --input input.nv12 --output output.nv12 --in-w 1920 --in-h 1080 --out-w 1920 --out-h 960 --fisheye-num 2 --res-mode 1080p2cams --blend-pyr-levels 2 --dewarp-mode sphere --scopic-mode mono --scale-mode dualconst --fm-mode default --fm-frames 120 --fm-status fmfirst --frame-mode multi --save true --save-topview false --loop 1

  b. MP4 output
   $ test-surround-view --module gles --input input.nv12 --output output.mp4 --in-w 1920 --in-h 1080 --out-w 1920 --out-h 960 --fisheye-num 2 --res-mode 1080p2cams --blend-pyr-levels 2 --dewarp-mode sphere --scopic-mode mono --scale-mode dualconst --fm-mode default --fm-frames 120 --fm-status fmfirst --frame-mode multi --save true --save-topview false --loop 1

2) CPU module
  a. NV12 output
   $ test-surround-view --module soft --input input.nv12 --output output.nv12 --in-w 1920 --in-h 1080 --out-w 1920 --out-h 960 --fisheye-num 2 --res-mode 1080p2cams --blend-pyr-levels 1 --dewarp-mode sphere --scopic-mode mono --scale-mode dualconst --fm-mode capi --fm-frames 120 --fm-status fmfirst --frame-mode multi --save true --save-topview false --loop 1

  b. MP4 output
   $ test-surround-view --module soft --input input.nv12 --output output.mp4 --in-w 1920 --in-h 1080 --out-w 1920 --out-h 960 --fisheye-num 2 --res-mode 1080p2cams --blend-pyr-levels 1 --dewarp-mode sphere --scopic-mode mono --scale-mode dualconst --fm-mode capi --fm-frames 120 --fm-status fmfirst --frame-mode multi --save true --save-topview false --loop 1
2.2 3cameras tests
1) GLES module
  a. NV12 output
   $ test-surround-view --module gles --input input1.nv12 --input input3.nv12 --input input5.nv12 --output output.nv12 --in-w 3840 --in-h 2880 --out-w 7680 --out-h 3840 --fisheye-num 3 --res-mode 8k3cams --blend-pyr-levels 2 --dewarp-mode sphere --scopic-mode stereoleft --scale-mode dualconst --frame-mode multi --fm-mode cluster --fm-frames 120 --fm-status fmfirst --save true --save-topview false --loop 1

  b. MP4 output
   $ test-surround-view --module gles --input input1.nv12 --input input3.nv12 --input input5.nv12 --output output.mp4 --in-w 3840 --in-h 2880 --out-w 7680 --out-h 3840 --fisheye-num 3 --res-mode 8k3cams --blend-pyr-levels 2 --dewarp-mode sphere --scopic-mode stereoleft --scale-mode dualconst --frame-mode multi --fm-mode cluster --fm-frames 120 --fm-status fmfirst --save true --save-topview false --loop 1

2) CPU module
  a. NV12 output
   $ test-surround-view --module soft --input input1.nv12 --input input3.nv12 --input input5.nv12 --output output.nv12 --in-w 3840 --in-h 2880 --out-w 7680 --out-h 3840 --fisheye-num 3 --res-mode 8k3cams --blend-pyr-levels 1 --dewarp-mode sphere --scopic-mode stereoleft --scale-mode dualconst --frame-mode multi --fm-mode cluster --fm-frames 120 --fm-status fmfirst --save true --save-topview false --loop 1

  b. MP4 output
   $ test-surround-view --module soft --input input1.nv12 --input input3.nv12 --input input5.nv12 --output output.mp4 --in-w 3840 --in-h 2880 --out-w 7680 --out-h 3840 --fisheye-num 3 --res-mode 8k3cams --blend-pyr-levels 1 --dewarp-mode sphere --scopic-mode stereoleft --scale-mode dualconst --frame-mode multi --fm-mode cluster --fm-frames 120 --fm-status fmfirst --save true --save-topview false --loop 1
2.3 4cameras tests

The calibration files(intrinsic paramters and extrinsic parameters) should be stored in "FISHEYE_CONFIG_PATH" directory, and then export the path:

        export FISHEYE_CONFIG_PATH=/etc/xcam/calibration
1) GLES module
  a. NV12 output
   $ test-surround-view --module gles --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1920 --out-h 640 --topview-w 1280 --topview-h 720 --fisheye-num 4 --res-mode 1080p4cams --blend-pyr-levels 2 --dewarp-mode bowl --scopic-mode mono --scale-mode dualconst --frame-mode multi --fm-mode default --fm-frames 120 --fm-status fmfirst --save true --save-topview true --loop 1

  b. MP4 output
   $ test-surround-view --module gles --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.mp4 --in-w 1280 --in-h 800 --out-w 1920 --out-h 640 --topview-w 1280 --topview-h 720 --fisheye-num 4 --res-mode 1080p4cams --blend-pyr-levels 2 --dewarp-mode bowl --scopic-mode mono --scale-mode dualconst --frame-mode multi --fm-mode default --fm-frames 120 --fm-status fmfirst --save true --save-topview true --loop 1

2) Vulkan module
  a. NV12 output
   $ test-surround-view --module vulkan --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1920 --out-h 640 --topview-w 1280 --topview-h 720 --fisheye-num 4 --res-mode 1080p4cams --dewarp-mode bowl --scale-mode singleconst --frame-mode multi --fm-mode default --save true --save-topview true --loop 1

  b. MP4 output
   $ test-surround-view --module vulkan --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.mp4 --in-w 1280 --in-h 800 --out-w 1920 --out-h 640 --topview-w 1280 --topview-h 720 --fisheye-num 4 --res-mode 1080p4cams --dewarp-mode bowl --scale-mode singleconst --frame-mode multi --fm-mode default --save true --save-topview true --loop 1

3) CPU module
  a. NV12 output
   $ test-surround-view --module soft --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1920 --out-h 640 --topview-w 1280 --topview-h 720 --fisheye-num 4 --res-mode 1080p4cams --blend-pyr-levels 1 --dewarp-mode bowl --scopic-mode mono --scale-mode dualcurve --frame-mode multi --fm-mode capi --fm-frames 120 --fm-status fmfirst --save true --save-topview true --loop 1

  b. MP4 output
   $ test-surround-view --module soft --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.mp4 --in-w 1280 --in-h 800 --out-w 1920 --out-h 640 --topview-w 1280 --topview-h 720 --fisheye-num 4 --res-mode 1080p4cams --blend-pyr-levels 1 --dewarp-mode bowl --scopic-mode mono --scale-mode dualcurve --frame-mode multi --fm-mode capi --fm-frames 120 --fm-status fmfirst --save true --save-topview true --loop 1

3. Test-image-stitching

Usage: test-image-stitching --input file --output file  [--output-w width] [--input-h height] ...
  --input             input image(NV12)
  --output            output image(NV12)
  --input-w           optional, input width, default: 1920
  --input-h           optional, input height, default: 1080
  --output-w          optional, output width, default: 1920
  --output-h          optional, output width, default: 960
  --res-mode          optional, image resolution mode
                      select from [1080p2cams/1080p4cams/4k2cams/8k6cams], default: 1080p2cams
  --dewarp-mode       optional, fisheye dewarp mode, select from [sphere, bowl], default: sphere
  --scale-mode        optional, image scaling mode, select from [local/global], default: local
  --enable-seam       optional, enable seam finder in blending area, default: no
  --enable-fisheyemap optional, enable fisheye map, default: no
  --enable-lsc        optional, enable lens shading correction, default: no
  --fm                optional, enable or disable feature match, default: true
  --fisheye-num       optional, the number of fisheye lens, default: 2
  --save              optional, save file or not, select from [true/false], default: true
  --save-topview      optional, save top view videos, select from [true/false], default: false
  --save-freeview     optional, save free(rectified) view videos, select from [true/false], default: false
  --framerate         optional, framerate of saved video, default: 30.0
  --loop              optional, how many loops need to run for performance test, default: 1
  --help              usage
3.1 2cameras tests
  a. NV12 output
   $ test-image-stitching --input input.nv12 --output output.nv12 --input-w 1920 --input-h 1080 --output-w 1920 --output-h 960 --dewarp-mode sphere --scale-mode local --enable-fisheyemap --res-mode 1080p2cams --framerate 30.0 --fm true --save true --save-topview false --save-freeview false --loop 1

  b. MP4 output
   $ test-image-stitching --input input.nv12 --output output.mp4 --input-w 1920 --input-h 1080 --output-w 1920 --output-h 960 --dewarp-mode sphere --scale-mode local --enable-fisheyemap --res-mode 1080p2cams --framerate 30.0 --fm true --save true --save-topview false --save-freeview false --loop 1
3.2 4cameras tests

For surround view mode, the calibration files(intrinsic paramters and extrinsic parameters) should be stored in "FISHEYE_CONFIG_PATH" directory, and then export the path:

        export FISHEYE_CONFIG_PATH=/etc/xcam/calibration
  a. NV12 output
   $ test-image-stitching --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.nv12 --input-w 1280 --input-h 800 --output-w 1920 --output-h 640 --fisheye-num 4 --dewarp-mode bowl --scale-mode local --enable-fisheyemap --res-mode 1080p4cams --fm true --framerate 30.0 --save true --save-topview true --save-freeview true --loop 1

  b. MP4 output
   $ test-image-stitching --input input0.nv12 --input input1.nv12 --input input2.nv12 --input input3.nv12 --output output.mp4 --input-w 1280 --input-h 800 --output-w 1920 --output-h 640 --fisheye-num 4 --dewarp-mode bowl --scale-mode local --enable-fisheyemap --res-mode 1080p4cams --fm true --framerate 30.0 --save true --save-topview true --save-freeview true --loop 1

4. Test-gles-handler

Usage: test-gles-handler --type TYPE --input0 input.nv12 --input1 input1.nv12 --output output.nv12 ...
  --type              processing type, selected from: copy, remap, blend
  --input0            input image(NV12)
  --input1            input image(NV12)
  --output            output image(NV12/MP4)
  --in-w              optional, input width, default: 1280
  --in-h              optional, input height, default: 800
  --out-w             optional, output width, default: 1280
  --out-h             optional, output height, default: 800
  --save              optional, save file or not, select from [true/false], default: true
  --loop              optional, how many loops need to run, default: 1
  --help              usage
4.1 Quality tests
1) Copy test
 $ test-gles-handler --type copy --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000

2) Remap test
 $ test-gles-handler --type remap --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000

3) Blend test
 $ test-gles-handler --type blend --input0 input0.nv12 --input1 input1.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000
4.2 Performance tests
1) Copy test
 $ test-gles-handler --type copy --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

2) Remap test
 $ test-gles-handler --type remap --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

3) Blend test
 $ test-gles-handler --type blend --input0 input0.nv12 --input1 input1.nv12 --output output.mp4 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

5. Test-vk-handler

Usage: test-vk-handler --type TYPE --input0 input.nv12 --input1 input1.nv12 --output output.nv12 ...
  --type              processing type, selected from: copy, remap, blend
  --input0            input image(NV12)
  --input1            input image(NV12)
  --output            output image(NV12/MP4)
  --in-w              optional, input width, default: 1280
  --in-h              optional, input height, default: 800
  --out-w             optional, output width, default: 1280
  --out-h             optional, output height, default: 800
  --save              optional, save file or not, select from [true/false], default: true
  --loop              optional, how many loops need to run, default: 1
  --help              usage
5.1 Quality tests
1) Copy test
 $ test-vk-handler --type copy --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000

2) Remap test
 $ test-vk-handler --type remap --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000

3) Blend test
 $ test-vk-handler --type blend --input0 input0.nv12 --input1 input1.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1
5.2 Performance tests
1) Copy test
 $ test-vk-handler --type copy --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

2) Remap test
 $ test-vk-handler --type remap --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

3) Blend test
 $ test-vk-handler --type blend --input0 input0.nv12 --input1 input1.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

6. Test-soft-image

Usage: test-soft-image --type TYPE --input0 input.nv12 --input1 input1.nv12 --output output.nv12 ...
  --type              processing type, selected from: blend, remap
  --input0            input image(NV12)
  --input1            input image(NV12)
  --output            output image(NV12/MP4)
  --in-w              optional, input width, default: 1280
  --in-h              optional, input height, default: 800
  --out-w             optional, output width, default: 1280
  --out-h             optional, output height, default: 800
  --save              optional, save file or not, select from [true/false], default: true
  --loop              optional, how many loops need to run, default: 1
  --help              usage
6.1 Quality tests
1) Remap test
 $ test-soft-image --type remap --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000

2) Blend test
 $ test-vk-handler --type blend --input0 input0.nv12 --input1 input1.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save true --loop 1000
6.2 Performance tests
1) Remap test
 $ test-soft-image --type remap --input0 input0.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

2) Blend test
 $ test-vk-handler --type blend --input0 input0.nv12 --input1 input1.nv12 --output output.nv12 --in-w 1280 --in-h 800 --out-w 1280 --out-h 800 --save false --loop 1000

7. Test-video-stabilization

Usage: test-video-stabilization --input file --output file [--input-w width] [--input-h height] ...
  --input        input image(NV12)
  --output       output image(NV12)
  --input-w      optional, input width; default:1920
  --input-h      optional, input height; default:1080
  --gyro         input gyro pose data
  --save         optional, save file or not, select from [true/false], default: true
  --loop         optional, how many loops need to run for performance test, default: 1
  --help         usage
7.1 Quality tests
$ test-video-stabilization --input input.nv12 --output output.mp4 --gyro gyro-data.csv --save true
7.2 Performance tests
$ test-video-stabilization --input input.nv12 --output output.mp4 --gyro gyro-data.csv --save false --loop 100

8. Test-cl-image

Usage: test-cl-image [-t type] [-f format] ... [-i input] [-o output]
  -t type            specify image handler type
                     select from [demo, csc, dcp, wavelet-haar, 3d-denoise, fisheye]
  -f input_format    specify a input format
  -W image width     specify input image width
  -H image height    specify input image height
  -g output_format   specify a output format
                     select from [NV12, BA10, RGBA]
  -i input           specify input file path
  -o output          specify output file path
  -c csc_type        specify csc type, default:rgba2nv12
                     select from [rgbatonv12, yuyvtorgba, nv12torgba]
  -h                 help
8.1 Image processing tests
1) Demo test
 $ test-cl-image -t demo -f BA10 -i <inputfile> -o <outputfile>
   e.g.: $ test-cl-image -t demo -f BA10 -i capture.raw -o demo.raw

2) Color conversion test
  a. RGBA to NV12
   $ test-cl-image -t csc -f RGBA -i <inputfile> -o <outputfile> -c rgbatonv12
     e.g.: $ test-cl-image -t csc -f RGBA -i macc.rgba -o csc.nv12 -c rgbatonv12

  b. NV12 to RGBA
   $ test-cl-image -t csc -f NV12 -i <inputfile> -o <outputfile> -c nv12torgba
     e.g.: $ test-cl-image -t csc -f NV12 -i macc.nv12 -o macc.rgba -c nv12torgba

3) Dcp test
 $ test-cl-image -t dcp -f NV12 -i <inputfile> -o <outputfile>
   e.g.: $ test-cl-image -t dcp -f NV12 -i input.nv12 -o output.nv12

4) Wavelet test
  a. Haar-wavelet
   $ test-cl-image -t wavelet-haar -f NV12 -i <inputfile> -o <outputfile>
     e.g.: $ test-cl-image -t wavelet-haar -f NV12 -i input.nv12 -o output.nv12

5) 3D-Denoise test
 $ test-cl-image -t 3d-denoise -f NV12 -i <inputfile> -o <outputfile>
   e.g.: $ test-cl-image -t 3d-denoise -f NV12 -i input.nv12 -o output.nv12

6) fisheye test
 $ test-cl-image -t 3d-denoise -f NV12 -i <inputfile> -o <outputfile>
   e.g.: $ test-cl-image  -t fisheye -f NV12 -i input.nv12 -o output.nv12

9. xcamfilter plugin

9.1 Preview with videotestsrc plugin
Command on linux PC:
  $ gst-launch-1.0 -v tcpserversrc host=0.0.0.0 port=3000 ! queue max-size-bytes=0 ! h264parse ! queue ! avdec_h264 ! videoconvert ! video/x-raw, format=BGRx ! ximagesink sync=false

Command on camera device:
  $ gst-launch-1.0 videotestsrc ! video/x-raw,format=NV12,width=1920,height=1080 ! xcamfilter copy-mode=1 ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false
9.2 Preview with filesrc plugin
Command on linux PC:
  $ gst-launch-1.0 -v tcpserversrc host=0.0.0.0 port=3000 ! queue max-size-bytes=0 ! h264parse ! queue ! avdec_h264 ! videoconvert ! video/x-raw, format=BGRx ! ximagesink sync=false

Command on camera device:
  1) Normal preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  2) Haar-Wavelet preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 wavelet-mode=5 ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  3) Haar-BayesShrink preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 wavelet-mode=6 ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  4) Dcp preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 defog-mode=dcp ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  5) Wireframe preview (need face detection plugin)
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 enable-wireframe=true ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  6) 3D-Denoise preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 denoise-3d=yuv ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  7) DVS preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 buffercount=32 enable-warp=1 ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false

  8) Stitch preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 enable-stitch=true stitch-scale=local stitch-fisheye-map=true stitch-lsc=true stitch-fm-ocl=true stitch-res-mode=1080p ! video/x-raw, foramt=NV12, width=1920, height=960 ! queue ! vaapiencode_h264 rate-control=cbr ! tcpclientsink host="192.168.1.3" port=3000 blocksize=1024000 sync=false
9.3 Record videos
Command on camera device:
  1) Normal preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 enable-wireframe=true ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  2) Haar-Wavelet preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 wavelet-mode=5 ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  3) Haar-BayesShrink preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 wavelet-mode=6 ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  4) Dcp preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 defog-mode=dcp ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  5) Wireframe preview (need face detection plugin)
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 enable-wireframe=true ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  6) 3D-Denoise preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 denoise-3d=yuv ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  7) DVS preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 buffercount=32 enable-warp=1 ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4

  8) Stitch preview
   $ gst-launch-1.0 filesrc location=input.nv12 ! videoparse width=1920 height=1080 format=nv12 ! xcamfilter copy-mode=1 enable-stitch=true stitch-scale=local stitch-fisheye-map=true stitch-lsc=true stitch-fm-ocl=true stitch-res-mode=1080p ! video/x-raw, foramt=NV12, width=1920, height=960 ! queue ! vaapiencode_h264 rate-control=cbr ! qtmux ! filesink location=test.mp4