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

# 管理遊戲串流 (xbgamestream.exe)

> 管理遊戲串流 (xbgamestream.exe)

使用此工具查詢主機目前是否已啟用遊戲串流，並管理此狀態。

## 命令

| 命令 | 描述 |
| :- | :- |
| listconfigs | 列出主機支援的串流基本設定。 |
| startlistening | 開始在主機上接聽直接連線串流連線。 |
| stoplistening | 停止在主機上接聽直接連線串流連線。 |
| status | 查詢主機的串流狀態。 |
| enableremoteconnect | 為指定的使用者啟用遠端連線。此設定在裝置重新開機後仍會保留。 |
| disableremoteconnect | 為指定的使用者停用遠端連線。此設定在裝置重新開機後仍會保留。 |
| remoteconnectstatus | 查詢指定使用者的遠端連線狀態。 |
| setconfigoverride | 設定基本串流設定的一或多個設定覆寫。直接連線的基本串流設定由 'startlistening' 命令的 'config' 參數指定。遠端連線的基本串流設定由 XBOX 服務決定。設定覆寫會在直接連線的 'startlistening' 時，以及遠端連線的新串流連線上套用。覆寫在重新開機後不會保留，如有需要，必須在重新開機後重新設定。 |
| clearconfigoverride | 清除使用 'setconfigoverride' 命令設定的一或多個設定覆寫。 |
| dumpconfigoverride | 將使用 'setconfigoverride' 命令設定的所有設定覆寫寫入主控台。 |
| /LC | 指定地區設定代碼。用於覆寫預設的地區設定代碼 |

## 全域旗標

下表中的旗標適用於所有命令。

| 欄 1 |
| - |
| **xbgamestream** \[/X\[*:address*] \[*+accesskey*] ] |

