Skip to content

Commit

Permalink
Disbale AAC filling
Browse files Browse the repository at this point in the history
  • Loading branch information
philipgiuliani committed Sep 30, 2024
1 parent d287c95 commit 092fa90
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions examples/rtmp.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ defmodule Pipeline do
File.rm_rf("tmp")

structure = [
# Source
child(:source, %Membrane.RTMP.SourceBin{
url: "rtmp://127.0.0.1:1935/app/stream_key"
}),

# Sink
child(:sink, %Membrane.HLS.SinkBin{
manifest_uri: URI.new!("file://tmp/stream.m3u8"),
Expand All @@ -24,11 +29,6 @@ defmodule Pipeline do
storage: HLS.Storage.File.new()
}),

# Source
child(:source, %Membrane.RTMP.SourceBin{
url: "rtmp://127.0.0.1:1935/app/stream_key"
}),

# Audio
get_child(:source)
|> via_out(:audio)
Expand Down
24 changes: 12 additions & 12 deletions lib/membrane/hls/sink_bin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,22 @@ defmodule Membrane.HLS.SinkBin do
state
)
when encoding in [:H264, :AAC] do
{max_pts, track_pts} = resume_info(state.packager_pid, track_id)
{max_pts, _track_pts} = resume_info(state.packager_pid, track_id)

spec =
bin_input(pad)
|> then(fn spec ->
if encoding == :AAC do
spec
|> child({:filler, track_id}, %Membrane.HLS.AACFiller{duration: max_pts - track_pts})
|> child(:fix_parser, %Membrane.AAC.Parser{
out_encapsulation: :none,
output_config: :esds
})
|> child({:shifter, track_id}, %Membrane.HLS.Shifter{duration: track_pts})
else
child(spec, {:shifter, track_id}, %Membrane.HLS.Shifter{duration: max_pts})
end
# if encoding == :AAC do
# spec
# |> child({:filler, track_id}, %Membrane.HLS.AACFiller{duration: max_pts - track_pts})
# |> child(:fix_parser, %Membrane.AAC.Parser{
# out_encapsulation: :none,
# output_config: :esds
# })
# |> child({:shifter, track_id}, %Membrane.HLS.Shifter{duration: track_pts})
# else
child(spec, {:shifter, track_id}, %Membrane.HLS.Shifter{duration: max_pts})
# end
end)
|> child({:muxer, track_id}, %Membrane.MP4.Muxer.CMAF{
segment_min_duration: state.opts.min_segment_duration
Expand Down

0 comments on commit 092fa90

Please sign in to comment.