11 fprintf(stderr, "Usage: nageru [OPTION]...\n");
12 fprintf(stderr, "\n");
13 fprintf(stderr, " -h, --help print usage information\n");
14 fprintf(stderr, " -c, --num-cards set number of input cards (default 2)\n");
15 fprintf(stderr, " -t, --theme=FILE choose theme (default theme.lua)\n");
16 fprintf(stderr, " -v, --va-display=SPEC VA-API device for H.264 encoding\n");
17 fprintf(stderr, " ($DISPLAY spec or /dev/dri/render* path)\n");
18 fprintf(stderr, " --http-uncompressed-video send uncompressed NV12 video to HTTP clients\n");
19 fprintf(stderr, " --http-x264-video send x264-compressed video to HTTP clients\n");
20 fprintf(stderr, " --http-mux=NAME mux to use for HTTP streams (default " DEFAULT_STREAM_MUX_NAME ")\n");
21 fprintf(stderr, " --http-audio-codec=NAME audio codec to use for HTTP streams\n");
22 fprintf(stderr, " (default is to use the same as for the recording)\n");
23 fprintf(stderr, " --http-audio-bitrate=KBITS audio codec bit rate to use for HTTP streams\n");
24 fprintf(stderr, " (default is %d, ignored unless --http-audio-codec is set)\n",
25 DEFAULT_AUDIO_OUTPUT_BIT_RATE / 1000);
26 fprintf(stderr, " --http-coarse-timebase use less timebase for HTTP (recommended for muxers\n");
27 fprintf(stderr, " that handle large pts poorly, like e.g. MP4)\n");
28 fprintf(stderr, " --flat-audio start with most audio processing turned off\n");
29 fprintf(stderr, " --no-flush-pbos do not explicitly signal texture data uploads\n");
30 fprintf(stderr, " (will give display corruption, but makes it\n");
31 fprintf(stderr, " possible to run with apitrace in real time)\n");
34 void parse_flags(int argc, char * const argv[])
36 static const option long_options[] = {
37 { "help", no_argument, 0, 'h' },
38 { "num-cards", required_argument, 0, 'c' },
39 { "theme", required_argument, 0, 't' },
40 { "va-display", required_argument, 0, 1000 },
41 { "http-uncompressed-video", no_argument, 0, 1001 },
42 { "http-x264-video", no_argument, 0, 1008 },
43 { "http-mux", required_argument, 0, 1004 },
44 { "http-coarse-timebase", no_argument, 0, 1005 },
45 { "http-audio-codec", required_argument, 0, 1006 },
46 { "http-audio-bitrate", required_argument, 0, 1007 },
47 { "flat-audio", no_argument, 0, 1002 },
48 { "no-flush-pbos", no_argument, 0, 1003 },
53 int c = getopt_long(argc, argv, "c:t:", long_options, &option_index);
60 global_flags.num_cards = atoi(optarg);
63 global_flags.theme_filename = optarg;
66 global_flags.va_display = optarg;
69 global_flags.uncompressed_video_to_http = true;
72 global_flags.stream_mux_name = optarg;
75 global_flags.stream_coarse_timebase = true;
78 global_flags.stream_audio_codec_name = optarg;
81 global_flags.stream_audio_codec_bitrate = atoi(optarg) * 1000;
84 global_flags.x264_video_to_http = true;
87 global_flags.flat_audio = true;
90 global_flags.flush_pbos = false;
96 fprintf(stderr, "Unknown option '%s'\n", argv[option_index]);
97 fprintf(stderr, "\n");
103 if (global_flags.uncompressed_video_to_http &&
104 global_flags.x264_video_to_http) {
105 fprintf(stderr, "ERROR: --http-uncompressed-video and --http-x264-video are mutually incompatible\n");