rudebono
Hi everyone,
I’m pretty new to Membrane and don’t have much experience with media programming in general. I’m working on a personal project and have run into a problem I can’t seem to solve.
Here’s my question:
My goal is to take a short video or audio file and have it play on a continuous, infinite loop.
I’ve searched through the official docs, the website, and GitHub examples. I found plenty of information on how to play a file once, but I’m completely stuck on how to make it loop.
I’ve even asked an AI for suggestions, but it gave me a bunch of different ideas (like using a custom Source, a dynamic Pad, or handling Events) that were confusing and didn’t work when I tried them.
So, I was hoping someone here could help.
What is the standard or recommended way to loop a file in Membrane?
I’m looking for a stable and reliable approach.
Any help would be greatly appreciated.
Thanks in advance
Trending in Discussions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mat-hek
Hi there, unfortunately, due to how the framework is designed, it’s not straightforward. The best way IMO is to use the
handle_element_end_of_streamcallback to know when the stream finishes and restart the pipeline or a part of it. If you want to restart only a part of the pipeline, you need a tee between the part you want to restart and the rest. The stream needs to be at least demuxed (extracted from a container) at that point.Another approach is to use a looping filter that will buffer the entire stream, as described here. The problem with this approach is that it, well, buffers the entire stream
rudebono
Hello.
I got the idea from the
handle_element_end_of_streamcallback method you suggested and the link you shared.Instead of removing the pipeline to stop the media streaming with RTMP later,
I chose to use a custom
Membrane.Filterto loop the file again.Here is a simple example I made:
There’s no problem with
Membrane.PortAudio.Sink, but later, when I add an audio mixer and send it via RTMP, additional pipelines may be created.I’ll ask if I have more questions later.
It was very helpful, Thank you!