oleg.okunevych
oleg.okunevych
SMSoftware Mansion
Created by oleg.okunevych on 1/24/2025 in #membrane-help
RTSP push approach with Membrane.RTSP.Server
We are trying to add RTSP into media server, using Membrane. The main thing is that we need to implement push approach: Elixir TCP server starts listening for incoming RTSP connections from cameras, and then pushes the incoming RTSP video stream to the clients. We used Membrane.RTSP.Server with handler which handles announce, describe and record steps accordingly. On RECORD step, we are passing socket control to pipeline pid:
Enum.each(tracks, fn {_, track} ->
options = [
:binary,
active: false,
reuseaddr: true,
debug: false
]

:ok = :inet.setopts(track.rtp_socket, options)
:ok = :gen_udp.controlling_process(track.rtp_socket, pipeline_pid)
end)
Enum.each(tracks, fn {_, track} ->
options = [
:binary,
active: false,
reuseaddr: true,
debug: false
]

:ok = :inet.setopts(track.rtp_socket, options)
:ok = :gen_udp.controlling_process(track.rtp_socket, pipeline_pid)
end)
This is done in order to pass the socket control to the UDPReceiver module, which takes socket control from the pipeline and listens for incoming RTP packets. The UDPReceiver module is a Membrane.Source module, which is supposed to receive UDP packets and push them to the output pad.
12 replies
SMSoftware Mansion
Created by oleg.okunevych on 9/25/2024 in #membrane-help
stream RTMP to VLC Network stream
Hello, currently we are using membrane_rtmp_plugin to receive RTMP Stream as source (with help of Membrane.RTMPServer and Membrane.RTMP.SourceBin). All is fine, we migrated successfully to 0.26.0 version, which simplifies pipeline a lot. Also we did a POC of streaming RTMP to streaming service (Youtube) and everything is working as expected. I am curious, is there any way to stream RTMP to VLC Player (probably it is called pull approach)? I mean File -> Open Network -> Specify URL (eg. rtmp://localhost:1935/app/stream1)
9 replies
SMSoftware Mansion
Created by oleg.okunevych on 4/26/2024 in #membrane-help
Running Docker image with Membrane RTMP Plugin
Hello, I am trying to run a Docker container with membrane_rtmp_plugin library, it builds successfully, however I am getting following error:
2024-04-26 16:11:04 =CRASH REPORT==== 26-Apr-2024::13:11:04.943773 ===
2024-04-26 16:11:04 crasher:
2024-04-26 16:11:04 initial call: kernel:init/1
2024-04-26 16:11:04 pid: <0.2488.0>
2024-04-26 16:11:04 registered_name: []
2024-04-26 16:11:04 exception exit: {on_load_function_failed,
2024-04-26 16:11:04 'Elixir.Membrane.RTMP.Sink.Native.Nif',abort}
2024-04-26 16:11:04 in function init:run_on_load_handlers/0
2024-04-26 16:11:04 in call from kernel:init/1 (kernel.erl, line 227)
2024-04-26 16:11:04 ancestors: [kernel_sup,<0.2481.0>]
2024-04-26 16:11:04 message_queue_len: 0
2024-04-26 16:11:04 messages: []
2024-04-26 16:11:04 links: [<0.2483.0>]
2024-04-26 16:11:04 dictionary: []
2024-04-26 16:11:04 trap_exit: false
2024-04-26 16:11:04 status: running
2024-04-26 16:11:04 heap_size: 376
2024-04-26 16:11:04 stack_size: 28
2024-04-26 16:11:04 reductions: 141
2024-04-26 16:11:04 neighbours:
2024-04-26 16:11:04
2024-04-26 16:11:04 =SUPERVISOR REPORT==== 26-Apr-2024::13:11:04.943806 ===
2024-04-26 16:11:04 supervisor: {local,kernel_sup}
2024-04-26 16:11:04 errorContext: start_error
2024-04-26 16:11:04 reason: {on_load_function_failed,'Elixir.Membrane.RTMP.Sink.Native.Nif',
2024-04-26 16:11:04 abort}
2024-04-26 16:11:04 offender: [{pid,undefined},
2024-04-26 16:11:04 {id,on_load},
2024-04-26 16:11:04 {mfargs,{proc_lib,start_link,[kernel,init,[on_load]]}},
2024-04-26 16:11:04 {restart_type,transient},
2024-04-26 16:11:04 {significant,false},
2024-04-26 16:11:04 {shutdown,2000},
2024-04-26 16:11:04 {child_type,worker}]
2024-04-26 16:11:04
2024-04-26 16:11:04 =CRASH REPORT==== 26-Apr-2024::13:11:04.943773 ===
2024-04-26 16:11:04 crasher:
2024-04-26 16:11:04 initial call: kernel:init/1
2024-04-26 16:11:04 pid: <0.2488.0>
2024-04-26 16:11:04 registered_name: []
2024-04-26 16:11:04 exception exit: {on_load_function_failed,
2024-04-26 16:11:04 'Elixir.Membrane.RTMP.Sink.Native.Nif',abort}
2024-04-26 16:11:04 in function init:run_on_load_handlers/0
2024-04-26 16:11:04 in call from kernel:init/1 (kernel.erl, line 227)
2024-04-26 16:11:04 ancestors: [kernel_sup,<0.2481.0>]
2024-04-26 16:11:04 message_queue_len: 0
2024-04-26 16:11:04 messages: []
2024-04-26 16:11:04 links: [<0.2483.0>]
2024-04-26 16:11:04 dictionary: []
2024-04-26 16:11:04 trap_exit: false
2024-04-26 16:11:04 status: running
2024-04-26 16:11:04 heap_size: 376
2024-04-26 16:11:04 stack_size: 28
2024-04-26 16:11:04 reductions: 141
2024-04-26 16:11:04 neighbours:
2024-04-26 16:11:04
2024-04-26 16:11:04 =SUPERVISOR REPORT==== 26-Apr-2024::13:11:04.943806 ===
2024-04-26 16:11:04 supervisor: {local,kernel_sup}
2024-04-26 16:11:04 errorContext: start_error
2024-04-26 16:11:04 reason: {on_load_function_failed,'Elixir.Membrane.RTMP.Sink.Native.Nif',
2024-04-26 16:11:04 abort}
2024-04-26 16:11:04 offender: [{pid,undefined},
2024-04-26 16:11:04 {id,on_load},
2024-04-26 16:11:04 {mfargs,{proc_lib,start_link,[kernel,init,[on_load]]}},
2024-04-26 16:11:04 {restart_type,transient},
2024-04-26 16:11:04 {significant,false},
2024-04-26 16:11:04 {shutdown,2000},
2024-04-26 16:11:04 {child_type,worker}]
2024-04-26 16:11:04
12 replies