Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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.3.1"}
{:membrane_transcoder_plugin, "~> 0.3.2"}
]
end
```
Expand Down
26 changes: 22 additions & 4 deletions lib/transcoder/video.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ defmodule Membrane.Transcoder.Video do
@type video_stream_format :: VP8.t() | VP9.t() | H264.t() | H265.t() | RawVideo.t()

defguard is_video_format(format)
when is_struct(format) and
(format.__struct__ in [VP8, VP9, H264, H265, RawVideo] or
(format.__struct__ == RemoteStream and format.content_format in [VP8, VP9] and
format.type == :packetized))
when (is_struct(format) and
(format.__struct__ in [VP8, VP9, H264, H265, RawVideo] or
(format.__struct__ == RemoteStream and
format.content_format in [VP8, VP9] and
format.type == :packetized))) or
(format.__struct__ == RemoteStream and
format.content_format in [H264, H265])

@spec plug_video_transcoding(
ChildrenSpec.builder(),
Expand All @@ -24,6 +27,21 @@ defmodule Membrane.Transcoder.Video do
do_plug_video_transcoding(builder, input_format, output_format, transcoding_policy)
end

defp do_plug_video_transcoding(
builder,
%RemoteStream{content_format: h26x},
output_format,
transcoding_policy
)
when h26x in [H264, H265] do
do_plug_video_transcoding(
builder,
struct!(h26x),
output_format,
transcoding_policy
)
end

defp do_plug_video_transcoding(builder, %H264{}, %H264{} = output_format, transcoding_policy)
when transcoding_policy in [:if_needed, :never] do
builder
Expand Down
2 changes: 1 addition & 1 deletion 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.3.1"
@version "0.3.2"
@github_url "https://github.com/membraneframework/membrane_transcoder_plugin"

def project do
Expand Down