Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

Network playback settings, signal-panel line and buffering UI (C6/C7)

Veyra Goal Agent0d07c9de5011
diff --git a/i18n/catalog.json b/i18n/catalog.json
index 2a6e2f10..5761d707 100644
--- a/i18n/catalog.json
+++ b/i18n/catalog.json
@@ -497,6 +497,13 @@
"en": "%1 is running. It hooks both the interface and the video, which can freeze Veyra. Restart Veyra to enable compatible rendering: the interface is then drawn in software and %1 only affects the video. Restart now? Current playback or streaming will stop.",
"ja": "%1 が動作しています。インターフェースと映像の両方にフックするため、Veyra がフリーズすることがあります。互換描画を有効にするには Veyra を再起動してください。再起動後はインターフェースをソフトウェアで描画し、%1 は映像にだけ作用します。今すぐ再起動しますか?再生中の映像やストリーミングは停止します。"
},
+ {
+ "zh": "%1 秒",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "%1 秒",
+ "en": "%1 s",
+ "ja": "%1 秒"
+ },
{
"zh": "%1 项",
"src": "qml/PlaylistWindow.qml",
@@ -2513,6 +2520,20 @@
"en": "Apply this preset automatically the next time the app starts",
"ja": "次回起動時にこのプリセットを自動適用"
},
+ {
+ "zh": "下载 %1 MB/s",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "下載 %1 MB/s",
+ "en": "Download %1 MB/s",
+ "ja": "ダウンロード %1 MB/s"
+ },
+ {
+ "zh": "下载 —",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "下載 —",
+ "en": "Download —",
+ "ja": "ダウンロード —"
+ },
{
"zh": "不使用 LUT",
"src": "qml/ColourPanel.qml",
@@ -2583,6 +2604,13 @@
"en": "If unsure, choose Auto. To capture HDR: pick P010 as the capture format and HDR · PQ here (HDR10 from consoles and GPUs is PQ). HDR · HLG is for broadcast signals. SDR · 709 is a normal picture. Changes need a reconnect",
"ja": "わからなければ「自動」を選んでください。HDR をキャプチャーする場合:フォーマットに P010 を選び、ここでは「HDR · PQ」を選択(ゲーム機や GPU の HDR10 は PQ)。「HDR · HLG」は放送信号用、「SDR · 709」は通常の映像です。変更には再接続が必要です"
},
+ {
+ "zh": "不等待",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "不等待",
+ "en": "Don't wait",
+ "ja": "待たない"
+ },
{
"zh": "不补偿",
"src": "qml/ProPage.qml",
@@ -2632,6 +2660,13 @@
"en": "The Pro page's GPU usage counts only this GPU",
"ja": "プロ画面の「GPU 使用率」はこの GPU だけを集計します"
},
+ {
+ "zh": "丢包 %1",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "丟包 %1",
+ "en": "Lost %1",
+ "ja": "パケット損失 %1"
+ },
{
"zh": "两台电脑接在同一个局域网,这里会自动出现;也可以在下面手填它的 IP。首次使用需要配对。",
"src": "qml/DialogHost.qml",
@@ -3374,6 +3409,20 @@
"en": "Failed to save preset: %1",
"ja": "プリセットの保存に失敗しました:%1"
},
+ {
+ "zh": "保持画面",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "保持畫面",
+ "en": "Keep picture",
+ "ja": "映像を維持"
+ },
+ {
+ "zh": "保持画面 = 显示解码器修补后的画面,动作不中断;只对网络视频与 MPEG-TS 生效",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "保持畫面 = 顯示解碼器修補後的畫面,動作不中斷;只對網路影片與 MPEG-TS 生效",
+ "en": "Keep picture = show the picture the decoder patched up, so motion carries on; only applies to network video and MPEG-TS",
+ "ja": "映像を維持 = デコーダーが補修した映像をそのまま表示し、動きを止めません。ネットワーク動画と MPEG-TS にのみ適用されます"
+ },
{
"zh": "保留全部",
"src": "qml/ExportPage.qml",
@@ -6798,6 +6847,13 @@
"en": "Wake request sent; connect once the PS5 has started.",
"ja": "起動要求を送信しました。PS5 が起動してから接続します。"
},
+ {
+ "zh": "已取消",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "已取消",
+ "en": "Cancelled",
+ "ja": "キャンセルしました"
+ },
{
"zh": "已取消 · 可重新开始",
"src": "qml/ExportPage.qml",
@@ -7421,6 +7477,13 @@
"en": "Start capture",
"ja": "キャプチャー開始"
},
+ {
+ "zh": "开始播放前先攒够的秒数;“跟随缓冲档”按上面的缓冲档位决定。下次打开网络视频生效",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "開始播放前先累積足夠的秒數;「跟隨緩衝檔」依上方的緩衝檔位決定。下次開啟網路影片生效",
+ "en": "Seconds to collect before playback starts; “Follow buffer level” uses the level chosen above. Takes effect the next time a network video is opened",
+ "ja": "再生を始める前に溜める秒数です。「バッファー段階に従う」は上のバッファー段階で決まります。次回ネットワーク動画を開いたときから反映されます"
+ },
{
"zh": "开播自动选档",
"src": "qml/ProPage.qml",
@@ -8415,6 +8478,13 @@
"en": "The damaged file is protected and no settings were written; back it up and move it away first",
"ja": "破損したファイルは保護されており、設定は書き込んでいません。先にバックアップして移動してください"
},
+ {
+ "zh": "损坏画面处理",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "損壞畫面處理",
+ "en": "Damaged picture handling",
+ "ja": "破損した映像の扱い"
+ },
{
"zh": "排序",
"src": "qml/PlaylistWindow.qml",
@@ -8899,6 +8969,13 @@
"en": "Disconnect",
"ja": "切断"
},
+ {
+ "zh": "断线自动重连",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "斷線自動重連",
+ "en": "Auto-reconnect",
+ "ja": "切断時の自動再接続"
+ },
{
"zh": "新预设名称",
"src": "qml/ColourPanel.qml",
@@ -8962,6 +9039,13 @@
"en": "Could not write the export file",
"ja": "書き出しファイルに書き込めませんでした"
},
+ {
+ "zh": "无法分配媒体上下文",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "無法配置媒體上下文",
+ "en": "Could not allocate the media context",
+ "ja": "メディアコンテキストを確保できません"
+ },
{
"zh": "无法分配配对存档,请重试。",
"src": "src/ui/QmlPlayerBridge.cpp",
@@ -9102,6 +9186,13 @@
"en": "Could not open the folder: %1",
"ja": "フォルダーを開けません:%1"
},
+ {
+ "zh": "无法打开视频文件,请检查路径和网络共享是否可访问",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "無法開啟影片檔案,請檢查路徑和網路共用是否可存取",
+ "en": "Could not open the video file. Check that the path and the network share are reachable.",
+ "ja": "動画ファイルを開けません。パスとネットワーク共有にアクセスできるか確認してください。"
+ },
{
"zh": "无法打开视频,请查看诊断",
"src": "src/engine/EngineController.cpp",
@@ -9165,6 +9256,13 @@
"en": "Could not read the media information",
"ja": "メディア情報を読み取れません"
},
+ {
+ "zh": "无法读取媒体信息,地址可能不是视频",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "無法讀取媒體資訊,位址可能不是影片",
+ "en": "Could not read the media information; the address may not be a video",
+ "ja": "メディア情報を読み取れません。アドレスが動画ではない可能性があります"
+ },
{
"zh": "无法读取导入文件",
"src": "src/engine/ColorLookStore.cpp",
@@ -9193,6 +9291,13 @@
"en": "Could not run the export process",
"ja": "書き出しプロセスを実行できません"
},
+ {
+ "zh": "无法连接到服务器或地址不可用,请检查网络",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "無法連線到伺服器或位址無法使用,請檢查網路",
+ "en": "Could not connect to the server, or the address is unavailable. Check the network.",
+ "ja": "サーバーに接続できないか、アドレスが利用できません。ネットワークを確認してください。"
+ },
{
"zh": "无陀螺仪",
"src": "qml/DialogHost.qml",
@@ -9802,6 +9907,13 @@
"en": "Limited",
"ja": "リミテッド · Limited"
},
+ {
+ "zh": "服务器速度 {:.1f} MB/s 低于视频码率 {:.1f} MB/s,建议加大缓冲或下载后播放",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "伺服器速度 {:.1f} MB/s 低於影片位元率 {:.1f} MB/s,建議加大緩衝或下載後播放",
+ "en": "Server speed {:.1f} MB/s is below the video bitrate {:.1f} MB/s; raise the buffer or download it before playing",
+ "ja": "サーバー速度 {:.1f} MB/s が動画のビットレート {:.1f} MB/s を下回っています。バッファーを増やすか、ダウンロードしてから再生してください"
+ },
{
"zh": "未使用",
"src": "qml/ColourPanel.qml",
@@ -10278,6 +10390,13 @@
"en": "An exclusive-fullscreen game is running: Windows lets no other window cover it. Switch the game to borderless or windowed mode",
"ja": "排他的フルスクリーンのゲームを検出しました。Windows は他のウィンドウを重ねられません。ゲームをボーダーレスまたはウィンドウモードにしてください"
},
+ {
+ "zh": "检测到网络丢包,已自动跳过 %1 处",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "偵測到網路丟包,已自動跳過 %1 處",
+ "en": "Network packet loss detected; %1 spot(s) skipped automatically",
+ "ja": "ネットワークのパケット損失を検出し、%1 か所を自動的にスキップしました"
+ },
{
"zh": "检测异常增长时自动退出全屏;默认关闭",
"src": "qml/SettingsPage.qml",
@@ -10642,6 +10761,13 @@
"en": "Signing in to the Xbox streaming service…",
"ja": "Xbox ストリーミングサービスにサインイン中…"
},
+ {
+ "zh": "正在缓冲 {:.1f}/{:.1f} 秒",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "正在緩衝 {:.1f}/{:.1f} 秒",
+ "en": "Buffering {:.1f}/{:.1f} s",
+ "ja": "バッファー中 {:.1f}/{:.1f} 秒"
+ },
{
"zh": "正在编码",
"src": "src/engine/ExportJobManager.cpp",
@@ -12014,6 +12140,20 @@
"en": "Waiting for signal",
"ja": "信号待ち"
},
+ {
+ "zh": "等待关键帧",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "等待關鍵幀",
+ "en": "Wait for keyframe",
+ "ja": "キーフレームを待つ"
+ },
+ {
+ "zh": "等待关键帧 = 丢弃损坏的画面,停在上一帧直到下一个完好的关键帧;只对网络视频与 MPEG-TS 生效",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "等待關鍵幀 = 丟棄損壞的畫面,停在上一幀直到下一個完好的關鍵幀;只對網路影片與 MPEG-TS 生效",
+ "en": "Wait for keyframe = drop damaged pictures and hold the last one until the next clean keyframe; only applies to network video and MPEG-TS",
+ "ja": "キーフレームを待つ = 破損した映像を破棄し、次の正常なキーフレームまで直前の映像を表示します。ネットワーク動画と MPEG-TS にのみ適用されます"
+ },
{
"zh": "等待导出",
"src": "qml/ExportPage.qml",
@@ -12301,6 +12441,20 @@
"en": "Green",
"ja": "グリーン"
},
+ {
+ "zh": "缓冲 %1 s",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "緩衝 %1 s",
+ "en": "Buffer %1 s",
+ "ja": "バッファー %1 s"
+ },
+ {
+ "zh": "缓冲中",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "緩衝中",
+ "en": "Buffering",
+ "ja": "バッファー中"
+ },
{
"zh": "编码",
"src": "qml/DialogHost.qml",
@@ -12336,6 +12490,55 @@
"en": "Decoder for this subtitle format is unavailable",
"ja": "この字幕形式のデコーダーがありません"
},
+ {
+ "zh": "网络",
+ "src": "qml/ProPage.qml",
+ "zh-TW": "網路",
+ "en": "Network",
+ "ja": "ネットワーク"
+ },
+ {
+ "zh": "网络中断后自动重连:点播从断点继续,直播重新连接;关闭后断线即停止。下次打开网络视频生效",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "網路中斷後自動重連:點播從斷點繼續,直播重新連線;關閉後斷線即停止。下次開啟網路影片生效",
+ "en": "Reconnect automatically after a network drop: on-demand video resumes where it stopped and live streams reconnect; when off, a drop stops playback. Takes effect the next time a network video is opened",
+ "ja": "ネットワークが切れたら自動で再接続します。オンデマンドは中断した位置から再開し、ライブは再接続します。オフにすると切断で再生を止めます。次回ネットワーク動画を開いたときから反映されます"
+ },
+ {
+ "zh": "网络中断,正在重连(第 {} 次)",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "網路中斷,正在重連(第 {} 次)",
+ "en": "Network dropped, reconnecting (attempt {})",
+ "ja": "ネットワークが切断されました。再接続しています({} 回目)"
+ },
+ {
+ "zh": "网络地址、直播与服务器视频先攒一段再播放;服务器速度低于视频码率时暂停缓冲并说明原因,不会报错黑屏。下次打开网络视频生效",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "網路位址、直播與伺服器影片會先累積一段再播放;伺服器速度低於影片位元率時會暫停緩衝並說明原因,不會報錯黑屏。下次開啟網路影片生效",
+ "en": "Network addresses, live streams and server videos collect a short buffer before playing. When the server is slower than the video's bitrate, playback pauses to buffer and says why instead of failing to a black screen. Takes effect the next time a network video is opened",
+ "ja": "ネットワークアドレス、ライブ、サーバー上の動画は、少し溜めてから再生します。サーバー速度が動画のビットレートを下回るとバッファーのため一時停止して理由を表示し、エラーや黒画面にはなりません。次回ネットワーク動画を開いたときから反映されます"
+ },
+ {
+ "zh": "网络已重新连接,继续播放",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "網路已重新連線,繼續播放",
+ "en": "Network reconnected, playback continues",
+ "ja": "ネットワークに再接続しました。再生を続けます"
+ },
+ {
+ "zh": "网络缓冲",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "網路緩衝",
+ "en": "Network buffer",
+ "ja": "ネットワークバッファー"
+ },
+ {
+ "zh": "网络缓冲中 {:.1f}/{:.1f} 秒",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "網路緩衝中 {:.1f}/{:.1f} 秒",
+ "en": "Buffering the network {:.1f}/{:.1f} s",
+ "ja": "ネットワークをバッファー中 {:.1f}/{:.1f} 秒"
+ },
{
"zh": "网络视频 · %1",
"src": "src/ui/QmlPlayerBridge.cpp",
@@ -12343,6 +12546,20 @@
"en": "Network video · %1",
"ja": "ネットワーク動画 · %1"
},
+ {
+ "zh": "网络连接中断(断线自动重连已关闭)",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "網路連線中斷(斷線自動重連已關閉)",
+ "en": "Network connection lost (auto-reconnect is off)",
+ "ja": "ネットワーク接続が切れました(自動再接続はオフです)"
+ },
+ {
+ "zh": "网络连接中断,已重试 {} 秒仍无法恢复",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "網路連線中斷,已重試 {} 秒仍無法恢復",
+ "en": "Network connection lost; still not back after retrying for {} s",
+ "ja": "ネットワーク接続が切れ、{} 秒再試行しても復旧しませんでした"
+ },
{
"zh": "美乐威低延迟模式",
"src": "qml/DialogHost.qml",
@@ -13582,6 +13799,13 @@
"en": "Diagnostics copied; paste them straight into your report",
"ja": "診断情報をコピーしました。そのまま報告に貼り付けられます"
},
+ {
+ "zh": "该地址没有视频流",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "該位址沒有影片串流",
+ "en": "This address has no video stream",
+ "ja": "このアドレスには動画ストリームがありません"
+ },
{
"zh": "该字幕轨没有可显示的内容",
"src": "src/ui/QmlPlayerBridge.cpp",
@@ -13897,6 +14121,13 @@
"en": "Could not read the media information",
"ja": "メディア情報の読み取りに失敗しました"
},
+ {
+ "zh": "读取媒体信息超时(30 秒),服务器太慢或不是视频流",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "讀取媒體資訊超時(30 秒),伺服器太慢或不是影片串流",
+ "en": "Timed out reading the media information (30 s); the server is too slow or this is not a video stream",
+ "ja": "メディア情報の読み取りがタイムアウトしました(30 秒)。サーバーが遅いか、動画ストリームではありません"
+ },
{
"zh": "读取字幕参数",
"src": "src/engine/ExportStreams.cpp",
@@ -14079,6 +14310,13 @@
"en": "Resource unavailable",
"ja": "リソースを使用できません"
},
+ {
+ "zh": "起播预缓冲",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "起播預緩衝",
+ "en": "Startup buffer",
+ "ja": "再生開始前のバッファー"
+ },
{
"zh": "超分",
"src": "include/veyra/engine/BackendRecovery.h",
@@ -14191,6 +14429,13 @@
"en": "Follow the system default",
"ja": "システムの既定に従う"
},
+ {
+ "zh": "跟随缓冲档",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "跟隨緩衝檔",
+ "en": "Follow buffer level",
+ "ja": "バッファー段階に従う"
+ },
{
"zh": "跟随驱动输入",
"src": "src/ui/QmlPlayerBridge.cpp",
@@ -14961,6 +15206,13 @@
"en": "Connect and start",
"ja": "接続して開始"
},
+ {
+ "zh": "连接服务器超时(15 秒内没有响应),请检查地址和网络",
+ "src": "src/media/DemuxSession.cpp",
+ "zh-TW": "連線伺服器超時(15 秒內沒有回應),請檢查位址和網路",
+ "en": "Timed out connecting to the server (no response within 15 s). Check the address and the network.",
+ "ja": "サーバーへの接続がタイムアウトしました(15 秒以内に応答がありません)。アドレスとネットワークを確認してください。"
+ },
{
"zh": "连接端点无效",
"src": "src/engine/EffectChain.cpp",
@@ -15570,6 +15822,13 @@
"en": "Reconnect",
"ja": "再接続"
},
+ {
+ "zh": "重连 %1",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "重連 %1",
+ "en": "Reconnects %1",
+ "ja": "再接続 %1"
+ },
{
"zh": "重连中",
"src": "qml/DialogHost.qml",
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index 40f192dd..d2799f83 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -463,6 +463,12 @@ class QmlPlayerBridge : public QObject {
// A live source (PS5 / capture) that is still opening: what the picture area
// says meanwhile ("" once it plays or when nothing is opening).
Q_PROPERTY(QString liveOpeningText READ liveOpeningText NOTIFY snapshotChanged)
+ // Network / server playback (#48): the signal-panel line ("缓冲 18.2 s · 下载 12.4 MB/s · 重连 0"),
+ // whether playback is paused to buffer, and the reason text shown while it is.
+ Q_PROPERTY(bool networkActive READ networkActive NOTIFY snapshotChanged)
+ Q_PROPERTY(bool networkHolding READ networkHolding NOTIFY snapshotChanged)
+ Q_PROPERTY(QString networkSummary READ networkSummary NOTIFY snapshotChanged)
+ Q_PROPERTY(QString networkNotice READ networkNotice NOTIFY snapshotChanged)
// Protection regions as the engine holds them: [{left,top,right,bottom,ellipse}].
Q_PROPERTY(QVariantList protectionRegions READ protectionRegions NOTIFY protectionChanged)
Q_PROPERTY(QString protectionDrawShape READ protectionDrawShape NOTIFY protectionDrawChanged)
@@ -1059,6 +1065,10 @@ public:
QString captureSignalText() const;
QString captureSignalLevel() const;
QString liveOpeningText() const;
+ bool networkActive() const;
+ bool networkHolding() const;
+ QString networkSummary() const;
+ QString networkNotice() const;
Q_INVOKABLE void importPresetDialog();
Q_INVOKABLE bool importPreset(const QString& path);
Q_INVOKABLE void exportPresetDialog(int index);
diff --git a/qml/Veyra/MinimalPage.qml b/qml/Veyra/MinimalPage.qml
index 2eccff24..8f08f903 100644
--- a/qml/Veyra/MinimalPage.qml
+++ b/qml/Veyra/MinimalPage.qml
@@ -109,6 +109,42 @@ VPage {
}
}
}
+ // A network or server source that is paused to buffer, or reconnecting (#48): the
+ // picture stays up and says why it waits, instead of ending in an error and a black screen.
+ Rectangle {
+ id: bufferingPill
+ objectName: "min-network-buffering"
+ readonly property bool videoCover: true
+ property real coverRadius: 16
+ // The picture's width bounds the sentence; the pill never sizes the text back.
+ readonly property real maxTextWidth: Math.max(120, parent.width - 48 - 32 - 22 - 10)
+ visible: veyra.networkHolding && veyra.networkNotice.length > 0
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 96
+ width: bufferingRow.implicitWidth + 32
+ height: Math.max(40, bufferingText.height + 20)
+ radius: coverRadius
+ color: Qt.rgba(22 / 255, 22 / 255, 26 / 255, 0.92)
+ border.width: 1
+ border.color: Theme.stroke2
+ Row {
+ id: bufferingRow
+ anchors.centerIn: parent
+ spacing: 10
+ VSpinner { anchors.verticalCenter: parent.verticalCenter }
+ Text {
+ id: bufferingText
+ anchors.verticalCenter: parent.verticalCenter
+ width: Math.min(implicitWidth, bufferingPill.maxTextWidth)
+ wrapMode: Text.WordWrap
+ text: veyra.networkNotice
+ color: Theme.t1
+ font.family: Theme.fontUi
+ font.pixelSize: Theme.fsBody
+ }
+ }
+ }
}
VMenu {
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index be7ca57f..8260de1b 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -807,6 +807,20 @@ VPage {
horizontalAlignment: Text.AlignRight
elide: Text.ElideRight
}
+ // Network / server playback (#48): buffer, download speed, reconnects.
+ Text { visible: veyra.networkActive; text: qsTr("网络"); color: Theme.t3; font.family: Theme.fontUi; font.pixelSize: 12 }
+ Text {
+ objectName: "pro-network-summary"
+ visible: veyra.networkActive
+ Layout.fillWidth: true
+ text: veyra.networkSummary
+ color: veyra.networkHolding ? Theme.warn : Theme.t1; font.family: Theme.fontMono; font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
+ // The card is narrow: the three figures wrap instead of losing the last one.
+ wrapMode: Text.WordWrap
+ maximumLineCount: 3
+ elide: Text.ElideRight
+ }
}
Item { Layout.fillHeight: true }
}
diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qml
index 23361be9..65073400 100644
--- a/qml/Veyra/SettingsPage.qml
+++ b/qml/Veyra/SettingsPage.qml
@@ -361,6 +361,53 @@ VPage {
hint: veyra.deinterlaceAvailable ? qsTr("只处理标记为隔行的视频,优先使用 GPU;软解使用兼容算法。下次打开视频生效。") : qsTr("当前软件包未包含去隔行组件")
VSwitch { enabled: veyra.deinterlaceAvailable; checked: veyra.preferences.deinterlace !== false; onToggled: checked => veyra.setPreference("deinterlace",checked) }
}
+ // Network / server playback (#48). Read when a source opens.
+ VRow {
+ label: qsTr("网络缓冲")
+ hint: qsTr("网络地址、直播与服务器视频先攒一段再播放;服务器速度低于视频码率时暂停缓冲并说明原因,不会报错黑屏。下次打开网络视频生效")
+ VSeg {
+ objectName: "set-network-buffer"
+ options: [{ id: "auto", label: qsTr("自动") }, { id: "off", label: qsTr("关闭", "off") },
+ { id: "small", label: qsTr("小") }, { id: "medium", label: qsTr("中") }, { id: "large", label: qsTr("大") }]
+ current: veyra.preferences.networkBuffer || "auto"
+ onPicked: id => veyra.setPreference("networkBuffer", id)
+ }
+ }
+ VRow {
+ label: qsTr("起播预缓冲")
+ hint: qsTr("开始播放前先攒够的秒数;“跟随缓冲档”按上面的缓冲档位决定。下次打开网络视频生效")
+ VSelect {
+ objectName: "set-network-prebuffer"
+ implicitWidth: 170
+ options: [{ id: "-1", label: qsTr("跟随缓冲档") }, { id: "0", label: qsTr("不等待") },
+ { id: "3", label: qsTr("%1 秒").arg(3) }, { id: "5", label: qsTr("%1 秒").arg(5) },
+ { id: "10", label: qsTr("%1 秒").arg(10) }, { id: "20", label: qsTr("%1 秒").arg(20) },
+ { id: "30", label: qsTr("%1 秒").arg(30) }]
+ value: (options.find(o => o.id === (veyra.preferences.networkPrebuffer === undefined ? "-1" : String(veyra.preferences.networkPrebuffer))) || options[0]).label
+ onPicked: id => veyra.setPreference("networkPrebuffer", Number(id))
+ }
+ }
+ VRow {
+ label: qsTr("断线自动重连")
+ hint: qsTr("网络中断后自动重连:点播从断点继续,直播重新连接;关闭后断线即停止。下次打开网络视频生效")
+ VSwitch {
+ objectName: "set-network-reconnect"
+ checked: veyra.preferences.networkAutoReconnect !== false
+ onToggled: checked => veyra.setPreference("networkAutoReconnect", checked)
+ }
+ }
+ VRow {
+ label: qsTr("损坏画面处理")
+ hint: (veyra.preferences.networkCorrupt || "conceal") === "keyframe"
+ ? qsTr("等待关键帧 = 丢弃损坏的画面,停在上一帧直到下一个完好的关键帧;只对网络视频与 MPEG-TS 生效")
+ : qsTr("保持画面 = 显示解码器修补后的画面,动作不中断;只对网络视频与 MPEG-TS 生效")
+ VSeg {
+ objectName: "set-network-corrupt"
+ options: [{ id: "conceal", label: qsTr("保持画面") }, { id: "keyframe", label: qsTr("等待关键帧") }]
+ current: veyra.preferences.networkCorrupt || "conceal"
+ onPicked: id => veyra.setPreference("networkCorrupt", id)
+ }
+ }
// HDR 亮度曲线: static, so the highlights are protected.
// One-click presets (same ids as the list page).
Flow {
diff --git a/src/media/DemuxSession.cpp b/src/media/DemuxSession.cpp
index dfd41f38..c7396afa 100644
--- a/src/media/DemuxSession.cpp
+++ b/src/media/DemuxSession.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <cmath>
#include <cstdlib>
+#include <cstring>
#include <cwctype>
#include <format>
#include <limits>
@@ -307,12 +308,27 @@ std::shared_ptr<DemuxSession> DemuxSession::open(const OpenParams& params, std::
return nullptr;
}
AVFormatContext* context = s.context_;
- const int video = av_find_best_stream(context, AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0);
+ int video = av_find_best_stream(context, AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0);
if (video < 0) {
log::error("net-session", "no video stream");
if (error) *error = L"该地址没有视频流";
return nullptr;
}
+ // An HLS master playlist lists every quality as streams of one context. Like other players
+ // (mpv: hls-bitrate=max) take the best one rather than whichever FFmpeg met first; the bandwidth
+ // check later says so when the server cannot keep up, instead of silently switching down.
+ if (context->iformat && context->iformat->name && std::strstr(context->iformat->name, "hls")) {
+ int64_t bestScore = -1;
+ for (unsigned i = 0; i < context->nb_streams; ++i) {
+ const auto* p = context->streams[i]->codecpar;
+ if (p->codec_type != AVMEDIA_TYPE_VIDEO) continue;
+ const int64_t score = int64_t(p->width) * p->height * 1000 + std::min<int64_t>(p->bit_rate / 1000, 999);
+ if (score > bestScore) {
+ bestScore = score;
+ video = int(i);
+ }
+ }
+ }
int audio = params.audioStream;
if (audio == -2) audio = av_find_best_stream(context, AVMEDIA_TYPE_AUDIO, -1, video, nullptr, 0);
if (audio < 0 || unsigned(audio) >= context->nb_streams || context->streams[audio]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) audio = -1;
@@ -678,8 +694,9 @@ NetworkStats DemuxSession::stats() const {
out.state = NetworkStats::State::Playing;
}
if (bandwidthLow_ && (out.state == NetworkStats::State::Buffering || out.state == NetworkStats::State::Prebuffering)) {
- out.message += std::format(L";服务器速度 {:.1f} MB/s 低于视频码率 {:.1f} MB/s,建议加大缓冲或下载后播放",
- out.serverBytesPerSecond / 1048576.0, out.bitrateBytesPerSecond / 1048576.0);
+ // Separate piece (the UI translates ";"-separated parts on their own).
+ out.message += L";" + std::format(L"服务器速度 {:.1f} MB/s 低于视频码率 {:.1f} MB/s,建议加大缓冲或下载后播放",
+ out.serverBytesPerSecond / 1048576.0, out.bitrateBytesPerSecond / 1048576.0);
}
return out;
}
diff --git a/src/ui/PlayerUiFacade.cpp b/src/ui/PlayerUiFacade.cpp
index eb90875e..ef045503 100644
--- a/src/ui/PlayerUiFacade.cpp
+++ b/src/ui/PlayerUiFacade.cpp
@@ -7,6 +7,7 @@
#include <windows.h>
#include <algorithm>
+#include <cmath>
#include <fstream>
#include <format>
#include <iomanip>
@@ -28,11 +29,24 @@ std::wstring wide(const std::string& s) {
if (n > 0) MultiByteToWideChar(CP_UTF8, 0, s.data(), int(s.size()), r.data(), n);
return r;
}
+// Network buffering keeps the playback position frozen, so its own numbers have
+// to count as a change. Rounded to what the panel prints so the 100 ms stat
+// refresh does not repaint on every poll.
+bool sameNetwork(const veyra::media::NetworkStats& a, const veyra::media::NetworkStats& b) {
+ return a.active == b.active && a.live == b.live && a.state == b.state && a.bandwidthLow == b.bandwidthLow &&
+ a.reconnects == b.reconnects && a.reconnectAttempt == b.reconnectAttempt && a.stalls == b.stalls &&
+ a.corruptPackets == b.corruptPackets && a.corruptFrames == b.corruptFrames && a.skippedFrames == b.skippedFrames &&
+ a.message == b.message &&
+ std::llround(a.bufferedSeconds * 10) == std::llround(b.bufferedSeconds * 10) &&
+ std::llround(a.targetSeconds * 10) == std::llround(b.targetSeconds * 10) &&
+ std::llround(a.downloadBytesPerSecond / 1.0e5) == std::llround(b.downloadBytesPerSecond / 1.0e5);
+}
// Only the fields the UI can show are compared. Comparing the whole struct is
// fine too, but calling it out keeps the intent visible: a change here is what
// makes the UI repaint.
bool sameSnapshot(const veyra::engine::PlayerSnapshot& a, const veyra::engine::PlayerSnapshot& b) {
- return a.transport == b.transport && a.sessionId == b.sessionId && a.position == b.position &&
+ return sameNetwork(a.network, b.network) &&
+ a.transport == b.transport && a.sessionId == b.sessionId && a.position == b.position &&
a.duration == b.duration && a.frames == b.frames && a.generated == b.generated &&
a.status == b.status && a.backendWarning == b.backendWarning && a.sourceNotice == b.sourceNotice &&
a.applying == b.applying && a.rejectedRevision == b.rejectedRevision &&
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index f4c79af7..c5110925 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -381,6 +381,11 @@ struct QmlPlayerBridge::Impl {
// ran smoothly again. A second GPU failure within ten minutes is left to the user.
uint64_t gpuReconnectSession = 0;
std::chrono::steady_clock::time_point gpuReconnectDue{}, gpuReconnectLast{};
+ // Network sources (#48): damaged data is concealed or skipped without a word per packet;
+ // the user hears about it once in a while, and about a successful reconnect.
+ uint64_t netNoticeSession = 0, netLossReported = 0;
+ uint32_t netReconnectsReported = 0;
+ std::chrono::steady_clock::time_point netLossNoticeAt{};
struct CaptureListCache { bool valid = false; uint64_t generation = 0; QString language; std::wstring a, b; QVariantList list; };
CaptureListCache captureFormatsCache, captureResolutionCache, captureRateCache, capturePixelCache;
// Settings → 组件与许可. Read once and on refreshComponentList(): the property used to
@@ -1545,6 +1550,28 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
}
// Engine watchdog (field logs(15)): a frozen picture says why, once.
if (had && !wasEngineHung && s.status == engine::kEngineHangStatus) emit notice(uiText(s.status), true);
+ // Network sources (#48): a recovered connection and now-and-then loss summaries.
+ if (s.sessionId != impl_->netNoticeSession) {
+ impl_->netNoticeSession = s.sessionId;
+ impl_->netLossReported = 0;
+ impl_->netReconnectsReported = 0;
+ impl_->netLossNoticeAt = {};
+ }
+ if (s.network.active) {
+ const auto now = std::chrono::steady_clock::now();
+ if (s.network.reconnects > impl_->netReconnectsReported) {
+ impl_->netReconnectsReported = s.network.reconnects;
+ emit notice(tr("网络已重新连接,继续播放"), false);
+ }
+ const uint64_t lost = std::max(s.network.corruptPackets, s.network.corruptFrames);
+ if (lost > impl_->netLossReported &&
+ (impl_->netLossNoticeAt == std::chrono::steady_clock::time_point{} ||
+ now - impl_->netLossNoticeAt >= std::chrono::seconds(20))) {
+ emit notice(tr("检测到网络丢包,已自动跳过 %1 处").arg(qulonglong(lost - impl_->netLossReported)), false);
+ impl_->netLossReported = lost;
+ impl_->netLossNoticeAt = now;
+ }
+ }
emit snapshotChanged();
}
// The reconnect waits for the failed session's teardown (the GPU reset can hold it for
@@ -6158,6 +6185,11 @@ void QmlPlayerBridge::openPath(const QString& path) {
options.softwareDecode = impl_->prefString("decode") == QLatin1String("software");
options.hardwareDecodeOnly = impl_->prefString("decode") == QLatin1String("hardware");
options.deinterlace=deinterlaceAvailable()&&impl_->prefBool("deinterlace",true);
+ // Network / server playback (#48): read at open, like the decode choice above.
+ options.network.level=media::networkBufferLevelFromId(impl_->prefString("networkBuffer").toStdString());
+ options.network.startupPrebufferSeconds=impl_->prefs.value(QStringLiteral("networkPrebuffer"),-1).toInt();
+ options.network.autoReconnect=impl_->prefBool("networkAutoReconnect",true);
+ options.network.corrupt=media::corruptPolicyFromId(impl_->prefString("networkCorrupt").toStdString());
impl_->engine.open(impl_->videoWindow, wide, options);
impl_->openingSessionId = impl_->engine.snapshot().sessionId;
impl_->playlistSession = network?0:impl_->openingSessionId;
@@ -6323,10 +6355,12 @@ bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {
{"subtitleSize", {16, 56}}, {"subtitleFont", {0, 5}}, {"subtitleOutline", {0, 3}},
{"subtitleMargin", {0, 240}}, {"subtitleLines", {0, 8}},
// 列表模式 parameter panel width (ProPage splitter); QML clamps it to the window.
- {"listInspectorWidth", {376, 4000}}};
+ {"listInspectorWidth", {376, 4000}},
+ // Network sources (#48): seconds to collect before the first picture; -1 follows the buffer level.
+ {"networkPrebuffer", {-1, 60}}};
static const QStringList flags{"subtitleEnabled", "subtitleBackground", "subtitleFit",
"subtitleSecondLanguage", "audioForceStereo", "holdCompare",
- "magewellLowLatency", "blackmagicNativeCapture", "captureShowAllFrameRates", "cinePillHidden", "exportStopsPlayback", "obsGameCapture", "autoResume", "fullscreenMemoryProtection", "prewarmEnhancement", "hdrFgCompatibility", "computeOnMonitorGpu", "deinterlace"};
+ "magewellLowLatency", "blackmagicNativeCapture", "captureShowAllFrameRates", "cinePillHidden", "exportStopsPlayback", "obsGameCapture", "autoResume", "fullscreenMemoryProtection", "prewarmEnhancement", "hdrFgCompatibility", "computeOnMonitorGpu", "deinterlace", "networkAutoReconnect"};
QVariant stored;
if (ranges.contains(key)) {
bool ok = false; const int n = value.toInt(&ok);
@@ -6371,6 +6405,17 @@ bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {
const QString v = value.toString();
if (v != QLatin1String("auto") && v != QLatin1String("software") && v != QLatin1String("hardware")) return false;
stored = v;
+ } else if (key == QLatin1String("networkBuffer")) {
+ // Network buffer level (#48): the ids of media::NetworkBufferLevel.
+ const QString v = value.toString();
+ static const QStringList levels{"auto", "off", "small", "medium", "large"};
+ if (!levels.contains(v)) return false;
+ stored = v;
+ } else if (key == QLatin1String("networkCorrupt")) {
+ // What to do with pictures damaged by packet loss (network sources only).
+ const QString v = value.toString();
+ if (v != QLatin1String("conceal") && v != QLatin1String("keyframe")) return false;
+ stored = v;
} else if (key == QLatin1String("rememberPosition") || key == QLatin1String("dockPinned")) {
stored = value.toBool();
} else if (key == QLatin1String("language")) {
@@ -7586,6 +7631,10 @@ void QmlPlayerBridge::updateRunStatus() {
QString status = tr("待机"), level = QStringLiteral("idle");
if (s.failed) { status = tr("错误"); level = QStringLiteral("err"); }
else if (s.remoteRecovering) { status = tr("恢复中"); level = QStringLiteral("warn"); }
+ // Paused to buffer a network source (#48): no pictures are due, so the output rate is not judged.
+ else if (s.running && s.network.active && (s.network.holding() || s.network.state == media::NetworkStats::State::Reconnecting)) {
+ status = tr("缓冲中"); level = QStringLiteral("warn");
+ }
else if (active && !s.applying && f.rateWindowReady) {
// Judged on the engine's own words, shown in the interface language.
const std::wstring rate = i.history.rateStatus(s);
@@ -8530,4 +8579,26 @@ QString QmlPlayerBridge::liveOpeningText() const {
return {};
}
+// ---- network / server playback (#48) ------------------------------------------------
+bool QmlPlayerBridge::networkActive() const { return impl_->snapshot.network.active; }
+bool QmlPlayerBridge::networkHolding() const {
+ const auto& n = impl_->snapshot.network;
+ return n.active && (n.holding() || n.state == media::NetworkStats::State::Reconnecting);
+}
+QString QmlPlayerBridge::networkSummary() const {
+ const auto& n = impl_->snapshot.network;
+ if (!n.active) return {};
+ QStringList parts;
+ parts << tr("缓冲 %1 s").arg(n.bufferedSeconds, 0, 'f', 1);
+ parts << (n.downloadBytesPerSecond > 0 ? tr("下载 %1 MB/s").arg(n.downloadBytesPerSecond / 1048576.0, 0, 'f', 1)
+ : tr("下载 —"));
+ parts << tr("重连 %1").arg(n.reconnects);
+ if (const uint64_t lost = std::max(n.corruptPackets, n.corruptFrames); lost > 0) parts << tr("丢包 %1").arg(qulonglong(lost));
+ return parts.join(QStringLiteral(" · "));
+}
+QString QmlPlayerBridge::networkNotice() const {
+ const auto& n = impl_->snapshot.network;
+ return n.active ? uiText(n.message) : QString();
+}
+
} // namespace veyra::ui