Code Monkey home page Code Monkey logo

membrane_s3_plugin's Introduction

Membrane S3 Plugin

Membrane S3 Plugin CI Workflow Hex.pm API Docs

This plugin provides a Membrane Sink that writes to Amazon S3, or other object stores that use the AWS S3 API. It will eventually also provide a membrane Source that reads from S3, but my current project doesn't need it yet.

It is designed to work with the Membrane Multimedia Framework.

Installation

The package can be installed by adding membrane_s3_plugin to your list of dependencies in mix.exs:

def deps do
  [
    {:membrane_s3_plugin, "~> 0.1"}
  ]
end

This library depends on ex_aws_s3 and ex_aws. ex_aws requires a http client. The default is hackney.

If you are content with hackney as your http client, add {:hackney, "~> 1.18"} to your list of dependencies in mix.exs. For other http clients, you may override the :ex_aws, :http_client configuration to point to a module that implements the ExAws.Request.HttpClient behavior.

Because this library does no transcoding or packaging, no non-BEAM dependencies are required.

Usage example

If you have AWS environment variables set up (see ExAws documentation), and include the membrane_file_plugin in your mix.exs dependencies, you can write a simple pipeline to write to S3:

defmodule Membrane.ReleaseTest.Pipeline do
  use Membrane.Pipeline

  alias Membrane.S3.Sink

  @impl true
  def handle_init(_) do
    children = [
      source: %Membrane.File.Source{
        location: "/tmp/input.raw"
      },
      sink: %Membrane.S3.Sink{
          bucket: "membrane-s3-plugin-test-bucket-us-east-1",
          path: "example.txt",
      }
    ]

    links = [
      link(:source)
      |> to(:sink)
    ]

    {{:ok, spec: %ParentSpec{children: children, links: links}}, %{}}
  end
end

More complex pipelines can be constructed by adding transcoders, packaging, and other components, and linking them together. This minimalist example demonstrates how to construct a pipeline with no intermediate processing.

For additional configuration options, including alternate mechanisms, view the documentation.

Contributing

  1. Fork the repository.
  2. Clone the fork.
  3. Make your changes.
  4. Make sure to run mix format, mix credo and mix dialyzer and fix any issues that crop up.
  5. Commit your changes. Add tests, please!
  6. Create a pull request.

Documentation

Documentation can be generated with ExDoc.

The documentation is also published on HexDocs.

Changelog

Release history is in the project Changelog.

Copyright and License

© 2022 YuzuTen LLC. Licensed under the Apache license.

This plugin was originally written by Jason Truesdell with support from IndustrialML, Inc.

membrane_s3_plugin's People

Contributors

jasontrue avatar dependabot[bot] avatar jbcden avatar

Stargazers

Kasun Vithanage avatar Carlo Gilmar avatar Menegazzi avatar Michał Śledź avatar Paul Geraghty avatar

Watchers

 avatar James Cloos avatar

membrane_s3_plugin's Issues

Error handling needs to be cleaned up

In a haphazard manner to move from the ! version of ExAws.request/2, I return the error tuple inconsistently in a couple of spots in the sink.ex module.

This is just a reminder to make sure those actually conform to the shape specified in those callbacks as specified in Membrane, and add tests around that.

Update to newer version of `membrane_core`

Hello 👋

Looks like this plugin isn't compatible with the latest version of Membrane:

Because every version of membrane_s3_plugin depends on membrane_core ~> 0.10 and your app depends on membrane_core ~> 1.1, no version of membrane_s3_plugin is allowed.
So, because your app depends on membrane_s3_plugin ~> 0.1, version solving failed.
** (Mix) Hex dependency resolution failed

Do you plan on updating it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.