Skip to content

Rtmp relay#36

Open
mcfiredrill wants to merge 5 commits into
mainfrom
rtmp-relay
Open

Rtmp relay#36
mcfiredrill wants to merge 5 commits into
mainfrom
rtmp-relay

Conversation

@mcfiredrill
Copy link
Copy Markdown
Member

No description provided.

Comment thread liquidsoap/radio.liq Outdated
# 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))
Copy link
Copy Markdown
Member Author

@mcfiredrill mcfiredrill May 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread liquidsoap/radio.liq Outdated
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])
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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   .{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread liquidsoap/radio.liq Outdated
# 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)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect and not needed: the decoder should be able to convert to audio implicitly when needed.

Comment thread liquidsoap/radio.liq
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)])
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants