Complete reference for modes, flags, and practical command combinations.
python3 src/main.pyBy default, FluxCast starts in wfd mode (Miracast/Wi-Fi Display).
If you prefer not to use a terminal, launch with --tray to get a system tray icon — no terminal window needed:
python3 src/main.py --traywfd: Primary recommended path - low-latency via Wi-Fi Direct + RTSP/RTP. Works excellently on Samsung TVs.dlna: Fallback path - via HTTP + DLNA/UPnP TV player. Use--transport hlsfor better stability on Samsung TVs.cast: Experimental - Chromecast viapychromecast. Not supported on many Samsung TV models.
Mode selection:
python3 src/main.py --protocol wfd
python3 src/main.py --protocol dlna --transport hls
python3 src/main.py --protocol cast--protocol dlna|cast|wfd--host HOST--port PORT--output-res WxH--fps N--bitrate Xm--discover-timeout N--capture-backend auto|wf-recorder|x11grab--transport progressive-ts|hls|live-ts--doctor--doctor-json--tv-ip IP(forcastonly)--device-name NAMEpre-select DLNA/Cast device by friendly name--monitor NAMEpre-select monitor by name for any protocol (wfd/dlna/cast)--traylaunch system tray interface (no terminal needed)
--wfd-scan--wfd-peer PEER--wfd-dry-run--wfd-test-pattern--wfd-ffmpeg-stats--wfd-media-pipeline auto|ffmpeg|gst--wfd-capture-backend auto|portal|wf-recorder|x11grab|gst-x11autousesportalfirst on KDE/GNOME Wayland, thenwf-recorderfallback.
--wfd-latency-log [PATH]--wfd-no-audio--wfd-audio-device DEVICE--wfd-rtsp-port PORT--wfd-rtp-source-port PORT--wfd-no-firewall--wfd-interface IFACE--wfd-timeout SEC--wfd-go-intent 0-15--wfd-uibcenable the input back channel (control the desktop from the sink)--wfd-monitor NAMEdeprecated alias for--monitor(kept for compatibility)
--protocol- Default:
wfd. dlnaandcastare fallback/alternative paths.
- Default:
--output-res- Example:
1280x720,1920x1080. - In
wfd, affects negotiated media mode and scaling.
- Example:
--fps- Recommended for stability:
30.
- Recommended for stability:
--bitrate- Formats:
3000k,3M,5M. - Desktop WFD has a quality floor (the code may automatically raise a too-low bitrate).
- Formats:
--tray- Launches a system tray icon instead of a terminal session. Scan, select device and monitor, start/stop casting. All from the tray menu.
- Requires
libappindicator(Hyprland/KDE) orgnome-shell-extension-appindicator(GNOME). - On non-Hyprland Wayland (KDE, GNOME), WFD capture uses the xdg-desktop-portal screen picker dialog.
Tray launches can override stream defaults with an INI file at
$XDG_CONFIG_HOME/fluxcast/config, or ~/.config/fluxcast/config when
XDG_CONFIG_HOME is not set. This file affects only the tray; direct CLI
commands keep their normal behavior.
[wfd]
output-res = 1920x1080
fps = 60
bitrate = 8M
monitor = HDMI-A-1
wfd-no-audio = false
[dlna]
transport = hls
fps = 30
bitrate = 4M
[cast]
bitrate = 4MAll modes accept output-res, fps, bitrate, and monitor. The dlna and cast
sections also accept host, port, discover-timeout, transport, and
capture-backend. The wfd section accepts these WFD stream/session options:
wfd-test-patternwfd-media-pipelinewfd-capture-backendwfd-latency-logwfd-no-audiowfd-audio-devicewfd-rtsp-portwfd-no-firewallwfd-rtp-source-portwfd-interfacewfd-timeout
monitor preselects the capture output for that mode by its name (as shown by
wlr-randr/xrandr, e.g. HDMI-A-1), so tray launches skip the monitor
picker. If omitted, the tray's own monitor selection is used.
Boolean flags accept true or false (also yes/no, on/off, and
1/0). A missing file, an empty file, or an omitted key keeps the built-in
default. Invalid values and unknown keys are logged and ignored. Device, peer,
and protocol selection remain controlled by the tray and cannot be set here.
--host,--port- HTTP server address and port for DLNA/Cast streams.
--discover-timeout- Discovery timeout for DLNA/Cast.
--capture-backendauto: selects backend by session and retries fallback backend on startup failure.wf-recorder: preferred for Hyprland/wlroots.x11grab: useful for X11 sessions.
--transporthls: Recommended for Samsung TVs - more stable HLS streamingprogressive-ts: May cause freezing on some Samsung TV modelslive-ts: Experimental live MPEG-TS transport
--tv-ip- For
cast: direct IP connection without discovery (may not work on Samsung TVs).
- For
--device-name NAME- Skip the interactive device picker and connect directly to the named DLNA or Chromecast device. Match is by friendly name (exact string as reported by the device).
- Example:
--device-name "Samsung TV"
--monitor NAME- Skip the interactive monitor picker and capture the named monitor for any protocol (wfd/dlna/cast). Use the output name as shown by
xrandrorwlr-randr(e.g.eDP-1,HDMI-A-1). - Has no effect when WFD capture uses the xdg-desktop-portal (KDE/GNOME Wayland), where the portal dialog handles monitor selection itself.
- Example:
--monitor eDP-1
- Skip the interactive monitor picker and capture the named monitor for any protocol (wfd/dlna/cast). Use the output name as shown by
--doctor- Human-readable capability report.
--doctor-json- Same report in JSON for automation.
--wfd-scan- Scan only, no connection attempt.
--wfd-peer- Accepts index, MAC, or device-name substring.
- Prefer selecting by MAC rather than index: the index can change between a
separate
--wfd-scanand the later connect step. - If omitted, FluxCast prints peers and asks for interactive selection.
--wfd-dry-run- Prints the D-Bus connection call without activating a session.
--wfd-interface- Explicit interface for scan path.
--wfd-timeout- Active peer discovery timeout.
--wfd-go-intent- Sets FluxCast's Wi-Fi Direct group-owner intent (
0–15, default0). - A low value (
0by default) is what gets most Miracast TVs to start the session; raise it only if a specific sink requires a higher intent. - Does not claim or require that the TV becomes the group owner or that the P2P address range changes.
- Sets FluxCast's Wi-Fi Direct group-owner intent (
--wfd-monitor NAME- Deprecated alias for
--monitor, kept for backward compatibility. Use--monitorinstead.
- Deprecated alias for
--wfd-test-pattern- Uses a generated test video/audio stream instead of desktop capture.
--wfd-ffmpeg-stats- Shows ffmpeg's live progress line (
fps,dup,drop) for the ffmpeg senders. - Off by default, because the line refreshes continuously and overwrites FluxCast's own output.
- Useful when reporting stutter, since it tells a capture problem (frames dropped or duplicated) from a link problem.
- Shows ffmpeg's live progress line (
--wfd-media-pipelineauto:gstfor test-pattern,ffmpegfor desktop.ffmpeg: force ffmpeg sender.gst: force GStreamer sender (currently mainly for test-pattern).
--wfd-capture-backendauto: tries desktop capture backends in order and falls back on startup failure.portal: Wayland ScreenCast through xdg-desktop-portal (KDE/GNOME preferred path).wf-recorder: recommended on Hyprland/wlroots.x11grab: useful for X11 sessions.gst-x11: X11 capture routed through the GStreamer MPEG-TS pipeline (the same one the test pattern uses) instead of ffmpeg. Opt-in and never chosen byauto. Use it when a sink connects and streams but shows a black screen on the default ffmpeg path (confirmed on Hisense Vidaa). Requiresgst-launch-1.0,ximagesrc(gst-plugins-good), andx264enc(gst-plugins-ugly).portalbackend requirements:dbus-next,xdg-desktop-portal, desktop portal backend, andgst-launch-1.0.
--wfd-no-audio- Video-only mode - May cause immediate disconnects on Samsung TVs during WFD negotiation.
- Use primarily for diagnostic/testing purposes.
--wfd-audio-device- Explicit Pulse/PipeWire monitor source.
--wfd-rtsp-port- RTSP port in WFD source IE (usually does not need changes).
--wfd-rtp-source-port- Local RTP source port.
--wfd-no-firewall- Disables the automatic firewall handling described below.
--wfd-uibc- Opt-in. Lets the sink (TV/tablet) control the desktop back over the WFD session: touch and mouse move the cursor, and basic keyboard input is typed.
- Works: touch/mouse (tap, drag), and base-character typing including Enter, Backspace and Tab.
- Limitations:
- Keys are injected on a US layout, so on other layouts some keys map
differently (e.g.
z/yon QWERTZ). - No modifiers: uppercase and combos (Shift/Ctrl/Alt) are not supported because the generic UIBC channel does not report which modifier is held.
- When casting an offset/secondary monitor, touch goes to whichever output the cursor is currently on.
- Keys are injected on a US layout, so on other layouts some keys map
differently (e.g.
On firewalld systems the temporary Wi-Fi Direct interface (p2p-wlan0-X)
lands in the default zone where the RTSP port (7236/tcp) is closed, so the TV
can't connect back and the session never starts. To avoid this, FluxCast opens
the port while a session is active and closes it on exit:
- Only happens when firewalld is installed and running, otherwise it is a no-op (no firewall is ever touched).
- The change is runtime only (no
--permanent): it disappears on a firewalld reload or reboot, and is removed automatically when FluxCast exits. - A port you already opened yourself is left untouched.
- Other firewalls (
nftables,iptables,ufw) are not modified — open the RTSP port manually there, e.g.sudo ufw allow 7236/tcp.
Pass --wfd-no-firewall to skip this entirely and manage the firewall yourself.
--wfd-latency-log- Without an argument, writes to
/tmp/fluxcast-wfd-latency.jsonl. - With an argument, writes to the specified path.
- Format: one JSON object per line (JSONL).
- Without an argument, writes to
Examples:
python3 src/main.py --wfd-latency-log
python3 src/main.py --wfd-latency-log /tmp/my-latency.jsonlrtsp_connected- Source accepted incoming TCP/RTSP connection from sink.
media_starting- Sender process startup began.
play_accepted- Includes
setup_ms: time fromrtsp_connectedto acceptedPLAY.
- Includes
latency_probe- Includes
sender_startup_ms: fromPLAY acceptedto first transmitted RTP bytes. - Includes
sender_path_latency_ms:setup_ms + sender_startup_ms. - This is an accurate sender-path latency metric inside FluxCast (excludes TV decode/render delay).
- Includes
sender_health- Periodic telemetry of process health and transmitted-byte counter.
python3 src/main.pypython3 src/main.py --wfd-latency-logpython3 src/main.py --protocol wfd --wfd-test-pattern --output-res 1280x720 --bitrate 3Mpython3 src/main.py --protocol wfd --wfd-test-pattern --wfd-no-audio --output-res 1280x720 --bitrate 3Mpython3 src/main.py --protocol wfd --output-res 1280x720 --fps 30 --bitrate 3M --wfd-media-pipeline ffmpegpython3 src/main.py --wfd-scanpython3 src/main.py --protocol dlna --transport hlspython3 src/main.py --protocol cast
python3 src/main.py --protocol cast --tv-ip 192.168.1.50sender_healthapproximately every 5 seconds.processes: ... running.tx_summarykeeps increasing over time.
If these conditions hold, RTP transmission is stable. Visual quality and smoothness then mostly depend on bitrate/fps/preset and Wi-Fi radio conditions.