From f40c4de6b753f5247e689eeafcc84ab127677841 Mon Sep 17 00:00:00 2001 From: "feliks.pobiedzinski@swmansion.com" Date: Tue, 4 Feb 2025 12:42:25 +0100 Subject: [PATCH 1/3] Minor buf fixes, release v0.1.1 --- README.md | 2 +- lib/transcoder/audio.ex | 9 +++++++++ mix.exs | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 28a9d37..ed2f521 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The package can be installed by adding `membrane_transcoder_plugin` to your list ```elixir def deps do [ - {:membrane_transcoder_plugin, "~> 0.1.0"} + {:membrane_transcoder_plugin, "~> 0.1.1"} ] end ``` diff --git a/lib/transcoder/audio.ex b/lib/transcoder/audio.ex index 301d075..2c71c5e 100644 --- a/lib/transcoder/audio.ex +++ b/lib/transcoder/audio.ex @@ -53,11 +53,20 @@ defmodule Membrane.Transcoder.Audio do defp do_plug_audio_transcoding(builder, input_format, output_format) do builder + |> maybe_plug_parser(input_format) |> maybe_plug_decoder(input_format) |> maybe_plug_resampler(input_format, output_format) |> maybe_plug_encoder(output_format) end + defp maybe_plug_parser(builder, %AAC{}) do + builder |> child(:aac_parser, AAC.Parser) + end + + defp maybe_plug_parser(builder, _input_format) do + builder + end + defp maybe_plug_decoder(builder, %Opus{}) do builder |> child(:opus_decoder, Opus.Decoder) end diff --git a/mix.exs b/mix.exs index a04dba7..532f2c6 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.Transcoder.Plugin.Mixfile do use Mix.Project - @version "0.1.0" + @version "0.1.1" @github_url "https://github.com/membraneframework/membrane_transcoder_plugin" def project do @@ -39,6 +39,7 @@ defmodule Membrane.Transcoder.Plugin.Mixfile do [ {:membrane_core, "~> 1.1"}, {:membrane_opus_plugin, "~> 0.20.3"}, + {:membrane_aac_plugin, "~> 0.19.0"}, {:membrane_aac_fdk_plugin, "~> 0.18.0"}, {:membrane_vpx_plugin, "~> 0.2.0"}, {:membrane_h26x_plugin, "~> 0.10.0"}, @@ -57,7 +58,6 @@ defmodule Membrane.Transcoder.Plugin.Mixfile do {:credo, ">= 0.0.0", only: :dev, runtime: false}, {:membrane_file_plugin, "~> 0.17.2", only: :test}, {:membrane_raw_audio_parser_plugin, "~> 0.4.0", only: :test}, - {:membrane_aac_plugin, "~> 0.19.0", only: :test}, {:membrane_ivf_plugin, "~> 0.8.0", only: :test} ] end From 42be5f90b669e26660cceff1063c7e14b57ae8af Mon Sep 17 00:00:00 2001 From: "feliks.pobiedzinski@swmansion.com" Date: Tue, 4 Feb 2025 13:44:00 +0100 Subject: [PATCH 2/3] support remote stream with vp8 --- , | 14 ++++++++++++++ lib/transcoder/video.ex | 14 ++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 , diff --git a/, b/, new file mode 100644 index 0000000..7bfed06 --- /dev/null +++ b/, @@ -0,0 +1,14 @@ +// Copyright 2025 feliks +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + diff --git a/lib/transcoder/video.ex b/lib/transcoder/video.ex index c4cd7be..b025ebd 100644 --- a/lib/transcoder/video.ex +++ b/lib/transcoder/video.ex @@ -3,12 +3,15 @@ defmodule Membrane.Transcoder.Video do import Membrane.ChildrenSpec require Membrane.Logger - alias Membrane.{ChildrenSpec, H264, H265, RawVideo, VP8} + alias Membrane.{ChildrenSpec, H264, H265, RawVideo, RemoteStream, VP8} @type video_stream_format :: VP8.t() | H264.t() | H265.t() | RawVideo.t() defguard is_video_format(format) - when is_struct(format) and format.__struct__ in [VP8, H264, H265, RawVideo] + when is_struct(format) and + (format.__struct__ in [VP8, H264, H265, RawVideo] or + (format.__struct__ == RemoteStream and format.content_format == VP8 and + format.type == :packetized)) @spec plug_video_transcoding( ChildrenSpec.builder(), @@ -69,6 +72,13 @@ defmodule Membrane.Transcoder.Video do builder |> child(:vp8_decoder, %VP8.Decoder{}) end + defp maybe_plug_parser_and_decoder(builder, %RemoteStream{ + content_format: VP8, + type: :packetized + }) do + builder |> child(:vp8_decoder, %VP8.Decoder{}) + end + defp maybe_plug_parser_and_decoder(builder, %RawVideo{}) do builder end From 1a30ccdb2a39ea4c1abdd61bed360e4dc46d35e8 Mon Sep 17 00:00:00 2001 From: "feliks.pobiedzinski@swmansion.com" Date: Tue, 4 Feb 2025 13:44:49 +0100 Subject: [PATCH 3/3] Remove leftover --- , | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 , diff --git a/, b/, deleted file mode 100644 index 7bfed06..0000000 --- a/, +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2025 feliks -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -