PIX4Dengine CLI - Obsolete

How to use the command line - PIX4Dengine SDK

This article explains what command line options are available when using PIX4Dengine SDK to create and process a project.

Warning: This article refers to the command line interface (CLI) and not to the newest version of PIX4Dengine SDK.
We highly recommend migrating to the PIX4Dengine SDK. To get access to the latest documentation, please visit PIX4Dengine Server SDK.
Note: The command line has to be used with a PIX4Dengine in a Linux and Windows environment.

It is possible to use the command line to create and process projects. Not all options can be changed. In many cases, it is possible to create a .p4d file to change the options that cannot be changed through the command line: .p4d minimum format.

To use the command line access the folder where PIX4Dmapper is installed and run the command:

pix4dmapper.exe -h

commandline.jpg

This displays the help which lists the options and commands that can be used.

The syntax of the command line is:

pix4dmapper [options] [project file]

The following command line options are available:

Important:
When processing a project, the processing parameters saved in the .p4d project file are used. If the processing parameters are modified through the command line using a template file, they are saved in the .p4d project file and used for processing.



General Options

Name
Description
-h [ --help ]
Print command line help and exit.
-v [ --version ]
Print version and exit.
-c [ --cmdline ]
Command line mode (does not open the user interface).
If nothing is specified will use --run. Can also be used with --initial, --dense, --ortho or --new.
--close-gui
Close GUI after processing.
Can only be used together with --run.
It is ignored when used in command line mode.
--cam-param-project
Use camera parameters from the project file even if the database has different parameters.
--cam-param-db
Use camera parameters from the database even if the project file has different parameters.
--disable-user-cam-db
Disable user camera database. Only the build-in database is used.
--email arg
Log in with the Pix4D account email.
Can only be used together with --password.
--password arg
Log in with the Pix4D account password.
Can only be used together with --email.
--logout
Logout from the software.
Example:

Open a project

pix4dmapper <project_file>

pix4dmapper D:\mining\quarry.p4d

Print the software help

pix4dmapper -h

pix4dmapper -h

Print the software version

pix4dmapper -v

pix4dmapper -v

Running the processing steps defined in the .p4d processing options in command line mode, without opening the user interface

pix4dmapper -c -r <project_file>

pix4dmapper -c -r D:\mining\quarry.p4d

Running the processing steps defined in the .p4d processing options, opening the user interface before processing and closing it after processing

pix4dmapper -r --close-gui <project_file>

pix4dmapper -r --close-gui D:\mining\quarry.p4d

Running step 1. Initial Processing, using the camera parameters from the project .p4d file, without opening the user interface

pix4dmapper -c --cam-param-project -i <project_file>

pix4dmapper -c --cam-param-project -i D:\mining\quarry.p4d

Running step 1. Initial Processing, using the camera parameters from the internal camera model database, without opening the user interface

pix4dmapper -c --cam-param-db -i <project_file>

pix4dmapper -c --cam-param-db -i D:\mining\quarry.p4d

Example --disable-user-cam-db

pix4dmapper -c --disable-user-cam-db -i <project_file>

pix4dmapper -c --disable-user-cam-db -i D:\mining\quarry.p4d

Log in the software, without opening the user interface

pix4dmapper -c --email <email> --password <password>

pix4dmapper -c --email j.doe@pix4d.com --password jpwd

Log in the software and run the project, without opening the user interface

pix4dmapper -c --email <email> --password <password> -r <project_file>

pix4dmapper -c --email j.doe@pix4d.com --password jpwd -r D:\mining\quarry.p4d

Log out from the software, without opening the user interface

pix4dmapper --logout

pix4dmapper --logout


New Project Creation

Name
Description
-n [ --new ]
Create new project.
--image-dir arg
Image directory.
Can only be used with --new and --cmdline.
--geolocation-format arg
Geolocation file format. The following can be
selected:
  • 3drobotics: for "3D Robotics" flight log.
  • pix4d-lat-long: for "Latitude - Longitude - Altitude" Pix4D's file format.
  • pix4d-long-lat: for "Longitude - Latitude - Altitude" Pix4D's file format.
  • pix4d-x-y: For "X - Y - Z" Pix4D's file format.
  • pix4d-y-x: For "Y - X - Z" Pix4D's file format.
Can only be used with --new and --cmdline.
--geolocation-file arg
Geolocation file. is the path to the geolocation file.
Can only be used with --new and --cmdline.
--ignore-non-geotagged
Does not add images to the project that have no image geolocation in the EXIF data.
--cam-bands arg
Use specified camera bands. is a comma-separated list of camera bands.
If the band names contain spaces, the list has be surrounded by quotation marks. Example: "Red edge, Green, Blue".
--split-image-dir arg
Save split multi-page images to . Can only be used together with --new.
--disable-cs-guess
Don't try to guess the project output coordinate system. The user will be prompted to enter it when opening the project in GUI mode.
Example:

Creating a new project with image geolocation in the EXIF data, without opening the user interface

pix4dmapper -c -n --image-dir <image_directory> <project_file>

