> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Launch arguments and startup commands

> Add your own flags to the Unreal command line, and send console commands to your app once the first frame is on screen.

Two settings let you shape how your Unreal app starts without shipping a new build. **Launch arguments** are appended to the command line Streampixel starts your app with. **Startup commands** are Unreal console commands the player sends to your app over the stream once the video is on screen.

In the dashboard, both live in the **Advanced** card at the bottom of **Project Settings → Quality**, just below **Bitrate**. Through the REST API they are `addLaunchArg` and `startupCommands` on [Update Project Settings](https://docs.streampixel.io/resources/api-reference/update-project-settings.md). Saved values apply to sessions that start afterwards; running sessions keep what they launched with.

## Launch arguments

Streampixel starts your app with its own flags: the signalling address, off-screen rendering, the resolution, encoder and bitrate you chose in the other settings tabs, and the log path. Your arguments go after them, and your app reads them like any other command-line argument.

Enter one argument per line in the dashboard. Through the API, `addLaunchArg` is one string with the arguments separated by spaces, e.g. `"-nosound -culture=tr"`; send `""` to clear.

Arguments a Streampixel operator set on your project earlier appear in the same box and can be edited or removed like your own. The rules below apply to everything you save, including those.

### Rules

* Each argument starts with a single dash and is a name, optionally followed by `=` and a value: `-nosound`, `-culture=tr`, `-ExecCmds=DisableAllScreenMessages`.
* The name starts with a letter and uses letters and digits only, up to 64 characters. The value, after `=`, is 1 to 160 characters of letters, digits and `. _ : / , + -`. No spaces, quotes or other punctuation, so an argument can never smuggle a second flag or command along.
* Up to 10 arguments, 600 characters in all.
* Flags Streampixel sets itself are refused; the table below lists them. Change resolution, codec and bitrate in their own settings tabs instead.

An argument that breaks a rule is refused when you save, and the message names it and says why.

### Refused flags

| Flags | Why |
| - | - |
| `-PixelStreamingIP`, `-PixelStreamingPort`, `-PixelStreamingURL`, `-PixelStreamingSignallingURL`, `-PixelStreamingID` | Where the app connects and who it says it is. Streampixel points every session at its own signalling server. |
| `-RenderOffScreen`, `-Unattended`, `-ForceRes`, `-ResX`, `-ResY` | How the app renders on the GPU host. Resolution comes from the [Resolution settings](https://docs.streampixel.io/resources/quick-start-guide/resolution-settings.md). |
| `-AllowPixelStreamingCommands` | Lets the player send console commands. Every session already has it; it is what makes startup commands work. |
| `-PixelStreamingEncoderCodec`, `-PixelStreamingNegotiateCodecs`, `-PixelStreamingEncoderMinQP`, `-PixelStreamingEncoderMaxQP`, `-PixelStreamingEncoderMinQuality`, `-PixelStreamingEncoderMaxQuality` | The encoder. Codec and quality come from the [Codec settings](https://docs.streampixel.io/resources/quick-start-guide/codec-settings.md) and the QP fields of the Resolution settings. |
| `-PixelStreamingWebRTCStartBitrate`, `-PixelStreamingWebRTCMinBitrate`, `-PixelStreamingWebRTCMaxBitrate` | Bitrate, set in the Bitrate section of the Resolution settings. |
| `-PixelStreamingEnableHMD` | VR streaming. Streampixel switches it on for VR projects. |
| `-ABSLOG`, `-log` | Where the Unreal log is written. Streampixel sets the path so the session logs can collect it. |

The check ignores case, so `-resx=1920` is refused as well.

> [!TIP]
>
> Unreal's own `-ExecCmds=` flag runs console commands the moment the process starts, with no delay and before the first frame. It must follow the argument rules above, so it suits commands written without spaces, such as `-ExecCmds=DisableAllScreenMessages`. A command that needs a space, such as `stat fps`, or that should wait until the scene is up, belongs in the startup commands below.

## Console commands after the stream starts

Each row is a delay and an Unreal console command. The share page (`share.streampixel.io`, and any page that embeds it in an iframe) sends the command to your app over the stream's data channel that many seconds after the first video frame is on screen — the same channel the player's resolution picker uses. There is nothing to enable in your build: Streampixel launches every session with `-AllowPixelStreamingCommands`.

### Rules

* Up to 10 rows, sent in the order you list them.
* Delay: a whole number of seconds from the first frame, 0 to 600. `0` sends as soon as the video appears.
* Command: 1 to 200 characters on one line. Only commands your build understands do anything; a Shipping build has fewer console commands than a Development build.
* The commands are sent again after every reconnect, because the video starts again. See the warning below.
* They are not sent by guests in a shared (SFU) room, since one Unreal app serves everyone in the room.
* The Web SDK sends nothing automatically. Call [`emitConsoleCommand`](https://docs.streampixel.io/resources/web-sdk/api-reference/pixelstreaming) yourself after the `videoInitialized` event.

A row that breaks a rule is refused when you save, and the message names the row.

> [!WARNING]
>
> Because the commands run again after a reconnect, prefer commands that are safe to repeat. `stat fps` is a toggle: a reconnect switches the counter off again. Commands that set a state, such as `t.MaxFPS 30` or `ce StartTour`, do the same thing every time.

## Examples

Turn the audio off, show the frame counter 5 seconds in, and start a tour after 30 seconds (`ce` fires a custom event in your level blueprint):

| Setting | Value |
| - | - |
| Launch arguments | `-nosound` |
| Command after 5 s | `stat fps` |
| Command after 30 s | `ce StartTour` |

The same settings through the API:

```json theme={"dark"}
{
  "addLaunchArg": "-nosound",
  "startupCommands": [
    { "delaySec": 5, "command": "stat fps" },
    { "delaySec": 30, "command": "ce StartTour" }
  ]
}
```

## Next steps

> [card] [Update Project Settings](https://docs.streampixel.io/resources/api-reference/update-project-settings.md)
>
> Set `addLaunchArg` and `startupCommands` from a script.

> [card] [Console commands from your own page](https://docs.streampixel.io/resources/web-sdk/features/communicating-with-ue.md)
>
> `emitConsoleCommand` and JSON messaging in the Web SDK.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.