Repository navigation
feat: optional remote source (MP4, HLS, DASH) - #7
Merged
Merged
Conversation
Add --source URL to stream.sh: publish an MP4 file, an HLS playlist, or a DASH manifest (on demand or live) over MoQ instead of assets/<name>.mp4. <name> then only names the broadcast (default: live). Before the relay starts, lib/probe-source.mjs reads the URL with ffprobe and stops the run with the reason if it can't. From an HLS/DASH ladder it picks the highest-resolution variant and its audio, so ffmpeg downloads only that one. H.264/AAC is copied, anything else is re-encoded to H.264/AAC. Only http(s) URLs are accepted (and none with backslashes, which zsh adds when pasting), and ffmpeg may only use network protocols, so a playlist can't make it read a local file. A remote source plays once: ffmpeg can't seek HLS back to its start. Works with --abr-ladder, --csai-mode, --sgai-mode, --auth, and --dashboard; not with --ssai-mode. Without the flag the pipeline is unchanged. Adds the smoke-test-podman-source CI job and documents the feature in the README.
pzanella
added a commit
that referenced
this pull request
Oct 27, 2026
Add --source URL to stream.sh: publish an MP4 file, an HLS playlist, or a DASH manifest (on demand or live) over MoQ instead of assets/<name>.mp4. <name> then only names the broadcast (default: live). Before the relay starts, lib/probe-source.mjs reads the URL with ffprobe and stops the run with the reason if it can't. From an HLS/DASH ladder it picks the highest-resolution variant and its audio, so ffmpeg downloads only that one. H.264/AAC is copied, anything else is re-encoded to H.264/AAC. Only http(s) URLs are accepted (and none with backslashes, which zsh adds when pasting), and ffmpeg may only use network protocols, so a playlist can't make it read a local file. A remote source plays once: ffmpeg can't seek HLS back to its start. Works with --abr-ladder, --csai-mode, --sgai-mode, --auth, and --dashboard; not with --ssai-mode. Without the flag the pipeline is unchanged. Adds the smoke-test-podman-source CI job and documents the feature in the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
--source URLflag: stream an existing MP4, HLS, or DASH stream (on demand or live) over MoQ, instead of a file inassets/. Without the flag nothing changes.How it works:
lib/probe-source.mjsreads the URL withffprobe. If it can't (404, timeout, not a stream, no audio or video), the run stops with the reason.--abr-laddermakes the usual 5 renditions from it.Source ended.). ffmpeg 5.1 can't seek HLS back to its start, so looping isn't reliable.<name>only names the broadcast (defaultlive).Checks:
http(s)URLs, and no backslashes (zsh adds them when pasting, which breaks signed CDN URLs with a 403).http,https,tcp,tls,crypto), so a playlist can't make it read a local file.-rw_timeoutends the run instead of hanging.--ssai-mode(SSAI cuts the content at fixed offsets).Works with
--abr-ladder,--csai-mode,--sgai-mode,--auth, and--dashboard.Tested locally against MP4 over HTTP, HLS (VOD and live, multi-variant), DASH (VOD and live), an HEVC/AC-3 source (re-encoded), and the local-file pipelines (base, ABR, CSAI, SSAI) for regressions.
Also:
smoke-test-podman-source: a two-variant HLS ladder and a DASH manifest served from the runner, plus an unreachable URL.authentication is disabledwhen the player sends a?jwt=to a public relay).