Screen share: name streams by what is sent, not by the closest height (#876) #879

Closed
charles wants to merge 0 commits from fix-876-share-resolution-and-bars into textchat
Owner

Refs #876
Refs #589

#876: a Linux sharer (Wayland, RTX 4080, a 3440×1440 monitor, nightly 2026.1118.373 as far as the owner knows) picks 1080p and viewers on Flaxative see "720p". At 1440p they see "1080p", and at Source "1440p". There is also a strip at the top that "freaks out".

Result. Nothing is downgraded. Each setting is a 16:9 box, and a 21:9 picture fitted into that box keeps the full width but has fewer rows. The viewer's pill names a stream by the closest standard height, so 800 rows reads "720p". That rule comes from the original (getClosestResolutionHeight). This PR changes the labels only. The fit rule and the encoder are unchanged. No black rows or columns are baked into the frames. The top strip (#589) did not reproduce at 3440×1440 on this machine; see the #589 section.

Measured: source × setting × path → published → received

tools/capture-consistency/run.sh --chain --setting <s> (new here). The run uses the real Wayland portal capture path, a synthetic PipeWire source of the given size, the session's encoder, a local livekit-server --dev 1.12.0 and a second session decoding. Every row of every frame carries the frame's counter, so black or foreign rows inside a frame count as mixed. All runs were on this machine (RTX 5090, NVENC; VAAPI on the iGPU has no H.264). The debug build has no synthetic load, FLUXER_FRAME_CHECK=1, and the encoder is fed at 60 fps. Under "Path", auto resolves to NVENC, sw is "Prefer software" (OpenH264), and dmabuf means DMA-BUF buffers as KWin on NVIDIA shares them (otherwise MemFd).

Source Setting Path Captured = published Received Label before → after Bars in frame
1920×1080 720p auto 1280×720 1280×720 720p → 720p no
1920×1080 1080p auto, dmabuf 1920×1080 1920×1080 1080p → 1080p no
2560×1440 1440p auto, dmabuf 2560×1440 2560×1440 1440p → 1440p no
1920×1200 720p auto 1152×720 1152×720 720p → 1152×720 no
1920×1200 1080p auto / sw 1728×1080 1728×1080 1080p → 1728×1080 no
2560×1080 720p auto 1280×540 1280×540 480p → 1280×540 no
2560×1080 1080p auto 1920×810 1920×808 720p → 1920×808 no
3440×1440 720p auto 1280×534 1280×532 480p → 1280×532 no
3440×1440 720p30, no NVENC (CUDA_VISIBLE_DEVICES=-1) dmabuf 1280×534 1280×532 480p → 1280×532 no
3440×1440 1080p auto / auto dmabuf / sw dmabuf 1920×802 1920×800 720p → 1920×800 no
3440×1440 1440p auto / auto dmabuf / sw 2560×1070 2560×1068 1080p → 2560×1068 no
3440×1440 Source auto / auto dmabuf 3440×1440 3440×1440 1440p → 3440×1440 no
3840×1600 1080p auto 1920×800 1920×800 720p → 1920×800 no
3840×1600 1440p auto 2560×1066 2560×1064 1080p → 2560×1064 no
3840×1600 Source auto 3840×1600 3840×1600 1440p → 3840×1600 no
5120×2160 1080p auto 1920×810 1920×808 720p → 1920×808 no
5120×2160 Source auto 3840×1620 3840×1620 1440p → 3840×1620 no
1920×1046 (window) 720p auto 1280×696 1280×696 720p → 1280×696 no
1920×1046 (window) 1080p auto 1920×1046 1920×1044 1080p → 1920×1044 no
1080×1920 (portrait) 720p auto 404×720 404×720 720p → 404×720 no
1080×1920 (portrait) 1080p auto / sw 606×1080 604×1080 1080p → 604×1080 no

Every received frame was whole: mixed=0 black_top=0 unreadable=0 in all 29 runs. Received sizes are cropped down to a multiple of 4 (802→800, 1070→1068, 606→604) on both NVENC and OpenH264. That crop is at most 2 rows or columns, not padding. The 3440×1440 row reproduces the report exactly: 1080p → "720p", 1440p → "1080p", Source → "1440p".

The four leads of #876

1. The software clamp. It is clamp_to_software_h264 in fluxer-core voice/stream/params.rs, a port of the original's clampToSoftwareH264Budget.

  • When it applies: only for H.264, and only when the codec probe (fluxer-voice probe_codecs) lists no hardware H.264 encoder. In that case 1080p60 becomes 720p30.

  • What does not trigger it: "Encoder path" ("Prefer software" with NVENC listed is not clamped), premium, the bitrate, or an encoder that falls back mid-share. A fallback stays at the chosen size on OpenH264 (#838, #229). A new test covers this: the_software_clamp_follows_the_probe_not_the_encoder_path.

  • Codec choice: with software-only H.264, rank_codecs puts VP9 first anyway. The clamp only matters when the viewers force H.264.

  • On an NVIDIA machine the clamp needs the NVENC probe to fail. libwebrtc logs the reason at WARN:

    • CUDA is not available, NVENC disabled.
    • NVENC library (libnvidia-encode.so.1) not found
    • NVENC driver version too old
    • cuInit failed during NVENC probe
    • …

    The result is logged at INFO: voice: video codecs probed … hardware_encoders=[…].

  • Nightlies: the clamp has been unchanged since 2026-11-12. On NVIDIA:

    • before 2026.1118.369, NVENC was listed, so no clamp, but it failed above 720p30 and libwebrtc fell back to OpenH264 at the full size;
    • from 369 (#838) on, NVENC encodes 1080p60 and 1440p60;
    • 373 adds nothing here; 375 adds the encoder order (#865).

    So the clamp cannot explain "every setting one step lower", and the measurements show it did not happen.

  • What the sharer was told: nothing. The own pill showed the setting ("1080p 60 FPS") while 720p30 was sent. This is fixed below. The original logs a warning and shows its software-encoder warning.

2. Aspect ratio. The capture (fluxer-capture desktop::fit_even) scales the picture into the setting's 16:9 box with the aspect kept and even sides, never up, and never pads. The share is published at exactly that size (encode_params → fit_to_preset of a frame already inside the budget). The table shows no bars at any size. The black bars Charles saw on the stream are therefore not in the frames. The owner has since said the bar is the top-strip defect, not letterboxing. A 21:9 picture in a 16:9 tile is letterboxed by the viewer's layout, as in the original.

The original sizes the share in two ways:

  • Wayland portal (no source size known before capture): the capture is constrained by the preset's box, so the result is the same as Flaxative.
  • A listed source with nativeWidth/nativeHeight (resolveEffectiveScreenShareDimensions): the original fits a pixel budget, preserving the aspect, and never pads. A 3440×1440 source gives 2224×930 at 1080p and 2966×1242 at 1440p. Flaxative gives 1920×802 and 2560×1070, about 75 % of the pixels. For portrait the difference is large: 1080×1920 at 1080p is 1080×1920 in the original and 606×1080 here (32 %).

As asked, the fit rule is not changed here. That is an option for the owner (see "Not changed").

3. The viewer's layer. Screen shares are published without simulcast (screen_video_options: simulcast: false, as the original's resolveScreenShareLayering). There is one layer with LiveKit's rid q, so the SDK advertises it as quality LOW at full size (into_rtp_encodings, video_quality_for_rid). The server's subscribed_codecs="h264:[Low=true, Medium=false, High=false]" in the 2026-11-16 log therefore means "the only layer is subscribed". It is not a low layer.

The Flaxative viewer joins with adaptive_stream: false and never sets a quality or dimensions. The grid tile, the focus view, fullscreen and PiP all subscribe the same way and get that one layer. The original sets dimensions or quality per view, which does nothing on a single-layer track. AV1/VP9 use L1T3 (temporal layers only). The received sizes in the table equal the published ones. Nothing to fix.

4. Nightlies since 2026.1118.369: see lead 1. #838 fixed NVENC at 1080p60 and above in 369. #865's VAAPI fix and encoder order are in 375. Sizes and labels are the same in every nightly.

Changes

  • Viewer's pill (fluxer-ui info_pill::track_label): a 16:9 stream (within 1 %) is still named by the closest height, as in the original. Any other shape is named by its size: "1920×800", "2560×1068", "3440×1440". This deviates from the original, whose rule produces exactly the "one step lower" reports.
  • Sharer's own pill (stream_tile::own_label): it now shows what is sent (the share's EncodeParams), not the setting's preset. "Source" appears only for a full 3840×2160 Source share; otherwise "1080p" for 16:9 standard heights and {w}×{h} for other shapes. The frame rate is the one sent. A share clamped to 720p30 now reads "720p 30 FPS", and an ultrawide at 1080p reads "1920×802 60 FPS". This is the original's formatScreenShareTargetLabel of its target.
  • Logs (golive):
    • INFO voice: screen share size at publish: captured size, sent size and frame rate, setting.
    • WARN voice: screen share held to 720p30: the codec probe found no hardware H.264 encoder when the clamp lowers the setting. The original logs the same: Screen share target clamped to the software H.264 budget.
  • Measurement: sender_consistency gains SC_SETTING, and run.sh gains --setting. The capture is asked for the preset's box and published at fit_to_preset of what it delivers. A SENDER_CONSISTENCY dims line gives setting, box, captured and published sizes.

#589: the top strip at 3440×1440 (not reproduced)

Every ultrawide run above also checked every frame at three stages: libwebrtc's raw copy, after conversion, and after encode → server → decode. Runs used FLUXER_FRAME_CHECK=1, NVENC, and both MemFd and DMA-BUF (--dmabuf, tiled modifier 0x300000000606010, stride 13760 = 3440×4, no padding). There was no synthetic load.

Source → setting (DMA-BUF, NVENC) s raw copies mixed (all dropped) converted mixed received mixed
1920×1080 → 1080p 20 6 (torn) 0 / 1135 0 / 872
2560×1440 → 1440p 20 5 (torn) 0 / 489 0 / 470
3440×1440 → 1080p 20 17 (torn) 0 / 868 0 / 806
3440×1440 → 1080p 55 26 (24 torn, 2 moved on) 0 / 1163 0 / 1136
3440×1440 → 1440p 20 26 (torn) 0 / 692 0 / 634
3440×1440 → Source 20 27 (torn) 0 / 700 0 / 645
3440×1440 → 1080p, OpenH264 20 13 (torn) 0 / 764 0 / 706

MemFd at 3440×1440 (1080p, 1440p, Source) had 0 mixed at every stage.

At 3440×1440, libwebrtc hands over 3–4× more torn copies than at 1080p, always the picture two frames later on top (distances={2: …}). #763's copy-compare plus second look caught every one of them. The scaler reads only our own copy. NVENC and OpenH264 encoded non-multiple-of-16 heights (802, 1070) without damage.

Not covered here:

  • The real KWin session (its own DMA-BUF timing and sync). This machine's compositor was not driven.
  • An RTX 4080 driver.
  • CPU pressure from other software on the sharer's machine.

What would decide it is the sharer's log of a share started with FLUXER_FRAME_CHECK=1 FLUXER_LOG=info,fluxer_capture=debug:

  • the PipeWire format line (Modifier: = DMA-BUF);
  • the per-pull trace (trusted / torn / moved on);
  • the frame-check warn lines with side = "captured" (before encoding) and on the encoder input. If those stay at 0 while viewers see the strip, the cause is after capture.

Then the same share once more with FLUXER_CAPTURE_VERIFY_LATEST=0.

Not changed (options for the owner)

  • Fit by pixel budget instead of box (the original's rule for listed sources). Flaxative could pass the budget to the capture instead of the box, so that an ultrawide keeps the setting's pixel count. The cost for 3440×1440:

    Setting Now Pixel budget Pixels Bitrate
    1080p 1920×802 2224×930 +34 % 6.0 Mbit/s either way at 60 fps (the table's floor is above the formula's 1.85 → 2.48 Mbit/s)
    1440p 2560×1070 2966×1242 +34 % 6.0 Mbit/s either way (formula 3.3 → 4.4 Mbit/s)
    Portrait 1080×1920 at 1080p 606×1080 1080×1920 +217 %

    Encoder cost scales with pixels.

  • Treating the setting as a height (1080p → 2576×1080 for 21:9): +81 % pixels over today's box fit at 1080p and +35 % over the pixel budget. Not done.

  • Frame rate at large sources. In these debug-build runs, the capture thread (copy, compare, second look, scale) saturated at 3440×1440 and above: 21–35 fps converted out of 60. This was not measured in a release build. It should be its own issue if it holds there.

Tests

  • fluxer-core tests/stream_params.rs:
    • an_ultrawide_monitor_is_sent_at_its_fit_in_the_box: 3440×1440 at 720p, 1080p, 1440p and Source → box, captured and published size.
    • the_software_clamp_follows_the_probe_not_the_encoder_path: Auto, Prefer hardware and Prefer software, with and without hardware H.264, for H.264 and VP9.
  • fluxer-ui info_pill::received_streams_of_another_shape_are_named_by_their_size: before this change, 1920×800 read "720p".
  • stream_tile::own_label_names_what_is_sent: an ultrawide share, Source, and the 720p30 clamp.
  • Opt-in (FLUXER_SENDER_CONSISTENCY=1, a local LiveKit, run.sh --chain --setting): the measurements above.

Gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes (final lines below).

==> xtask ci: livekit-interop
    skipped (FLUXER_LIVEKIT_TESTS is not 1)
==> xtask ci: all steps passed

🤖 Generated with Claude Code

Refs #876 Refs #589 #876: a Linux sharer (Wayland, RTX 4080, a 3440×1440 monitor, nightly 2026.1118.373 as far as the owner knows) picks 1080p and viewers on Flaxative see "720p". At 1440p they see "1080p", and at Source "1440p". There is also a strip at the top that "freaks out". **Result.** Nothing is downgraded. Each setting is a 16:9 box, and a 21:9 picture fitted into that box keeps the full width but has fewer rows. The viewer's pill names a stream by the closest standard height, so 800 rows reads "720p". That rule comes from the original (`getClosestResolutionHeight`). This PR changes the labels only. The fit rule and the encoder are unchanged. No black rows or columns are baked into the frames. The top strip (#589) did not reproduce at 3440×1440 on this machine; see the #589 section. ## Measured: source × setting × path → published → received `tools/capture-consistency/run.sh --chain --setting <s>` (new here). The run uses the real Wayland portal capture path, a synthetic PipeWire source of the given size, the session's encoder, a local `livekit-server --dev` 1.12.0 and a second session decoding. Every row of every frame carries the frame's counter, so black or foreign rows inside a frame count as `mixed`. All runs were on this machine (RTX 5090, NVENC; VAAPI on the iGPU has no H.264). The debug build has no synthetic load, `FLUXER_FRAME_CHECK=1`, and the encoder is fed at 60 fps. Under "Path", `auto` resolves to NVENC, `sw` is "Prefer software" (OpenH264), and `dmabuf` means DMA-BUF buffers as KWin on NVIDIA shares them (otherwise MemFd). | Source | Setting | Path | Captured = published | Received | Label before → after | Bars in frame | |---|---|---|---|---|---|---| | 1920×1080 | 720p | auto | 1280×720 | 1280×720 | 720p → 720p | no | | 1920×1080 | 1080p | auto, dmabuf | 1920×1080 | 1920×1080 | 1080p → 1080p | no | | 2560×1440 | 1440p | auto, dmabuf | 2560×1440 | 2560×1440 | 1440p → 1440p | no | | 1920×1200 | 720p | auto | 1152×720 | 1152×720 | 720p → 1152×720 | no | | 1920×1200 | 1080p | auto / sw | 1728×1080 | 1728×1080 | 1080p → 1728×1080 | no | | 2560×1080 | 720p | auto | 1280×540 | 1280×540 | 480p → 1280×540 | no | | 2560×1080 | 1080p | auto | 1920×810 | 1920×808 | 720p → 1920×808 | no | | **3440×1440** | 720p | auto | 1280×534 | 1280×532 | 480p → 1280×532 | no | | **3440×1440** | 720p30, no NVENC (`CUDA_VISIBLE_DEVICES=-1`) | dmabuf | 1280×534 | 1280×532 | 480p → 1280×532 | no | | **3440×1440** | **1080p** | auto / auto dmabuf / sw dmabuf | 1920×802 | **1920×800** | **720p** → 1920×800 | no | | **3440×1440** | **1440p** | auto / auto dmabuf / sw | 2560×1070 | **2560×1068** | **1080p** → 2560×1068 | no | | **3440×1440** | **Source** | auto / auto dmabuf | 3440×1440 | 3440×1440 | **1440p** → 3440×1440 | no | | 3840×1600 | 1080p | auto | 1920×800 | 1920×800 | 720p → 1920×800 | no | | 3840×1600 | 1440p | auto | 2560×1066 | 2560×1064 | 1080p → 2560×1064 | no | | 3840×1600 | Source | auto | 3840×1600 | 3840×1600 | 1440p → 3840×1600 | no | | 5120×2160 | 1080p | auto | 1920×810 | 1920×808 | 720p → 1920×808 | no | | 5120×2160 | Source | auto | 3840×1620 | 3840×1620 | 1440p → 3840×1620 | no | | 1920×1046 (window) | 720p | auto | 1280×696 | 1280×696 | 720p → 1280×696 | no | | 1920×1046 (window) | 1080p | auto | 1920×1046 | 1920×1044 | 1080p → 1920×1044 | no | | 1080×1920 (portrait) | 720p | auto | 404×720 | 404×720 | 720p → 404×720 | no | | 1080×1920 (portrait) | 1080p | auto / sw | 606×1080 | 604×1080 | 1080p → 604×1080 | no | Every received frame was whole: `mixed=0 black_top=0 unreadable=0` in all 29 runs. Received sizes are cropped down to a multiple of 4 (802→800, 1070→1068, 606→604) on both NVENC and OpenH264. That crop is at most 2 rows or columns, not padding. The 3440×1440 row reproduces the report exactly: 1080p → "720p", 1440p → "1080p", Source → "1440p". ## The four leads of #876 **1. The software clamp.** It is `clamp_to_software_h264` in `fluxer-core` `voice/stream/params.rs`, a port of the original's `clampToSoftwareH264Budget`. - **When it applies:** only for H.264, and only when the codec probe (`fluxer-voice` `probe_codecs`) lists no hardware H.264 encoder. In that case 1080p60 becomes 720p30. - **What does not trigger it:** "Encoder path" ("Prefer software" with NVENC listed is not clamped), premium, the bitrate, or an encoder that falls back mid-share. A fallback stays at the chosen size on OpenH264 (#838, #229). A new test covers this: `the_software_clamp_follows_the_probe_not_the_encoder_path`. - **Codec choice:** with software-only H.264, `rank_codecs` puts VP9 first anyway. The clamp only matters when the viewers force H.264. - **On an NVIDIA machine** the clamp needs the NVENC probe to fail. libwebrtc logs the reason at WARN: - `CUDA is not available, NVENC disabled.` - `NVENC library (libnvidia-encode.so.1) not found` - `NVENC driver version too old` - `cuInit failed during NVENC probe` - … The result is logged at INFO: `voice: video codecs probed … hardware_encoders=[…]`. - **Nightlies:** the clamp has been unchanged since 2026-11-12. On NVIDIA: - before 2026.1118.369, NVENC was listed, so no clamp, but it failed above 720p30 and libwebrtc fell back to OpenH264 at the full size; - from 369 (#838) on, NVENC encodes 1080p60 and 1440p60; - 373 adds nothing here; 375 adds the encoder order (#865). So the clamp cannot explain "every setting one step lower", and the measurements show it did not happen. - **What the sharer was told:** nothing. The own pill showed the setting ("1080p 60 FPS") while 720p30 was sent. This is fixed below. The original logs a warning and shows its software-encoder warning. **2. Aspect ratio.** The capture (`fluxer-capture` `desktop::fit_even`) scales the picture into the setting's 16:9 box with the aspect kept and even sides, never up, and never pads. The share is published at exactly that size (`encode_params` → `fit_to_preset` of a frame already inside the budget). The table shows no bars at any size. The black bars Charles saw on the stream are therefore not in the frames. The owner has since said the bar is the top-strip defect, not letterboxing. A 21:9 picture in a 16:9 tile is letterboxed by the viewer's layout, as in the original. The original sizes the share in two ways: - **Wayland portal** (no source size known before capture): the capture is constrained by the preset's box, so the result is the same as Flaxative. - **A listed source with `nativeWidth`/`nativeHeight`** (`resolveEffectiveScreenShareDimensions`): the original fits a **pixel budget**, preserving the aspect, and never pads. A 3440×1440 source gives 2224×930 at 1080p and 2966×1242 at 1440p. Flaxative gives 1920×802 and 2560×1070, about 75 % of the pixels. For portrait the difference is large: 1080×1920 at 1080p is 1080×1920 in the original and 606×1080 here (32 %). As asked, **the fit rule is not changed here**. That is an option for the owner (see "Not changed"). **3. The viewer's layer.** Screen shares are published without simulcast (`screen_video_options`: `simulcast: false`, as the original's `resolveScreenShareLayering`). There is one layer with LiveKit's rid `q`, so the SDK advertises it as quality **LOW** at full size (`into_rtp_encodings`, `video_quality_for_rid`). The server's `subscribed_codecs="h264:[Low=true, Medium=false, High=false]"` in the 2026-11-16 log therefore means "the only layer is subscribed". It is not a low layer. The Flaxative viewer joins with `adaptive_stream: false` and never sets a quality or dimensions. The grid tile, the focus view, fullscreen and PiP all subscribe the same way and get that one layer. The original sets dimensions or quality per view, which does nothing on a single-layer track. AV1/VP9 use `L1T3` (temporal layers only). The received sizes in the table equal the published ones. Nothing to fix. **4. Nightlies since 2026.1118.369:** see lead 1. #838 fixed NVENC at 1080p60 and above in 369. #865's VAAPI fix and encoder order are in 375. Sizes and labels are the same in every nightly. ## Changes - **Viewer's pill** (`fluxer-ui` `info_pill::track_label`): a 16:9 stream (within 1 %) is still named by the closest height, as in the original. Any other shape is named by its size: "1920×800", "2560×1068", "3440×1440". This deviates from the original, whose rule produces exactly the "one step lower" reports. - **Sharer's own pill** (`stream_tile::own_label`): it now shows what is sent (the share's `EncodeParams`), not the setting's preset. "Source" appears only for a full 3840×2160 Source share; otherwise "1080p" for 16:9 standard heights and `{w}×{h}` for other shapes. The frame rate is the one sent. A share clamped to 720p30 now reads "720p 30 FPS", and an ultrawide at 1080p reads "1920×802 60 FPS". This is the original's `formatScreenShareTargetLabel` of its target. - **Logs** (`golive`): - INFO `voice: screen share size` at publish: captured size, sent size and frame rate, setting. - WARN `voice: screen share held to 720p30: the codec probe found no hardware H.264 encoder` when the clamp lowers the setting. The original logs the same: `Screen share target clamped to the software H.264 budget`. - **Measurement:** `sender_consistency` gains `SC_SETTING`, and `run.sh` gains `--setting`. The capture is asked for the preset's box and published at `fit_to_preset` of what it delivers. A `SENDER_CONSISTENCY dims` line gives setting, box, captured and published sizes. ## #589: the top strip at 3440×1440 (not reproduced) Every ultrawide run above also checked every frame at three stages: libwebrtc's raw copy, after conversion, and after encode → server → decode. Runs used `FLUXER_FRAME_CHECK=1`, NVENC, and both MemFd and DMA-BUF (`--dmabuf`, tiled modifier `0x300000000606010`, stride 13760 = 3440×4, no padding). There was no synthetic load. | Source → setting (DMA-BUF, NVENC) | s | raw copies mixed (all dropped) | converted mixed | received mixed | |---|---|---|---|---| | 1920×1080 → 1080p | 20 | 6 (torn) | 0 / 1135 | 0 / 872 | | 2560×1440 → 1440p | 20 | 5 (torn) | 0 / 489 | 0 / 470 | | 3440×1440 → 1080p | 20 | 17 (torn) | 0 / 868 | 0 / 806 | | 3440×1440 → 1080p | 55 | 26 (24 torn, 2 moved on) | 0 / 1163 | 0 / 1136 | | 3440×1440 → 1440p | 20 | 26 (torn) | 0 / 692 | 0 / 634 | | 3440×1440 → Source | 20 | 27 (torn) | 0 / 700 | 0 / 645 | | 3440×1440 → 1080p, OpenH264 | 20 | 13 (torn) | 0 / 764 | 0 / 706 | MemFd at 3440×1440 (1080p, 1440p, Source) had 0 mixed at every stage. At 3440×1440, libwebrtc hands over 3–4× more torn copies than at 1080p, always the picture two frames later on top (`distances={2: …}`). #763's copy-compare plus second look caught every one of them. The scaler reads only our own copy. NVENC and OpenH264 encoded non-multiple-of-16 heights (802, 1070) without damage. Not covered here: - The real KWin session (its own DMA-BUF timing and sync). This machine's compositor was not driven. - An RTX 4080 driver. - CPU pressure from other software on the sharer's machine. What would decide it is the sharer's log of a share started with `FLUXER_FRAME_CHECK=1 FLUXER_LOG=info,fluxer_capture=debug`: - the PipeWire format line (`Modifier:` = DMA-BUF); - the per-pull trace (trusted / torn / moved on); - the frame-check `warn` lines with `side = "captured"` (before encoding) and on the encoder input. If those stay at 0 while viewers see the strip, the cause is after capture. Then the same share once more with `FLUXER_CAPTURE_VERIFY_LATEST=0`. ## Not changed (options for the owner) - **Fit by pixel budget instead of box** (the original's rule for listed sources). Flaxative could pass the budget to the capture instead of the box, so that an ultrawide keeps the setting's pixel count. The cost for 3440×1440: | Setting | Now | Pixel budget | Pixels | Bitrate | |---|---|---|---|---| | 1080p | 1920×802 | 2224×930 | +34 % | 6.0 Mbit/s either way at 60 fps (the table's floor is above the formula's 1.85 → 2.48 Mbit/s) | | 1440p | 2560×1070 | 2966×1242 | +34 % | 6.0 Mbit/s either way (formula 3.3 → 4.4 Mbit/s) | | Portrait 1080×1920 at 1080p | 606×1080 | 1080×1920 | +217 % | | Encoder cost scales with pixels. - **Treating the setting as a height** (1080p → 2576×1080 for 21:9): +81 % pixels over today's box fit at 1080p and +35 % over the pixel budget. Not done. - **Frame rate at large sources.** In these debug-build runs, the capture thread (copy, compare, second look, scale) saturated at 3440×1440 and above: 21–35 fps converted out of 60. This was not measured in a release build. It should be its own issue if it holds there. ## Tests - `fluxer-core` `tests/stream_params.rs`: - `an_ultrawide_monitor_is_sent_at_its_fit_in_the_box`: 3440×1440 at 720p, 1080p, 1440p and Source → box, captured and published size. - `the_software_clamp_follows_the_probe_not_the_encoder_path`: Auto, Prefer hardware and Prefer software, with and without hardware H.264, for H.264 and VP9. - `fluxer-ui` `info_pill::received_streams_of_another_shape_are_named_by_their_size`: before this change, 1920×800 read "720p". - `stream_tile::own_label_names_what_is_sent`: an ultrawide share, Source, and the 720p30 clamp. - Opt-in (`FLUXER_SENDER_CONSISTENCY=1`, a local LiveKit, `run.sh --chain --setting`): the measurements above. Gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes (final lines below). ``` ==> xtask ci: livekit-interop skipped (FLUXER_LIVEKIT_TESTS is not 1) ==> xtask ci: all steps passed ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A 3440x1440 monitor shared at 1080p, 1440p and Source is sent as
1920x802, 2560x1070 and 3440x1440 (fit into the setting's 16:9 box,
aspect kept, no padding) and arrives as 1920x800, 2560x1068 and
3440x1440. The viewer's pill named those by the closest usual height,
"720p", "1080p" and "1440p", one step below each setting, which read
as a downgrade that did not happen.

- Viewer's pill: a 16:9 stream keeps the closest-height name (as the
  original); any other shape is named by its size.
- Sharer's own pill: what is sent (the share's EncodeParams), not the
  setting's preset, as the original's formatScreenShareTargetLabel; a
  share held to 720p30 for want of a hardware H.264 encoder now says so.
- Logs: INFO "voice: screen share size" at publish; WARN when the
  software H.264 clamp lowers the setting.
- sender_consistency SC_SETTING / run.sh --chain --setting: the capture
  is asked for the preset's box and published at fit_to_preset of what
  it delivers, for measuring sizes end to end.

Refs #876
Refs #589

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into textchat by hand (the merge API returns 405); the commits are in the branch.

Merged into `textchat` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-18 10:39:27 +00:00
charles referenced this pull request from a commit 2026-11-18 22:34:35 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.