-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HLS output #18
HLS output #18
Conversation
8097ee2
to
3b4d7e4
Compare
lib/boombox/hls.ex
Outdated
Enum.map(track_builders, fn | ||
{:audio, builder} -> | ||
builder | ||
|> child(Membrane.AAC.FDK.Encoder) |
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.
let's name the children like here
lib/boombox.ex
Outdated
@@ -20,6 +20,7 @@ defmodule Boombox do | |||
| Path.t() | |||
| {:file, file_extension(), Path.t()} | |||
| {:webrtc, webrtc_opts()} | |||
| {:hls | Path.t()} |
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.
can we also trigger HLS when the path ends with .m3u8
?
test/boombox_test.exs
Outdated
@@ -137,6 +137,21 @@ defmodule BoomboxTest do | |||
Compare.compare(output, "test/fixtures/ref_bun10s_opus_aac.mp4") | |||
end | |||
|
|||
@tag :file_hls | |||
async_test "mp4 file -> hls output", %{tmp_dir: tmp} 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.
add more tests and examples in examples.livemd
@impl true | ||
def handle_pad_added(:input, _ctx, state) do | ||
{[], state} | ||
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.
@impl true | |
def handle_pad_added(:input, _ctx, state) do | |
{[], state} | |
end |
|
||
def get_next_sample_actions(pad, [first_sample | rest_samples], segment_filenames) do | ||
{ | ||
[buffer: {pad, %Buffer{payload: first_sample}}, redemand: pad], |
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.
can we send a list of buffers and a single redemand instead?
spec_builder, | ||
child( | ||
:hls_sink_bin, | ||
%Membrane.HTTPAdaptiveStream.SinkBin{ |
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 we should use hls_mode: :muxed_av
, it generally works better and that's what fishjam uses
@Noarkhh another thing - it would be nice to support serving the HLS via HTTP if someone calls |
627b59c
to
307fcc7
Compare
@Noarkhh not necessarily, we could either
Anyway, maybe let's do that in another PR 🤔 |
test/support/compare.ex
Outdated
@spec compare(Path.t(), Path.t(), [:audio | :video]) :: :ok | ||
def compare(subject, reference, kinds \\ [:audio, :video]) do | ||
@spec compare(Path.t(), Path.t(), [:audio | :video], :mp4 | :hls) :: :ok | ||
def compare(subject, reference, kinds \\ [:audio, :video], format \\ :mp4) 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.
let's merge kinds
and format
into a keyword list
closes #4