ACMX 2.136.0
Dual-Backend Real-Time GPU Video Synthesis
Loading...
Searching...
No Matches
options.hpp
Go to the documentation of this file.
1#ifndef ACMXVK_APP_OPTIONS_HPP
2#define ACMXVK_APP_OPTIONS_HPP
3
4#include <array>
5#include <cstdint>
6#include <filesystem>
7#include <iosfwd>
8#include <string>
9#include <string_view>
10#include <vector>
11
12namespace acmxvk {
13 namespace fs = std::filesystem;
14
15 constexpr std::array<std::string_view, 35> CROSSFADE_NAMES{
16 "xfade_01_linear", "xfade_02_block",
17 "xfade_03_wipe", "xfade_04_radial",
18 "xfade_05_pixelate", "xfade_06_dissolve",
19 "xfade_07_swirl", "xfade_08_glitch",
20 "xfade_09_diamond", "xfade_10_burn",
21 "xfade_11_fade_black", "xfade_12_fade_white",
22 "xfade_13_slide_left", "xfade_14_slide_right",
23 "xfade_15_slide_up", "xfade_16_slide_down",
24 "xfade_17_diagonal_wipe", "xfade_18_iris_open",
25 "xfade_19_iris_close", "xfade_20_checker",
26 "xfade_21_blinds_h", "xfade_22_blinds_v",
27 "xfade_23_zoom_in", "xfade_24_zoom_out",
28 "xfade_25_rotate", "xfade_26_ripple",
29 "xfade_27_wave", "xfade_28_chroma",
30 "xfade_29_invert", "xfade_30_flash",
31 "xfade_31_explode", "xfade_32_mosaic",
32 "xfade_33_shutter", "xfade_34_luma",
33 "xfade_35_noise"};
34
39
40 struct Options {
41 int width = 1280;
42 int height = 720;
43 int camera_width = 1280;
44 int camera_height = 720;
47 int shader_index = 0;
48 int encode_crf = 18;
49 std::int64_t encode_bitrate = 0;
53 int cache_delay = 1;
60 int midi_device = -1;
62 int cuda_device = 0;
64 int dream_size = 512;
65 int dream_channel = -1;
67 int dream_jitter = 0;
69 double requested_fps = 0.0;
70 double duration = 0.0;
71 double cross_fade_duration = 0.5;
72 double time_speed = 1.0;
73 double max_size_mb = 0.0;
74 double audio_sensitivity = 1.0;
75 double audio_warm_rate = 0.5;
78 double human_black_point = 0.35;
79 double human_white_point = 0.75;
80 double dream_strength = 0.05;
81 double dream_feedback = 0.9;
82 double dream_zoom = 1.01;
83 double dream_rotation = 0.1;
84 double dream_octave_scale = 1.4;
87 bool use_yuv = false;
88 bool maximize_fps = false;
89 bool use_source_fps = false;
90 bool use_source_audio = false;
91 bool fullscreen = false;
92 bool headless = false;
93 bool repeat = false;
94 bool enable_vsync = false;
95 bool enable_screenshot = false;
96 bool enable_playlist = false;
98 bool history_test = false;
99 bool enable_3d = false;
100 bool normalized_time = false;
101 bool flip_output = false;
102 bool png_output = false;
103 bool encode_realtime = false;
104 bool no_drop = false;
105 bool copy_audio = false;
106 bool mute_output = false;
107 bool enable_audio = false;
113 bool audio_pass_through = false;
114 bool audio_repeat = false;
115 bool audio_trunc = false;
116 bool list_audio_devices = false;
118 bool check_audio = false;
120 bool midi_monitor = false;
121 bool list_midi_devices = false;
122 bool check_midi = false;
125 bool list_gpu_filters = false;
126 bool list_cuda_devices = false;
127 bool check_cuda = false;
128 bool check_dnn = false;
129 bool check_deep_dream = false;
136 bool dream_fp16 = false;
143 bool dream_headless = false;
144 bool deep_original = false;
146 bool human_background = false;
149 bool list_encoders = false;
150 bool display_filter = false;
151 bool disable_counter = false;
152 bool build_fix = false;
153 bool build_prune = false;
154 bool build_force = false;
156 bool unbuffered_output = false;
157 bool interface_shm = false;
158 bool show_help = false;
160 std::vector<int> shader_pass_indices;
161 std::vector<std::string> shader_pass_files;
162 std::vector<std::string> custom_uniform_overrides;
163 std::vector<std::string> midi_cc_mappings;
164 std::vector<int> gpu_filter_indices;
165 std::string input_file;
166 std::string graphic_file;
167 std::string shader_directory;
168 std::string fragment_shader;
169 std::string compute_shader;
170 std::string shader_file;
171 std::string build_manifest;
172 std::string build_directory;
173 std::string glslc_executable = "glslc";
174 std::string model_file;
175 std::string playlist_file;
176 std::string output_file;
177 std::string encode_preset = "medium";
178 std::string encode_tune;
179 std::string encode_codec = "auto";
180 std::string encode_params;
182 std::string probe_hdr_file;
183 std::string audio_file;
184 std::string record_audio_file;
185 std::string midi_map_file;
186 std::string edge_model;
187 std::string human_model;
189 std::string dream_model;
190 std::string dream_layer;
191 std::string snapshot_directory = ".";
193 std::string watermark_text;
194 std::array<std::uint8_t, 3> watermark_color{255U, 0U, 150U};
195 };
196
197 [[nodiscard]] bool dimensions_supported(int width, int height);
198 [[nodiscard]] int parseInteger(std::string_view text, std::string_view option);
199 [[nodiscard]] double parseNumber(std::string_view text, std::string_view option);
200 [[nodiscard]] Options parseOptions(int argc, char **argv);
201 void printHelp(std::ostream &output);
202 void printEncoders(std::ostream &output);
203 [[nodiscard]] bool printEncoderOptions(std::string_view encoder_name, std::ostream &output, std::ostream &error);
204 [[nodiscard]] std::string trim(std::string text);
205
206} // namespace acmxvk
207
208#endif
void printEncoders(std::ostream &output)
Definition options.cpp:1584
void printHelp(std::ostream &output)
Definition options.cpp:1382
std::string trim(std::string text)
Definition options.cpp:1619
int parseInteger(std::string_view text, std::string_view option)
Definition options.cpp:168
bool dimensions_supported(int width, int height)
Definition options.cpp:63
bool printEncoderOptions(std::string_view encoder_name, std::ostream &output, std::ostream &error_output)
Definition options.cpp:1596
FrameRotation
Definition options.hpp:35
Options parseOptions(int argc, char **argv)
Definition options.cpp:382
double parseNumber(std::string_view text, std::string_view option)
Definition options.cpp:186
constexpr std::array< std::string_view, 35 > CROSSFADE_NAMES
Definition options.hpp:15
std::string encode_params
Definition options.hpp:180
bool gpu_buffer_specified
Definition options.hpp:123
int audio_output_device
Definition options.hpp:58
std::string edge_model
Definition options.hpp:186
std::string snapshot_directory
Definition options.hpp:191
std::string shader_file
Definition options.hpp:170
double max_size_mb
Definition options.hpp:73
bool dream_zoom_specified
Definition options.hpp:133
std::int64_t encode_bitrate
Definition options.hpp:49
bool unbuffered_output
Definition options.hpp:156
bool midi_device_specified
Definition options.hpp:119
std::string glslc_executable
Definition options.hpp:173
double audio_recording_gain
Definition options.hpp:77
std::vector< int > shader_pass_indices
Definition options.hpp:160
bool dream_octave_scale_specified
Definition options.hpp:139
double dream_octave_scale
Definition options.hpp:84
std::string encode_codec
Definition options.hpp:179
std::string dream_layer
Definition options.hpp:190
bool cuda_device_specified
Definition options.hpp:124
bool use_source_audio
Definition options.hpp:90
double time_speed
Definition options.hpp:72
double random_dream_interval
Definition options.hpp:85
std::string build_manifest
Definition options.hpp:171
bool gpu_filter_before_dream
Definition options.hpp:145
std::string dream_model
Definition options.hpp:189
bool dream_rotation_specified
Definition options.hpp:134
double audio_pass_through_gain
Definition options.hpp:76
std::string build_directory
Definition options.hpp:172
double dream_rotation
Definition options.hpp:83
std::vector< std::string > custom_uniform_overrides
Definition options.hpp:162
bool dream_feedback_specified
Definition options.hpp:132
std::string fragment_shader
Definition options.hpp:168
std::vector< std::string > shader_pass_files
Definition options.hpp:161
double duration
Definition options.hpp:70
bool random_dream_specified
Definition options.hpp:142
std::string audio_file
Definition options.hpp:183
bool audio_recording_gain_specified
Definition options.hpp:112
bool audio_input_specified
Definition options.hpp:108
std::string resource_directory
Definition options.hpp:192
bool human_background
Definition options.hpp:146
FrameRotation frame_rotation
Definition options.hpp:159
std::string output_file
Definition options.hpp:176
int texture_cache_size
Definition options.hpp:55
bool list_camera_devices
Definition options.hpp:117
std::string midi_map_file
Definition options.hpp:185
std::string model_file
Definition options.hpp:174
bool enable_playlist
Definition options.hpp:96
std::vector< int > gpu_filter_indices
Definition options.hpp:164
std::string watermark_text
Definition options.hpp:193
double dream_feedback
Definition options.hpp:81
std::vector< std::string > midi_cc_mappings
Definition options.hpp:163
std::string graphic_file
Definition options.hpp:166
double dream_strength
Definition options.hpp:80
int audio_input_device
Definition options.hpp:57
bool audio_warm_rate_specified
Definition options.hpp:109
double audio_warm_rate
Definition options.hpp:75
bool list_cuda_devices
Definition options.hpp:126
std::string shader_directory
Definition options.hpp:167
std::string onnx_configuration
Definition options.hpp:188
std::string encode_tune
Definition options.hpp:178
std::string record_audio_file
Definition options.hpp:184
std::string human_model
Definition options.hpp:187
int gpu_frame_buffer_size
Definition options.hpp:61
bool list_audio_devices
Definition options.hpp:116
std::string playlist_file
Definition options.hpp:175
bool dream_channel_specified
Definition options.hpp:137
double dream_zoom
Definition options.hpp:82
bool dream_smoothing_specified
Definition options.hpp:141
double requested_fps
Definition options.hpp:69
bool dream_jitter_specified
Definition options.hpp:140
int enumerate_camera_device
Definition options.hpp:46
std::array< std::uint8_t, 3 > watermark_color
Definition options.hpp:194
bool enable_texture_cache
Definition options.hpp:97
bool check_deep_dream
Definition options.hpp:129
std::string list_encoder_options
Definition options.hpp:181
std::string encode_preset
Definition options.hpp:177
bool audio_output_specified
Definition options.hpp:110
std::string input_file
Definition options.hpp:165
bool dream_size_specified
Definition options.hpp:135
bool list_midi_devices
Definition options.hpp:121
double cross_fade_duration
Definition options.hpp:71
bool dream_octaves_specified
Definition options.hpp:138
bool dream_iterations_specified
Definition options.hpp:130
bool resolution_specified
Definition options.hpp:86
bool audio_pass_through
Definition options.hpp:113
bool enable_screenshot
Definition options.hpp:95
bool build_parallel_specified
Definition options.hpp:155
std::string probe_hdr_file
Definition options.hpp:182
double human_black_point
Definition options.hpp:78
bool audio_pass_through_gain_specified
Definition options.hpp:111
double human_white_point
Definition options.hpp:79
bool use_source_fps
Definition options.hpp:89
int autopilot_random_timeout
Definition options.hpp:51
bool human_white_specified
Definition options.hpp:148
int generate_interval
Definition options.hpp:52
bool list_gpu_filters
Definition options.hpp:125
bool human_black_specified
Definition options.hpp:147
std::string compute_shader
Definition options.hpp:169
double audio_sensitivity
Definition options.hpp:74
bool dream_strength_specified
Definition options.hpp:131