Headless Mode
MONO can run without showing a window. It completes the task specified by its command-line arguments, then exits automatically, which makes it easy to integrate into scripts or other tools.
Currently, headless mode supports batch processing of video files only. The processing is the same as Batch Processing.
Launching
Asynchronous
The command returns immediately. MONO processes the task in the background and exits when it is done. Progress and results are written to the files given by -progress and -report.
- cmd
- Python
Open a Command Prompt (cmd) in the MONO installation folder and run the following command.
Dollars_MONO.exe -batchmode -input "D:\videos\a.mp4" "D:\videos\more" -out "D:\output" -report "D:\output\report.json" -progress "D:\output\progress.txt"
import os
import subprocess
import time
exe = r"C:\Program Files\Dollars MONO\Dollars_MONO.exe" # replace with your installation path
progress = r"D:\output\progress.txt"
p = subprocess.Popen([
exe, "-batchmode",
"-input", r"D:\videos\a.mp4", r"D:\videos\more",
"-out", r"D:\output",
"-report", r"D:\output\report.json",
"-progress", progress,
])
while p.poll() is None: # still running
if os.path.exists(progress):
print(open(progress).read())
time.sleep(1)
print(p.returncode) # exit code
Synchronous
The command waits for MONO to finish before returning, so you can read the exit code directly. An exit code of 0 indicates that all videos were processed successfully. While MONO is running, you can also check progress in the file given by -progress.
- cmd
- Python
Open a Command Prompt (cmd) in the MONO installation folder and run the following two commands. start /wait makes cmd wait until MONO exits, and echo %errorlevel% shows the exit code.
start /wait "" Dollars_MONO.exe -batchmode -input "D:\videos\a.mp4" "D:\videos\more" -out "D:\output" -report "D:\output\report.json"
echo %errorlevel%
import subprocess
exe = r"C:\Program Files\Dollars MONO\Dollars_MONO.exe" # replace with your installation path
result = subprocess.run([
exe, "-batchmode",
"-input", r"D:\videos\a.mp4", r"D:\videos\more",
"-out", r"D:\output",
"-report", r"D:\output\report.json",
])
print(result.returncode) # exit code
Requirements
- Available to licensed users only.
- In MONO, select Remember me and sign in at least once.
Arguments
| Argument | Optional | Description |
|---|---|---|
-batchmode | No | Runs MONO in headless mode. |
-input path... | No | One or more video files or folders. For a folder, only mp4, avi, mov, mkv and webm files in the folder's top level are processed. |
-out folder | Yes | Export folder. |
-face none|egao|nvis | Yes | Face capture module. |
-hands on|off | Yes | Enhanced hands. |
-format fbx|bvh|bvh_cascadeur|bvh_vam|vam_timeline | Yes | Export format. |
-report file | Yes | Result file (JSON). |
-progress file | Yes | Progress file, updated every second. |
If -out, -face, -hands or -format is not given, the setting in the MONO interface is used. If -report or -progress is not given, that file is not created.
Options given as arguments apply to this run only and are not saved to your settings.
Results
An example of the -report file:
{
"exit_code": 0,
"error": null,
"videos": [
{"input": "D:\\videos\\a.mp4", "status": "completed", "output": "D:\\output\\a.fbx", "face_output": null, "error": null}
]
}
The status of each video is completed, failed or skipped.
An example of the -progress file:
progress=0.420
videos_done=1
video_count=3
progress is the progress of the whole batch, from 0 to 1. When processing ends, an exit_code line is added to the file.
Exit Codes
| Exit code | Description |
|---|---|
| 0 | All videos completed successfully |
| 1 | Invalid arguments, or no videos to process |
| 2 | Insufficient license |
| 3 | Some videos failed |