cgrimmett

cgrimmett

I would like to create a HLS playlist that I can upload to S3 and serve adaptive bitrate video to visitors. To achieve this, I want to create an Oban worker which takes the URL of a .ts file as input, and outputs a URL of a .m3u8 playlist. The playlist would then get embedded into Heex in my Phoenix app.

I found another post with some code from 2-3 years ago which does what I want, but the dependent Membrane framework library membrane_mpegts_plugin hasn’t been updated in 4 years and isn’t compatible with membrane_core 1.1.2.

I really need to work with .ts files so I figured I’d update membrane_mpegts_plugin. Thankfully, membrane_core has a good changelog and upgrade guides which outline what needs to change in the plugin. I’ve spent two days on the task and I’ve made lots of progress, but I’ve ran into a testing error that I’m having trouble understanding and working through.

  1) test Demuxer works in a Pipeline that defines links statically in its init (Membrane.MPEG.TS.IntegrationTest)
     test/mpeg_ts/integration_test.exs:13
     Assertion failed, no matching message after 2000ms
     Showing 2 of 2 messages in the mailbox
     code: assert_receive {Membrane.Testing.Pipeline, ^pid_value, {:handle_element_start_of_stream, {:audio_out, :input}}}
     mailbox:
       pattern: {
                  Membrane.Testing.Pipeline,
                  ^pid_value,
                  {
                    :handle_element_start_of_stream,
                    {:audio_out, :input}
                  }
                }
       value:   {Membrane.Testing.Pipeline, #PID<0.278.0>, :setup}

       pattern: {
                  Membrane.Testing.Pipeline,
                  ^pid_value,
                  {
                    :handle_element_start_of_stream,
                    {:audio_out, :input}
                  }
                }
       value:   {Membrane.Testing.Pipeline, #PID<0.278.0>, :play}
     stacktrace:
       test/mpeg_ts/integration_test.exs:34: Membrane.MPEG.TS.IntegrationTest.perform_integration_test/1
       test/mpeg_ts/integration_test.exs:14: (test)

https://github.com/insanity54/membrane_mpegts_plugin/commit/d6970c7c7dc8638272fe39197e2859fa20ab0971#diff-ec715e3216845119e910515ecdae108b3e958e265b48838d2256de489b063fc8R34

I’m struggling to understand why the shape of the pattern { Membrane.Testing.Pipeline, ^pid_value, { :handle_element_start_of_stream, {:audio_out, :input} } } is so different from the value {Membrane.Testing.Pipeline, #PID<0.278.0>, :play}. How come the pattern has a tuple after ^pid_value,, whereas the value has a :play atom after the PID? Normally this is where I would look at the code in the stack trace, but in this case there isn’t any file beyond integration_test.exs which I’m already familiar with.

I tried configuring ExUnit to show more stacktrace by setting :stacktrace_depth to 50, but that didn’t give me any more lines than the 2 I already see.

I’m hoping for some outside perspective to help get me back on track.

Showing Posts 1 to 2

varsill

varsill

Membrane Core Team

Hello @cgrimmett !
I think it might be easier for you to use: GitHub - kim-company/membrane_mpeg_ts_plugin: Membrane.Filter that demuxes MPEG-TS streams · GitHub which is a plugin containing MPEG-TS demuxer, maintained by a third party. This one is up to date with membrane_core v1.1 and it’s undergoing active development.
For the list of actively maintained plugins you can take a look here: GitHub - membraneframework/membrane_core: The core of Membrane Framework, multimedia processing framework written in Elixir · GitHub

Sorry for confusion, I think we should have deprecated that old membrane_mpegts_plugin package on Hex as I don’t think we plan to maintain it anymore.

I really appreciate you work on updating the plugin, I know how exhausting it can be!

If you would like to continue on updating membrane_mpegts_plugin, I can try to help with this one (but I definitely recommend trying the third party plugin).
It seems that for some reason buffers are not flowing in the pipeline. I suspect that it might have something to do with the fact, that now the default flow_control for both input and output pads in the filter is :auto and not :manual, as it used to be. It means that the logic in handle_demand nor sending :demand actions work at all.

cgrimmett

cgrimmett OP

Oh thank you! I didn’t realize there was another mpeg-ts library. I will use that one instead.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews