Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gBillal committed Feb 27, 2024
1 parent b34977f commit 4d7e29f
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 29 deletions.
5 changes: 5 additions & 0 deletions examples/demuxer_isom.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Mix.install([
:membrane_aac_plugin,
:membrane_hackney_plugin,
:membrane_h26x_plugin,
{:membrane_mp4_plugin, path: __DIR__ |> Path.join("..") |> Path.expand()}
])

Expand All @@ -11,6 +12,10 @@ defmodule Example do
@output_video "example.h264"
@output_audio "example.aac"

def start_link() do
Membrane.Pipeline.start_link(__MODULE__)
end

@impl true
def handle_init(_ctx, _opts) do
structure = [
Expand Down
6 changes: 5 additions & 1 deletion examples/muxer_cmaf.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Mix.install([
:membrane_aac_plugin,
:membrane_h264_plugin,
:membrane_h26x_plugin,
:membrane_hackney_plugin,
:membrane_http_adaptive_stream_plugin,
{:membrane_mp4_plugin, path: __DIR__ |> Path.join("..") |> Path.expand(), override: true}
Expand All @@ -18,6 +18,10 @@ defmodule Example do
@video_url @samples_url <> "bun33s_720x480.h264"
@output_dir "hls_output"

def start_link() do
Membrane.Pipeline.start_link(__MODULE__)
end

@impl true
def handle_init(_ctx, _opts) do
File.rm_rf(@output_dir)
Expand Down
6 changes: 5 additions & 1 deletion examples/muxer_isom.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Mix.install([
:membrane_aac_plugin,
:membrane_h264_plugin,
:membrane_h26x_plugin,
:membrane_hackney_plugin,
{:membrane_mp4_plugin, path: __DIR__ |> Path.join("..") |> Path.expand()}
])
Expand All @@ -13,6 +13,10 @@ defmodule Example do
@audio_url @samples_url <> "test-audio.aac"
@output_file "example.mp4"

def start_link() do
Membrane.Pipeline.start_link(__MODULE__)
end

@impl true
def handle_init(_ctx, _opts) do
structure = [
Expand Down
1 change: 1 addition & 0 deletions lib/membrane_mp4/muxer/cmaf.ex
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ defmodule Membrane.MP4.Muxer.CMAF do
tracks
|> Enum.find_value(fn
%Track{stream_format: %H264{width: width, height: height}} -> {width, height}
%Track{stream_format: %H265{width: width, height: height}} -> {width, height}
_audio_track -> nil
end)

Expand Down
2 changes: 1 addition & 1 deletion lib/membrane_mp4/track.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ defmodule Membrane.MP4.Track do

@spec get_encoding_info(__MODULE__.t()) ::
{:mp4a, %{aot_id: binary(), channels: integer(), frequency: integer()}}
| {:avc1, %{profile: binary(), compatibiliy: binary(), level: binary()}}
| {:avc1, %{profile: binary(), compatibility: binary(), level: binary()}}
| {:hvc1,
%{profile: non_neg_integer(), tier: non_neg_integer(), level: non_neg_integer()}}
| nil
Expand Down
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ defmodule Membrane.MP4.Plugin.MixProject do
{:membrane_h265_format, "~> 0.2.0"},
{:membrane_opus_format, "~> 0.3.0"},
{:membrane_file_plugin, "~> 0.16.0"},
{:membrane_h264_plugin, "~> 0.9.0"},
{:bunch, "~> 1.5"},
{:membrane_h26x_plugin, "~> 0.10.0", only: :test},
{:membrane_aac_plugin, "~> 0.18.0", only: :test},
{:membrane_opus_plugin, "~> 0.19.0", only: :test},
{:membrane_stream_plugin, "~> 0.4.0", only: :test},
{:membrane_fake_plugin, "~> 0.11.0", only: :test},
{:membrane_h265_plugin, "~> 0.4.0", only: :test},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:dialyxir, ">= 0.0.0", only: :dev, runtime: false},
{:credo, ">= 0.0.0", only: :dev, runtime: false}
Expand Down
47 changes: 23 additions & 24 deletions mix.lock

Large diffs are not rendered by default.

0 comments on commit 4d7e29f

Please sign in to comment.