Skip to content

Minor improvements, release v0.1.1 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
9 changes: 9 additions & 0 deletions lib/transcoder/audio.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions lib/transcoder/video.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"},
Expand All @@ -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
Expand Down