andr-ec
andr-ec
Explore posts from servers
SMSoftware Mansion
Created by andr-ec on 7/9/2024 in #membrane-help
how to create mp4 file chunks with File.Sink.Multi and ISOM
My goal is to create a file every few seconds of every few buffers. My approach was to modify File.Sink.Multi and ISOM, and I think I’m close but I’m seeing issues in all but the first file. All the secondary files have the wrong duration and are empty for the first portion of it. Has someone implemented this before? Is there a plugin I can use for this? Otherwise could someone give me some pointers on how to finish this? I believe I modified Multi correctly to handle Seek Sink events. Now with ISOM I finalize the mp4 whenever I get enough buffers, and send the actions. I believe the issue I have is around figuring out how to reset some of the state in the pad tracks so that the timing is correct without restring the tracks completely. Could I get some pointers around this and possibly the actions to send?
2 replies
SMSoftware Mansion
Created by andr-ec on 7/3/2024 in #membrane-help
Error removing children group and starting new spec in a Bin
I’m trying to remove a child group and start a new spec within a handle child notification within a bin. all the children are defined with refs like {:muxer, make_ref()} the children are also created in a group. The problem is that in that handle_child_notification, if I remove the group and the add the new spec at the same time, it fails with an error:
17:41:03.613 [error] <0.287.0>/:chunk_saver/:chunk_sink_bin/ Error occured in Membrane Bin:
%Membrane.LinkError{
message: "Attempted to link the following pads more than once: pad {Membrane.Pad, :input, #Reference<0.2414433122.3236167682.5577>} of child {Membrane.Bin, :itself}, pad {Membrane.Pad, :input, #Reference<0.2414433122.3236167682.5579>} of child {Membrane.Bin, :itself}\n"
}
(membrane_core 1.1.0) lib/membrane/core/parent/child_life_controller/link_utils.ex:204: Membrane.Core.Parent.ChildLifeController.LinkUtils.validate_links/2
(membrane_core 1.1.0) lib/membrane/core/parent/child_life_controller/link_utils.ex:166: Membrane.Core.Parent.ChildLifeController.LinkUtils.resolve_links/3
(membrane_core 1.1.0) lib/membrane/core/parent/child_life_controller.ex:145: Membrane.Core.Parent.ChildLifeController.handle_spec/2
(membrane_core 1.1.0) lib/membrane/core/callback_handler.ex:194: anonymous fn/5 in Membrane.Core.CallbackHandler.handle_callback_result/5
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(membrane_core 1.1.0) lib/membrane/core/callback_handler.ex:192: Membrane.Core.CallbackHandler.handle_callback_result/5
(membrane_core 1.1.0) lib/membrane/core/bin.ex:208: Membrane.Core.Bin.handle_info/2
(stdlib 4.3.1.4) gen_server.erl:1123: :gen_server.try_dispatch/4
17:41:03.613 [error] <0.287.0>/:chunk_saver/:chunk_sink_bin/ Error occured in Membrane Bin:
%Membrane.LinkError{
message: "Attempted to link the following pads more than once: pad {Membrane.Pad, :input, #Reference<0.2414433122.3236167682.5577>} of child {Membrane.Bin, :itself}, pad {Membrane.Pad, :input, #Reference<0.2414433122.3236167682.5579>} of child {Membrane.Bin, :itself}\n"
}
(membrane_core 1.1.0) lib/membrane/core/parent/child_life_controller/link_utils.ex:204: Membrane.Core.Parent.ChildLifeController.LinkUtils.validate_links/2
(membrane_core 1.1.0) lib/membrane/core/parent/child_life_controller/link_utils.ex:166: Membrane.Core.Parent.ChildLifeController.LinkUtils.resolve_links/3
(membrane_core 1.1.0) lib/membrane/core/parent/child_life_controller.ex:145: Membrane.Core.Parent.ChildLifeController.handle_spec/2
(membrane_core 1.1.0) lib/membrane/core/callback_handler.ex:194: anonymous fn/5 in Membrane.Core.CallbackHandler.handle_callback_result/5
(elixir 1.17.1) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
(membrane_core 1.1.0) lib/membrane/core/callback_handler.ex:192: Membrane.Core.CallbackHandler.handle_callback_result/5
(membrane_core 1.1.0) lib/membrane/core/bin.ex:208: Membrane.Core.Bin.handle_info/2
(stdlib 4.3.1.4) gen_server.erl:1123: :gen_server.try_dispatch/4
shouldn’t the pads be unlinked automatically because the child group is being removed? The Bin input is dynamic. And all of the children are part of the same group. Help would be amazing, thank you so much!
4 replies