Skip to content

Commit

Permalink
Add mapping between membrane and ffmpeg profiles namings (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noarkhh authored Mar 14, 2024
1 parent 18f736f commit 19caea8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Note: `Membrane.H264.FFmpeg.Parser` has been removed. Now you can use our pure E
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.

```elixir
{:membrane_h264_ffmpeg_plugin, "~> 0.31.4"}
{:membrane_h264_ffmpeg_plugin, "~> 0.31.5"}
```

This package depends on the [ffmpeg](https://www.ffmpeg.org) libraries. The precompiled builds will be pulled and linked automatically. However, should there be any problems, consider installing it manually.
Expand Down
14 changes: 13 additions & 1 deletion lib/membrane_h264_ffmpeg/encoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ defmodule Membrane.H264.FFmpeg.Encoder do
stream_format.pixel_format,
state.preset,
state.tune,
state.profile,
get_ffmpeg_profile(state.profile),
state.max_b_frames || -1,
state.gop_size || -1,
timebase_num,
Expand Down Expand Up @@ -228,4 +228,16 @@ defmodule Membrane.H264.FFmpeg.Encoder do
profile: state.profile
}}
end

defp get_ffmpeg_profile(profile) do
case profile do
:high_10 -> :high10
:high_10_intra -> :high10
:high_422 -> :high422
:high_422_intra -> :high422
:high_444 -> :high444
:high_444_intra -> :high444
other -> other
end
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.H264.FFmpeg.Plugin.MixProject do
use Mix.Project

@version "0.31.4"
@version "0.31.5"
@github_url "https://github.com/membraneframework/membrane_h264_ffmpeg_plugin"

def project do
Expand Down

0 comments on commit 19caea8

Please sign in to comment.