Rtmp relay#36
Open
mcfiredrill wants to merge 5 commits into
Open
Conversation
mcfiredrill
commented
May 31, 2026
| # nginx-rtmp pushes the live RTMP stream here when a DJ is streaming with obs | ||
| rtmp_relay = input.rtmp(listen=true, "rtmp://datafruits_viz:1936") | ||
| # TODO uncommenting this causes type error | ||
| # rtmp_audio = mksafe(stereo(source.tracks(rtmp_relay).audio)) |
Member
Author
There was a problem hiding this comment.
At radio.liq, line 367, char 77-90:
hls_source = fallback(id="hls_fallback", track_sensitive=false, [rtmp_relay, logo_fallback])
Error 5: this value has type
source(audio=source(_), _)
.{
buffered : _,
clock : _,
duration : _,
elapsed : _,
fallible : _,
generate_frame : _,
id : _,
insert_metadata : _,
is_active : _,
is_ready : _,
is_started : _,
is_up : _,
last_metadata : _,
log : _,
on_connect : _,
on_disconnect : _,
on_error : _,
on_frame : _,
on_frame_checksum : _,
on_metadata : _,
on_position : _,
on_shutdown : _,
on_start : _,
on_stop : _,
on_track : _,
on_wake_up : _,
register_command : _,
remaining : _,
reset_last_metadata_on_track : _,
seek : _,
self_sync : _,
self_sync_description : _,
set_url : _,
skip : _,
start : _,
status : _,
stop : _,
time : _,
url : _
}
(inferred at radio.liq, line 364, char 16-53)
but it should be a subtype of the type of the value at radio.liq, line 367, char 64-91
source(audio=pcm(stereo), _)
.{
buffered : _,
clock : _,
duration : _,
elapsed : _,
fallible : _,
generate_frame : _,
id : _,
insert_metadata : _,
is_active : _,
is_ready : _,
is_started? : _,
is_up : _,
last_metadata : _,
log : _,
on_connect? : _,
on_disconnect? : _,
on_error? : _,
on_frame : _,
on_frame_checksum : _,
on_metadata : _,
on_position : _,
on_shutdown : _,
on_start? : _,
on_stop? : _,
on_track : _,
on_wake_up : _,
register_command : _,
remaining : _,
reset_last_metadata_on_track : _,
seek : _,
self_sync : _,
self_sync_description : _,
set_url? : _,
skip : _,
start? : _,
status? : _,
stop? : _,
time : _,
url? : _
}
(inferred at radio.liq, line 311, char 13-66)
mcfiredrill
commented
Jun 1, 2026
| logo_fallback = mux_audio(single_video, audio=hls_audio_fallback) | ||
|
|
||
| # RTMP video takes priority; fall back to static logo + audio | ||
| hls_source = fallback(id="hls_fallback", track_sensitive=false, [rtmp_relay, logo_fallback]) |
Member
Author
There was a problem hiding this comment.
#23 0.944 At radio.liq, line 368, char 77-90:
#23 0.944 hls_source = fallback(id="hls_fallback", track_sensitive=false, [rtmp_relay, logo_fallback])
#23 0.944
#23 0.944 Error 5: this value has type
#23 0.944 source(audio=source(_), _)
#23 0.944 .{
#23 0.944 but it should be a subtype of the type of the value at radio.liq, line 368, char 64-91
#23 0.944 source(audio=pcm(stereo), _)
#23 0.944 .{
There was a problem hiding this comment.
This looks like an issue where the typechecker thinks the whole audio track is of type source(...). This most likely comes from the stereo call above which passes the audio track to the operator instead of the whole source.
toots
reviewed
Jun 1, 2026
| # nginx-rtmp pushes the live RTMP stream here when a DJ is streaming with obs | ||
| rtmp_relay = input.rtmp(listen=true, "rtmp://datafruits_viz:1936") | ||
| # TODO uncommenting this causes type error | ||
| rtmp_audio = stereo(source.tracks(rtmp_relay).audio) |
There was a problem hiding this comment.
This is incorrect and not needed: the decoder should be able to convert to audio implicitly when needed.
mcfiredrill
commented
Jun 1, 2026
| logo_fallback = source.mux.audio(single_video, audio=hls_audio_fallback) | ||
|
|
||
| # RTMP video takes priority; fall back to static logo + audio | ||
| hls_source = fallback(id="hls_fallback", track_sensitive=false, [rtmp_relay, mksafe(logo_fallback)]) |
Member
Author
There was a problem hiding this comment.
Thanks for the comments, think I'm getting a bit closer:
hls_source = fallback(id="hls_fallback", track_sensitive=false, [rtmp_relay, mksafe(logo_fallback)])
Error 5: this value has type
source(audio=_)
.{
but it should be a subtype of the type of the value at radio.liq, line 364, char 64-99
source(audio=_, video=_, _)
} (inferred at radio.liq, line 311, char 13-64)
calling stereo() on the rtmp_relay seems to cause this error....any ideas?
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.
No description provided.