-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't manage to take a look at HLS Endpoint itself but will do this tomorrow
test/hls_reference/single-track-h264/g2gCZAAFdmlkZW9tAAAADXRlc3QtdHJhY2staWQ.m3u8
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, hls tests fail on CI, so my question is whether these tests are deterministic?
cbab3f3
to
b1395a9
Compare
test/hls_reference/single-track-h264/g2gCZAAFdmlkZW9tAAAADXRlc3QtdHJhY2staWQ.m3u8
Outdated
Show resolved
Hide resolved
Returns FFmpeg filtergraph that is used to create compositor output. | ||
https://ffmpeg.org/ffmpeg-filters.html#toc-Filtergraph-description | ||
|
||
Used ffmpeg options: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's much better 🙂
fd74911
to
48b71a4
Compare
48b71a4
to
bd5f80b
Compare
Unpinning myself from CR as the whole development is done in PRs to this branch |
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
==========================================
+ Coverage 56.73% 59.55% +2.82%
==========================================
Files 35 38 +3
Lines 1641 1721 +80
==========================================
+ Hits 931 1025 +94
+ Misses 710 696 -14
Continue to review full report at Codecov.
|
new_buffers = | ||
state | ||
|> get_in([:buffers, state.update_queue]) | ||
|> then(&[buffer | &1]) | ||
|
||
state = put_in(state, [:buffers, state.update_queue], new_buffers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new_buffers = | |
state | |
|> get_in([:buffers, state.update_queue]) | |
|> then(&[buffer | &1]) | |
state = put_in(state, [:buffers, state.update_queue], new_buffers) | |
state = update_in(state,[:buffers, state.update_queue],&[buffer | &1]) |
buffers = | ||
state | ||
|> get_in([:buffers, state.update_queue]) | ||
|> Enum.reverse() | ||
|
||
actions = [buffer: {:output, buffers}] ++ maybe_notify_end_of_stream(state) | ||
|
||
new_buffers = | ||
state | ||
|> Map.get(:buffers) | ||
|> Map.delete(state.update_queue) | ||
|
||
{actions, %{state | buffers: new_buffers, update_queue: state.update_queue - 1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buffers = | |
state | |
|> get_in([:buffers, state.update_queue]) | |
|> Enum.reverse() | |
actions = [buffer: {:output, buffers}] ++ maybe_notify_end_of_stream(state) | |
new_buffers = | |
state | |
|> Map.get(:buffers) | |
|> Map.delete(state.update_queue) | |
{actions, %{state | buffers: new_buffers, update_queue: state.update_queue - 1}} | |
{buffers,state} = pop_in([:buffers, state.update_queue]) | |
buffers = Enum.reverse(buffers) | |
actions = [buffer: {:output, buffers}] ++ maybe_notify_end_of_stream(state) | |
{actions, %{state | update_queue: state.update_queue - 1}} |
""" | ||
|
||
@typedoc """ | ||
* `channels` - number of channels inside a frame. Default value is 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a frame is a term related to video and doesn't have much sense in the context of audio, but I am maybe wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same term is widely used in AudioRaw documentation.
@typedoc """ | ||
To read more about config options go to module Membrane.HTTPAdaptiveStream.SinkBin and read options descriptions. | ||
""" | ||
|
||
alias Membrane.HTTPAdaptiveStream.{Manifest, Storage} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@typedoc """ | |
To read more about config options go to module Membrane.HTTPAdaptiveStream.SinkBin and read options descriptions. | |
""" | |
alias Membrane.HTTPAdaptiveStream.{Manifest, Storage} | |
alias Membrane.HTTPAdaptiveStream.{Manifest, Storage} | |
@typedoc """ | |
To read more about config options go to module Membrane.HTTPAdaptiveStream.SinkBin and read options descriptions. | |
""" |
|
||
@type t() :: %__MODULE__{ | ||
manifest_name: String.t(), | ||
manifest_module: (Path.t() -> module), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type doesn't match the default value, isn't there some error?
stream_beginning: nil, | ||
video_layout_state: nil, | ||
stream_ids: MapSet.new(), | ||
video_layout_tracks_added: %{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this map and where do we put anything in it?
@@ -0,0 +1,73 @@ | |||
defmodule Membrane.RTC.Engine.Endpoint.HLS.StreamFormatUpdater do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdated file name.
end | ||
|
||
defp get_track_offset(%{stream_beginning: nil} = state), | ||
do: {0, Map.put(state, :stream_beginning, System.monotonic_time())} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do: {0, Map.put(state, :stream_beginning, System.monotonic_time())} | |
do: {0, %{state | stream_beginning: System.monotonic_time()})} |
mix.exs
Outdated
{:membrane_audio_mix_plugin, "~> 0.12.0", optional: true}, | ||
{:membrane_generator_plugin, "~> 0.8.0", optional: true}, | ||
{:membrane_realtimer_plugin, "~> 0.6.0", optional: true}, | ||
{:membrane_audio_filler_plugin, "~> 0.1.0"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why isn't this dependency optional?
for output_file <- output_files do | ||
output_path = Path.join(output_dir, output_file) | ||
%{size: size} = File.stat!(output_path) | ||
assert size > 0 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use this fragment in multiple tests could we move it to a function?
e1fd1e0
to
2d2c779
Compare
2d2c779
to
a7887b5
Compare
@moduledoc """ | ||
Module representing mixer configuration for the HLS endpoint. | ||
""" | ||
if Code.ensure_loaded?(Membrane.RawAudio) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we for consistency add also check for RawVideo?
@@ -148,7 +148,6 @@ if Enum.all?( | |||
tracks: %{}, | |||
stream_beginning: nil, | |||
video_layout_state: nil, | |||
stream_ids: MapSet.new(), | |||
video_layout_tracks_added: %{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in our talk I think we should add a test for this whether we properly call functions from VideoLayoutMaker behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really cool 👍 I had a couple of suggestions regarding the API
lib/membrane_rtc_engine/endpoints/hls/config/audio_mixer_config.ex
Outdated
Show resolved
Hide resolved
lib/membrane_rtc_engine/endpoints/hls/config/compositor_config.ex
Outdated
Show resolved
Hide resolved
alias Membrane.HTTPAdaptiveStream.{Manifest, Storage} | ||
|
||
@typedoc """ | ||
To read more about config options go to module Membrane.HTTPAdaptiveStream.SinkBin and read options descriptions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To read more about config options go to module Membrane.HTTPAdaptiveStream.SinkBin and read options descriptions. | |
To read more about config options go to module `Membrane.HTTPAdaptiveStream.SinkBin` and read options descriptions. |
lib/membrane_rtc_engine/endpoints/hls/config/sink_bin_config.ex
Outdated
Show resolved
Hide resolved
Module representing function for updating video layout for the HLS stream. | ||
|
||
1) Only main presenter | ||
_ _ _ _ | ||
| | | ||
| | | ||
| | | ||
| | | ||
| | | ||
- - - - | ||
2) Main presenter and one side presenter | ||
_ _ _ _ | ||
| | | ||
| | | ||
| | | ||
- - | | ||
| | | | ||
- - - - | ||
|
||
3) Main presenter and two side presenters | ||
_ _ _ _ | ||
| | | ||
| | | ||
| | | ||
- - - - | ||
| | | | ||
- - - - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool docs 👍
default: SinkBinConfig, | ||
hls_config: [ | ||
spec: HLSConfig.t(), | ||
default: HLSConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default: HLSConfig, | |
default: %HLSConfig{}, |
after merging this PR draft (#182) will be cloused.