membraneframework / membrane_core

The core of the Membrane Framework, multimedia processing framework written in Elixir
https://membrane.stream
Apache License 2.0
1.31k stars 39 forks source link

`membrane_webrtc_plugin` crashes due to dtls handshake error #895

Open dre1080 opened 2 weeks ago

dre1080 commented 2 weeks ago

I'm trying to run a pipeline on a Nerves device and it keeps crashing with reason: {:shutdown, :handshake_error}

Pipeline:

defmodule MyApp.Pipeline do
  @moduledoc false

  use Membrane.Pipeline

  def start_link(options) do
    Membrane.Pipeline.start_link(__MODULE__, options, name: __MODULE__)
  end

  @impl true
  def handle_init(_ctx, _opts) do
    spec = [
      child(:source, %Membrane.Rpicam.Source{width: 960, height: 540, camera_open_delay: Membrane.Time.milliseconds(1000)})
      |> child(:realtimer, Membrane.Realtimer)
      |> child(:nalu_parser, %Membrane.H264.Parser{output_stream_structure: :annexb, output_alignment: :nalu})
      |> via_in(:input, options: [kind: :video])
      |> child(:webrtc, %Membrane.WebRTC.Sink{
        signaling: {:websocket, ip: :any, port: 8081},
        tracks: [:video],
        video_codec: :h264,
        ice_servers: []
      })
    ]

    {[spec: spec], %{}}
  end

  @impl true
  def handle_element_end_of_stream(:webrtc, _pad, _ctx, state) do
    {[terminate: :normal], state}
  end

  @impl true
  def handle_element_end_of_stream(_child, _pad, _ctx, state) do
    {[], state}
  end
end

Logs: 1000036858

mat-hek commented 2 weeks ago

Hi there, we haven't been able to run the WebRTC plugin on Nerves yet and unfortunately had to postpone that for now - we plan to get back to it next month. I suspect this may be a problem with elixir_webrtc - can you try running one of their demos?

cc @mickel8

dre1080 commented 2 weeks ago

It's weird. My pipeline and demos work with one device (pi4) and not on the other (cm4). It gives a handshake error.

mickel8 commented 2 weeks ago

Hi @dre1080, sorry but I won't be able to take a look at this this week. Maybe that can be related to https://github.com/elixir-webrtc/ex_dtls/issues/31