# Membrane Multimedia Framework: SDL element

[![API Docs](](

This package provides an [SDL]( video player.

It is part of [Membrane Multimedia Framework](

## Installation

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

def deps do
    {:membrane_element_sdl, "~> 0.2.0"}

The docs can be found at [HexDocs](

## Usage

The pipeline below displays a sample h264 video from the net (with use of [Hackney]( and [H264]( elements):

defmodule My.Pipeline do
  alias Membrane.Element.{FFmpeg.H264, Hackney, SDL}
  alias Membrane.Pipeline.Spec
  use Membrane.Pipeline

  @impl true
  def handle_init(_) do
    children = [
      hackney: %Hackney.Source{
        location: ""
      parser: %H264.Parser{framerate: {30, 1}},
      decoder: H264.Decoder,
      sdl: SDL.Player

    links = %{
      {:hackney, :output} => {:parser, :input},
      {:parser, :output} => {:decoder, :input},
      {:decoder, :output} => {:sdl, :input}

    {{:ok, %Spec{children: children, links: links}}, %{}}

## Copyright and License

Copyright 2019, [Software Mansion](

[![Software Mansion](](

Licensed under the [Apache License, Version 2.0](LICENSE)