andr-ec
andr-ec
Explore posts from servers
SMSoftware Mansion
Created by andr-ec on 7/3/2024 in #membrane-help
Error removing children group and starting new spec in a Bin
Sure. I’ll send what the spec looks like. The problem I see with using Process.send_after is how do I time it correctly? I see two problems, for example frames that are being received being dropped if not done in time. And since when I remove the group I’m removing all of the children of the bin, that means that the dynamic pad is being removed too right? that would mean that if I do it too late, it will close the bin. if I do it too early, it will still have the existing children. Is there a way to know when the children have been removed?
defp create_spec_for_pads(opts) do
count_string = opts.count |> to_string()
muxer_ref = {:muxer, make_ref()}
splitter_ref = {:splitter, make_ref()}
sink_ref = {:sink, make_ref()}
created_child = child(muxer_ref, %Membrane.MP4.Muxer.ISOM{fast_start: true, chunk_duration: 1 |> Membrane.Time.seconds()})
# for a single file
|> child(splitter_ref, %Membrane.Demo.Splitter{ max_size: 5})
|> child(sink_ref, %Membrane.File.Sink{location: opts.location <> count_string <> ".mp4" })
links_for_pads = opts.pads |> Enum.map(fn p -> (bin_input(p) |> get_child(muxer_ref) ) end )
{
[
created_child,
] ++ links_for_pads,
group: :chunk_sink_group
}
end
defp create_spec_for_pads(opts) do
count_string = opts.count |> to_string()
muxer_ref = {:muxer, make_ref()}
splitter_ref = {:splitter, make_ref()}
sink_ref = {:sink, make_ref()}
created_child = child(muxer_ref, %Membrane.MP4.Muxer.ISOM{fast_start: true, chunk_duration: 1 |> Membrane.Time.seconds()})
# for a single file
|> child(splitter_ref, %Membrane.Demo.Splitter{ max_size: 5})
|> child(sink_ref, %Membrane.File.Sink{location: opts.location <> count_string <> ".mp4" })
links_for_pads = opts.pads |> Enum.map(fn p -> (bin_input(p) |> get_child(muxer_ref) ) end )
{
[
created_child,
] ++ links_for_pads,
group: :chunk_sink_group
}
end
4 replies