All Projects → muxinc → Mux Elixir

muxinc / Mux Elixir

Licence: mit
Official Mux API wrapper for Elixir projects, supporting both Mux Data and Mux Video.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Mux Elixir

mux-python
Official Mux API wrapper for python projects, supporting both Mux Data and Mux Video.
Stars: ✭ 34 (-17.07%)
Mutual labels:  video-processing, video-streaming, mux
mux-go
Official Mux API wrapper for golang projects, supporting both Mux Data and Mux Video.
Stars: ✭ 69 (+68.29%)
Mutual labels:  video-processing, video-streaming, mux
Awesome Video
A curated list of awesome video frameworks, libraries, specifications and software.
Stars: ✭ 124 (+202.44%)
Mutual labels:  video-processing, video-streaming
Screen Recorder Ffmpeg Cpp
*Multimedia project* A screen recording application to capture your desktop and store in a video format. Click here to watch the demo
Stars: ✭ 98 (+139.02%)
Mutual labels:  video-processing, video-streaming
gilfoyle
Distributed video encoding, hosting and streaming (WIP)
Stars: ✭ 73 (+78.05%)
Mutual labels:  video-processing, video-streaming
SSffmpegVideoOperation
This is a library of FFmpeg for android... 📸 🎞 🚑
Stars: ✭ 261 (+536.59%)
Mutual labels:  video-processing, video-streaming
Server
The Kaltura Platform Backend. To install Kaltura, visit the install packages repository.
Stars: ✭ 293 (+614.63%)
Mutual labels:  video-processing, video-streaming
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+4895.12%)
Mutual labels:  video-processing, video-streaming
laav
Asynchronous Audio / Video Library for H264 / MJPEG / OPUS / AAC / MP2 encoding, transcoding, recording and streaming from live sources
Stars: ✭ 50 (+21.95%)
Mutual labels:  video-processing, video-streaming
tssi2
tssi2 is a header-only library for parsing MPEG-2 and DVB Transport Streams in the domain of multimedia processing applications.
Stars: ✭ 18 (-56.1%)
Mutual labels:  video-processing, video-streaming
Platform Install Packages
Official deployment packages to install the Kaltura platform on a server or cluster environments using native OS package managers
Stars: ✭ 436 (+963.41%)
Mutual labels:  video-processing, video-streaming
Metalpetal
A GPU accelerated image and video processing framework built on Metal.
Stars: ✭ 907 (+2112.2%)
Mutual labels:  video-processing
Go Book Store Api
Go Sample project to understand Mysql CRUD operation with best practises Includes logging, JWT, Swagger and Transactions
Stars: ✭ 18 (-56.1%)
Mutual labels:  mux
Anime4kcpp
A high performance anime upscaler
Stars: ✭ 887 (+2063.41%)
Mutual labels:  video-processing
Arcan
Arcan - [Display Server, Multimedia Framework, Game Engine] -> "Desktop Engine"
Stars: ✭ 885 (+2058.54%)
Mutual labels:  video-processing
Mpv Reload
mpv plugin for automatic reloading of slow/stuck video streams
Stars: ✭ 29 (-29.27%)
Mutual labels:  video-streaming
Ksylive ios
金山云直播SDK [ iOS推流+播放 ]融合版 支持美颜滤镜(Beauty Filter)、美声(Beauty Voice)、软硬编(Software/Hardware Encoder) 、网络自适应(Network Auto Adapt)、混音(Audio Mixer)、混响(Reverb)、画中画(PIP)
Stars: ✭ 861 (+2000%)
Mutual labels:  video-streaming
Ltvideorecorder
A demo project demonstrating how to add filter, drawing, and text to a video
Stars: ✭ 16 (-60.98%)
Mutual labels:  video-processing
Mlt
MLT Multimedia Framework
Stars: ✭ 836 (+1939.02%)
Mutual labels:  video-processing
Fuse Ts
Stars: ✭ 6 (-85.37%)
Mutual labels:  video-processing

Mux Elixir Banner

Mux Elixir

build status

Official Mux API wrapper for Elixir projects, supporting both Mux Data and Mux Video.

Mux Video is an API-first platform, powered by data and designed by video experts to make beautiful video possible for every development team.

Mux Data is a platform for monitoring your video streaming performance with just a few lines of code. Get in-depth quality of service analytics on web, mobile, and OTT devices.

Not familiar with Mux? Check out https://mux.com/ for more information.

Installation

Add mux to your list of dependencies in mix.exs:

def deps do
  [
    {:mux, "~> 1.9.0"}
  ]
end

Quickstart

We'll put our access token in our application configuration.

# config/dev.exs
config :mux,
  access_token_id: "abcd1234",
  access_token_secret: "efghijkl"

Then use this config to initialize a new client in your application.

client = Mux.client()

You can also pass the access token ID and secret directly to client/2 function if you'd prefer:

client = Mux.client("access_token_id", "access_token_secret")

Now we can use the client to do anything your heart desires (to do with the Mux API). From here we can create new videos, manage playback IDs, etc.

{:ok, asset, raw_env} = Mux.Assets.create(client, %{input: "https://example.com/video.mp4"});

Every successful response will come back with a 3 item tuple starting with :ok. The second item is whatever's in the data key, which will typically be the the item you were interacting with. In the example above, it's a single asset. The third item is the raw Tesla Env, which is basically the raw response object. This can be useful if you want to get to metadata we include, such as the timeframe used or the total row count returned, or if you just want to get to headers such as the request ID for support reasons.

Usage in Phoenix

Creating a new client before making a request is simple, but you may not want to do it every single time you need to use a function in a controller. We suggest using action/2 to initialize the client and pass that to each of the controller functions.

def action(conn, _) do
  mux_client = Mux.client() # or Mux.client("access_token_id", "access_token_secret")
  args = [conn, conn.params, mux_client]
  apply(__MODULE__, action_name(conn), args)
end

def create(conn, params, mux_client) do
  # ...
  {:ok, asset, _} = mux_client |> Mux.Video.Assets.create(%{input: "http://example.com/input.mp4"})
  # ...
end

Verifying Webhook Signatures in Phoenix

Note that when calling Mux.Webhooks.verify_header/3 in Phoenix you will need to pass in the raw request body, not the parsed JSON. Phoenix has a nice solution for doing this example.

Read more about verifying webhook signatures in our guide

defmodule MyAppWeb.BodyReader do
  def read_body(conn, opts) do
    {:ok, body, conn} = Plug.Conn.read_body(conn, opts)
    conn = update_in(conn.assigns[:raw_body], &[body | &1 || []])
    {:ok, body, conn}
  end
end

# endpoint.ex
plug Plug.Parsers,
  parsers: [:urlencoded, :multipart, :json],
  pass: ["*/*"],
  body_reader: {MyAppWeb.BodyReader, :read_body, []},
  json_decoder: Phoenix.json_library()

# controller
signature_header = List.first(get_req_header(conn, "mux-signature"))
raw_body = List.first(conn.assigns.raw_body)
Mux.Webhooks.verify_header(raw_body, signature_header, secret)

You will most likely have to store the raw body before it gets parsed and then extract it later and pass it into Mux.Webhooks.verify_header/3


Publishing new versions

  1. Update version in mix.exs
  2. Update version in README
  3. Commit and open a PR
  4. After code is merged, tag master ex: git tag v1.7.0 and git push --tags
  5. run mix publish
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].