Skip to content

Conversation

Noarkhh
Copy link
Contributor

@Noarkhh Noarkhh commented Aug 13, 2025

Some problems can arise when a realtime output, like RTP and WebRTC, is used in conjunction with realtime input - the Realtimer that is in the pipeline can introduce unwanted latency. This PR introduces an option to disable the Realtimers in these circumstances.

The option name is up to debate, this one is most likely a placeholder.

@Noarkhh Noarkhh requested review from mat-hek and FelonEkonom August 13, 2025 15:01
Copy link
Member

@FelonEkonom FelonEkonom left a comment

Choose a reason for hiding this comment

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

Please add this option to Burrito module so it will be available in Boombox CLI

},
transcoding_policy: :always | :if_needed | :never
transcoding_policy: :always | :if_needed | :never,
ignore_timestamps: boolean()
Copy link
Member

Choose a reason for hiding this comment

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

trying to do a small brainstorm here: did you have any other ideas about what could be the name of this option?

Copy link
Member

@mat-hek mat-hek Aug 14, 2025

Choose a reason for hiding this comment

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

Yup, we definitely need a better name. This sounds like we somehow discard timestamps, while we just don't apply pacing. So I'd call it pace_control or realtime or similar. Also, a typedoc would be useful.

lib/boombox.ex Outdated
Comment on lines 85 to 88
@type out_webrtc_opts :: [
transcoding_policy_opt()
| pace_control_opt()
]
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure it should be a separate type. It's not complex, and it's more convenient to have everything in one place when reading the docs

lib/boombox.ex Outdated
| pace_control_opt()
]

@type common_input ::
Copy link
Member

Choose a reason for hiding this comment

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

How about having just Boombox.input instead of common_input and typing Boombox.run as Boombox.run(Boombox.input() | Boombox.stream_input(), ..., same for the output?

Comment on lines 16 to 20
@typedoc """
Determines whether the incoming streams should be passed to the output according to their
timestamps or as fast as possible.
"""
@type pace_control_opt :: {:pace_control, boolean()}
Copy link
Member

Choose a reason for hiding this comment

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

We should mention what the default is

@Noarkhh Noarkhh force-pushed the add-realtime-option branch from 6268207 to c126e10 Compare August 27, 2025 15:23
@mat-hek
Copy link
Member

mat-hek commented Aug 28, 2025

@Noarkhh As we spoke, there's a slight shift in our approach :D Let's add the pace control option only to the stream input and output, add a mode: :live | :vod option to HLS, and automatically plug realtimer based on the input and output

@varsill varsill linked an issue Sep 9, 2025 that may be closed by this pull request
lib/boombox.ex Outdated
@type in_stream_opts :: [
{:audio, :binary | boolean()}
| {:video, :image | boolean()}
| {:realtime, boolean()}
Copy link
Member

Choose a reason for hiding this comment

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

maybe is_realtime or is_live 🤔 cc @varsill

otherwise LGTM

@type in_stream_opts :: [
{:audio, :binary | boolean()}
| {:video, :image | boolean()}
| {:is_live, boolean()}
Copy link
Member

Choose a reason for hiding this comment

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

What is the reaon of having this, if we have pace_control_opt for output?

Copy link
Member

Choose a reason for hiding this comment

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

We need to know whether the incoming stream is real-time or not, same as :vod | :live in HLS.

@FelonEkonom FelonEkonom self-requested a review September 12, 2025 13:57
Copy link
Member

@FelonEkonom FelonEkonom left a comment

Choose a reason for hiding this comment

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

I don't like fact that pace_control doesn't specify what type of pace control we deal with, anything like realtime or live would be 10x better. At the same time I don't want to spend more time at this discussion

@FelonEkonom FelonEkonom requested review from FelonEkonom and removed request for FelonEkonom September 12, 2025 13:58
@mat-hek mat-hek merged commit 828afd2 into master Sep 12, 2025
3 checks passed
@mat-hek mat-hek deleted the add-realtime-option branch September 12, 2025 13:59
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.

Reconsider Realtimer usage
4 participants