pix4dmapper -c -n --image-dir D:\mining\Images D:\mining\quarry.p4d

Creating a new project without image geolocation, without opening the user interface

pix4dmapper -c -n --image-dir <image_directory> <project_file>

pix4dmapper -c -n --image-dir D:\mining\Images D:\mining\quarry.p4d

Creating a new project with image geolocation from file, without opening the user interface

pix4dmapper -c -n --image-dir <image_directory> --geolocation-format <geolocation_file_format> --geolocation-file <geolocation_file> <project_file>

pix4dmapper -c -n --image-dir D:\mining\Images --geolocation-format pix4d-lat-long --geolocation-file D:\mining\Inputs\imagePositionsLatLongAlt.csv D:\mining\quarry.p4d


Project Processing

Name
Description
-r [ --run ]
Run project. If no other option is specified, runs all steps defined in the processing options of the project.
-i [ --initial ]
Run step 1. Initial Processing.
-d [ --dense ]
Run step 2. Point Cloud and Mesh.
Can only be used if step 1. Initial Processing is completed or if it used together with --initial.
-o [ --ortho ]
Run step 3. DSM, Orthomosaic and Index.
Can only be used if step 1. Initial Processing is completed or if it is used together with --initial.
Can also be used in combination with --dense or after step 2. Point Cloud and Mesh has been completed.
--template arg
Initialize processing options using a processing options template. Can be used with --new, --run, --initial, --dense, --ortho.

can be:
: Use --template-list to display the list of pre-defined templates.
: Path to a custom template .tmpl file. The custom template file can be generated either using the user interface or by creating the file manually: How to create a Processing Options Template .tmpl File.
--template-list
Display the list of pre-defined templates.
Example:

Running all processing steps defined in the processing options, without opening the user interface

pix4dmapper -c -r <project_file>

pix4dmapper -c -r D:\mining\quarry.p4d

Running step 1. Initial Processing, without opening the user interface

pix4dmapper -c -i <project_file>

pix4dmapper -c -i D:\mining\quarry.p4d

Running step 2. Point Cloud and Mesh, without opening the user interface

pix4dmapper -c -d <project_file>

pix4dmapper -c -d D:\mining\quarry.p4d

Running step 3. DSM, Orthomosaic and Index, without opening the user interface

pix4dmapper -c -o <project_file>

pix4dmapper -c -o D:\mining\quarry.p4d

Creating a new project, using the 3D Maps pre-defined template to initialize the processing options, without opening the user interface. The image geolocation is loaded from the EXIF data.

pix4dmapper -c -n --image-dir <image_directory> --template 3d-maps <project_file>

pix4dmapper -c -n --image-dir D:\mining\Images --template 3d-maps D:\mining\quarry.p4d

Creating a new project, using a .tmpl template file to initialize the processing options, without opening the user interface. The image geolocation is loaded from the EXIF data.

pix4dmapper -c -n --image-dir <image_directory> --template <template_file> <project_file>

pix4dmapper -c -n --image-dir D:\mining\Images --template D:\mining\dsm_with_contours.tmpl D:\mining\quarry.p4d

Display pre-defined template list

pix4dmapper --template-list

pix4dmapper --template-list

Resources Options

Name
Description
--max-cpus arg
Maximum number of CPU threads to use for processing.
is an integer between 1 and the maximum number of CPU threads available on the current device.
Can only be used with --run, --initial, --dense, --ortho.
--use-cuda arg

Enable/disable all CUDA capable GPUs. <arg> can be:

  • yes
  • no
Can only be used with --run, --initial, --dense, --ortho.
Example:

Running the processing steps defined in the processing options, using a maximum of 16 CPU threads, without opening the user interface

pix4dmapper -c -r --max-cpus 16 <project_file>

pix4dmapper -c -r --max-cpus 16 D:\mining\quarry.p4d

Running step 1. Initial Processing, using a maximum of 16 CPU threads, without opening the user interface

pix4dmapper -c -i --max-cpus 16 <project_file>

pix4dmapper -c -i --max-cpus D:\mining\quarry.p4d

Running the processing steps defined in the processing options, with all CUDA capable GPUs enabled, without opening the user interface

pix4dmapper -c -r --use-cuda yes <project_file>

pix4dmapper -c -r --use-cuda yes D:\mining\quarry.p4d

Output Stream

PIX4Dmapper outputs two different streams: Stdout (containing the messages labeled as Info, UI, and Processing) and Stderr (containing the messages labeled as Error and Warning). For more information about these labels: Menu View > Log Output.

The Stderr messages are always outputted. The outputting of the stdout messages depends on whether PIX4Dmapper is running in command line mode (using the -c option) or not. The options --stdout and --no-stdout allow the user to modify this behavior.

Command line argument
Stdout
Stderr
pix4dmapper.exe
Silent
Verbose
pix4dmapper.exe --stdout
Verbose
Verbose
pix4dmapper.exe -c
Verbose
Verbose
pix4dmapper -c --no-stdout
Silent
Verbose