| 旗標 | 描述 |
| - | - |
| /X\[*:address*] \[*+accesskey*] | - 使用此選項可指定目標主機的主機名稱或位址 (在主機上顯示為 **Tools IP**)，而不需變更預設主機。如需為主機設定主機名稱的詳細資訊，請參閱[為主機 IP 位址設定主機名稱](https://docs.xbox.com/zh-TW/home/setup-install/dev-kit-settings/setting-a-hostname.md)。 - 如果您不使用此選項，則會使用預設主機 (先前由[連線 (xbconnect.exe)](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/xbconnect.md) 設定)。 - 使用 *accesskey* 字串，只為擁有存取金鑰的人員提供主機存取權。 - 使用 **xbconfig** **accesskey=your-key** 命令設定存取金鑰，然後重新啟動主機，讓存取金鑰生效。 - 若要存取已設定存取金鑰的主機，請在主機的 IP 位址或主機名稱後面加上加號 (+) 與存取金鑰。 - 如果在使用 [xbconnect](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/xbconnect.md) 設定預設主機時提供了存取金鑰，該存取金鑰會儲存為預設主機位址的一部分。 - 如需存取金鑰的詳細資訊，請參閱 [xbconfig accesskey](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/xbconfig.md)。 - 如果您在 **/X** 後面 (位址之後或單獨) 附加 **/title**，則會使用執行中獨佔應用程式所看到的分割區對應。例如，指定 **/X/title xd:** 可存取預設主機上執行中獨佔應用程式可見的暫存磁碟機分割區。 |

## 命令詳細資料

### startlistening

> [!NOTE]
>
> 為了獲得最佳相容性，建議**不要**設定 `version` 或 `config`

| 參數 | 描述 |
| :- | :- |
| version | 選擇性參數，指定要使用的通訊協定版本。預設為主機支援的最新通訊協定版本。 |
| config | 選擇性參數，指定要使用的串流設定。預設為目標開發套件所支援的最高位元速率設定。 |

### status

| 旗標 | 描述 |
| :- | :- |
| /B | 指定精簡格式。啟用時，**status** 命令只會列印精簡輸出。精簡模式必須與至少一個其他旗標一起使用，以指出您要擷取哪些狀態資料 (例如 **/S**)。 |
| /S | 只指定串流狀態。啟用時，**status** 命令只會列印主機的串流狀態。 |

### enableremoteconnect

| 參數 | 描述 |
| :- | :- |
| accountEmail | 指定要啟用遠端連線的電子郵件帳戶。請注意，此帳戶目前必須已在 XBOX 上登入才能啟用遠端連線，且登入串流用戶端時應使用此帳戶。 |

### disableremoteconnect

| 參數 | 描述 |
| :- | :- |
| accountEmail | 指定要停用遠端連線的電子郵件帳戶。請注意，這應該是先前曾用來登入的帳戶。 |

### remoteconnectstatus

| 參數 | 描述 |
| :- | :- |
| accountEmail | 指定要擷取其遠端連線狀態的電子郵件帳戶。 |

### setconfigoverride

| 參數 | 描述 |
| :- | :- |
| allowDirectCapture | 啟用或停用直接擷取的選擇性布林值。預設值：*true*。 |
| maxBitrate | 覆寫串流最大位元速率的選擇性參數。範例值：*12000000*。 |
| minBitrate | 覆寫串流最小位元速率的選擇性參數。範例值：*6000000*。 |
| maxResolution | 覆寫視訊串流建議最大解析度的選擇性參數。範例值：*720p*、*1080p*。 |
| minResolution | 覆寫視訊串流建議最小解析度的選擇性參數。範例值：*720p*、*1080p*。 |

### clearconfigoverride

| 參數 | 描述 |
| :- | :- |
| allowDirectCapture | 清除直接擷取覆寫的選擇性參數。 |
| maxBitrate | 清除最大位元速率覆寫的選擇性參數。 |
| minBitrate | 清除最小位元速率覆寫的選擇性參數。 |
| maxResolution | 清除最大解析度覆寫的選擇性參數。 |
| minResolution | 清除最小解析度覆寫的選擇性參數。 |

| 旗標 | 描述 |
| :- | :- |
| /A | 清除所有覆寫。 |

## 範例

下列範例顯示使用 **xbgamestream** 的幾種方式。

```text theme={null}

C:\Working Directory> xbgamestream status
Game Streaming Server Status:
Not Listening

C:\Working Directory> xbgamestream listconfigs
default    : xxxx Default
5.5mbps    : Max 1280 x 720 @5.5Mbps
12mbps     : Max 1920 x 1080 @12Mbps

C:\Working Directory> xbgamestream startlistening
Listening started

C:\Working Directory> xbgamestream stoplistening
Listening stopped

C:\Working Directory> xbgamestream startlistening /X:255.255.255.255
Listening started

C:\Working Directory> xbgamestream status /X:255.255.255.255
Game Streaming Server Status:
Listening
  - Protocol Version: ANY
  - Stream Configuration: default

C:\Working Directory> xbgamestream status /B /S /X:255.255.255.255
Listening

C:\Working Directory> xbgamestream enableremoteconnect accountEmail=xxxx@y.com
Remote connect enabled for account xxxx@y.com

C:\Working Directory> xbgamestream disableremoteconnect accountEmail=xxxx@y.com
Remote connect disabled for account xxxx@y.com

C:\Working Directory> xbgamestream remoteconnectstatus accountEmail=xxxx@y.com
Remote connect status for account xxxx@y.com: enabled

C:\Working Directory> xbgamestream setconfigoverride maxBitrate=12000000 minBitrate=6000000
Stream config override(s) set

C:\Working Directory> xbgamestream setconfigoverride minResolution=1080p
Stream config override(s) set

C:\Working Directory> xbgamestream clearconfigoverride maxBitrate minBitrate
Stream config override(s) cleared

C:\Working Directory> xbgamestream clearconfigoverride /A
Stream config override(s) cleared

C:\Working Directory> xbgamestream dumpconfigoverride
maxBitrate           : 12000000
minBitrate           : 6000000
minResolution        : 1080p
```

## 另請參閱

[管理遊戲串流 (wdgamestream.exe)](https://docs.xbox.com/zh-TW/tools/tools-console/console_commandlinetools/wdgamestream.md)

[命令列工具](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/commandlinetools.md)

[XTF 傳輸錯誤](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/xtf-transport-errors.md)


## Related topics

- [管理遊戲串流 (wdgamestream.exe)](https://docs.xbox.com/zh-TW/tools/tools-console/console_commandlinetools/wdgamestream.md)
- [串流頁面 (Dev Home)](https://docs.xbox.com/zh-TW/tools/tools-console/devhome/devhome-streaming.md)
- [主機開發的命令列工具](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/commandlinetools.md)
- [命令列工具](https://docs.xbox.com/zh-TW/tools/tools-console/commandlinetools/index.md)
- [主機型命令列工具](https://docs.xbox.com/zh-TW/tools/tools-console/console_commandlinetools/consolecommandlinetools.md)
