Skip to content

Commit

Permalink
Replace boombox with ffmpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
Noarkhh committed Nov 4, 2024
1 parent 74c0888 commit 300c200
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ defmodule Membrane.SimpleRTSPServer.Mixfile do
{:membrane_file_plugin, "~> 0.17.0"},
{:membrane_mp4_plugin, "~> 0.35.0"},
{:membrane_h26x_plugin, "~> 0.10.0"},
{:membrane_aac_plugin, "~> 0.19.0", override: true},
{:membrane_aac_plugin, "~> 0.19.0"},
{:ex_sdp, "~> 1.1"},
{:membrane_udp_plugin, "~> 0.14.0"},
{:membrane_realtimer_plugin, "~> 0.9.0"},
{:boombox, github: "membraneframework/boombox", branch: "fix-rtsp-track", 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
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
%{
"bandit": {:hex, :bandit, "1.5.7", "6856b1e1df4f2b0cb3df1377eab7891bec2da6a7fd69dc78594ad3e152363a50", [:mix], [{:hpax, "~> 1.0.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "f2dd92ae87d2cbea2fa9aa1652db157b6cba6c405cb44d4f6dd87abba41371cd"},
"bimap": {:hex, :bimap, "1.3.0", "3ea4832e58dc83a9b5b407c6731e7bae87458aa618e6d11d8e12114a17afa4b3", [:mix], [], "hexpm", "bf5a2b078528465aa705f405a5c638becd63e41d280ada41e0f77e6d255a10b4"},
"boombox": {:git, "https://github.com/membraneframework/boombox.git", "d443f9f194fc9d9732830eb5496029eaf6ab5a81", [branch: "fix-rtsp-track"]},
"bunch": {:hex, :bunch, "1.6.1", "5393d827a64d5f846092703441ea50e65bc09f37fd8e320878f13e63d410aec7", [:mix], [], "hexpm", "286cc3add551628b30605efbe2fca4e38cc1bea89bcd0a1a7226920b3364fe4a"},
"bunch_native": {:hex, :bunch_native, "0.5.0", "8ac1536789a597599c10b652e0b526d8833348c19e4739a0759a2bedfd924e63", [:mix], [{:bundlex, "~> 1.0", [hex: :bundlex, repo: "hexpm", optional: false]}], "hexpm", "24190c760e32b23b36edeb2dc4852515c7c5b3b8675b1a864e0715bdd1c8f80d"},
"bundlex": {:hex, :bundlex, "1.5.3", "35d01e5bc0679510dd9a327936ffb518f63f47175c26a35e708cc29eaec0890b", [:mix], [{:bunch, "~> 1.0", [hex: :bunch, repo: "hexpm", optional: false]}, {:elixir_uuid, "~> 1.2", [hex: :elixir_uuid, repo: "hexpm", optional: false]}, {:qex, "~> 0.5", [hex: :qex, repo: "hexpm", optional: false]}, {:req, ">= 0.4.0", [hex: :req, repo: "hexpm", optional: false]}, {:zarex, "~> 1.0", [hex: :zarex, repo: "hexpm", optional: false]}], "hexpm", "debd0eac151b404f6216fc60222761dff049bf26f7d24d066c365317650cd118"},
Expand Down
14 changes: 12 additions & 2 deletions test/integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ defmodule Membrane.SimpleRTSPServer.IntegrationTest do
output_path = Path.join(tmp_dir, "output.mp4")
Membrane.SimpleRTSPServer.start_link(input_path, port: 40_001)
Process.sleep(50)
Boombox.run(input: "rtsp://localhost:40001/", output: output_path)
# Boombox.run(input: "rtsp://localhost:40001/", output: output_path)
System.cmd("ffmpeg", [
"-i",
"rtsp://localhost:40001",
"-vcodec",
"copy",
"-acodec",
"copy",
"-y",
output_path
])

{:ok, %{size: input_size}} = File.stat(input_path)
{:ok, %{size: output_size}} = File.stat(output_path)
assert output_size in trunc(input_size * 0.95)..trunc(output_size * 1.05)
assert output_size in trunc(input_size * 0.95)..trunc(input_size * 1.05)
end
end

0 comments on commit 300c200

Please sign in to comment.