https://github.com/membraneframework/membrane_generator_plugin
Video and audio samples generator
https://github.com/membraneframework/membrane_generator_plugin
Last synced: 4 months ago
JSON representation
Video and audio samples generator
- Host: GitHub
- URL: https://github.com/membraneframework/membrane_generator_plugin
- Owner: membraneframework
- License: apache-2.0
- Created: 2021-10-13T12:36:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-17T14:51:29.000Z (over 2 years ago)
- Last Synced: 2025-10-20T02:59:49.967Z (8 months ago)
- Language: Elixir
- Homepage: https://membrane.stream
- Size: 85.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Membrane Generator Plugin
[](https://hex.pm/packages/membrane_generator_plugin)
[](https://hexdocs.pm/membrane_generator_plugin)
[](https://circleci.com/gh/membraneframework/membrane_generator_plugin)
This repository contains audio and video generator.
It is part of [Membrane Multimedia Framework](https://membraneframework.org).
## Installation
The package can be installed by adding `membrane_generator_plugin` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:membrane_generator_plugin, "~> 0.10.1"}
]
end
```
## Usage Example
### Silence generator
```elixir
defmodule AudioGenerating.Pipeline do
use Membrane.Pipeline
@impl true
def handle_init(_ctx, _opts) do
structure =
child(
:generator, %Membrane.SilenceGenerator{
stream_format: %Membrane.RawAudio{
channels: 1,
sample_rate: 16_000,
sample_format: :s16le
},
duration: Membrane.Time.milliseconds(100)
})
|> child(:sink, %Membrane.File.Sink{location: "/tmp/output.raw"})
{[spec: structure], %{}}
end
end
```
### Blank Video Generator
```elixir
defmodule VideoGenerating.Pipeline do
use Membrane.Pipeline
@impl true
def handle_init(_ctx, _opts) do
structure =
child(
:generator,
%Membrane.BlankVideoGenerator{
stream_format: %Membrane.RawVideo{
pixel_format: :I420,
height: 720,
width: 1280,
framerate: {30, 1},
aligned: true
},
duration: Membrane.Time.milliseconds(100)
}
)
|> child(:sink, %Membrane.File.Sink{location: "/tmp/output.raw"})
{[spec: structure], %{}}
end
end
```
## Copyright and License
Copyright 2021, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_generator_plugin)
[](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane_generator_plugin)
Licensed under the [Apache License, Version 2.0](LICENSE)