Skip to content

Conversation

@sgfn
Copy link
Member

@sgfn sgfn commented Jun 12, 2025

  • we're now using membrane as well as ffmpeg
  • ffmpeg will no longer await user input indefinitely
  • reordering buffer (packetstore) size is capped and can be changed
  • reencoding can now be toggled and parametrized

@sgfn sgfn requested review from brzep and mickel8 June 12, 2025 13:48
@sgfn sgfn changed the title Recorder fixes Recording converter fixes Jun 12, 2025
@@ -0,0 +1,95 @@
defmodule ExWebRTC.Recorder.Converter.Pipeline do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A short doc explaining what this pipeline does would be appreciated

@moduledoc false
use Membrane.Source

def_options(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

including membrane_core in .formatter.exs should help here

* `:reorder_buffer_size` - Size of the buffer used for reordering late packets. `#{@default_reorder_buffer_size}` by default.
Increasing this value may help with "Decoded late RTP packet" warnings,
but keep in mind that larger values slow the conversion process considerably.
* `:reencode_ctx` - If passed, Converter will reencode the video using FFmpeg.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add info when this is helpful


:audio ->
%{nil: convert_audio_track(id, output_path, packets |> Map.values() |> hd())}
%{nil: get_audio_track_context(packets |> Map.values() |> hd())}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not super clean 😅

) do
stream_map =
Enum.reduce(manifest, %{}, fn {id, track}, stream_map ->
Enum.reduce(manifest, %{}, fn {_id, track}, stream_map ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of comments explaining step by step what we are doing here would be cool, e.g.:

  1. Read tracks
  2. convert tracks to webm files
  3. mux webm files into a single file

{:ok, _sup, pid} = Pipeline.start_link(video_stream, audio_stream, output_file)
Process.monitor(pid)

# FIXME: Possible RC here?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we elaborate?

@sgfn
Copy link
Member Author

sgfn commented Jun 18, 2025

@mickel8 Any issue with bumping ex_webrtc from 0.13 to 0.14 and making a new release?

@sgfn sgfn merged commit 8b2fc97 into main Jun 23, 2025
1 check passed
@sgfn sgfn deleted the sgfn/recorder-fixes branch June 23, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants