Membrane H264 FFmpeg plugin v0.8.0 Membrane.H264.FFmpeg.Encoder View Source

Membrane element that encodes raw video frames to H264 format.

The element expects each frame to be received in a separate buffer, so the parser (Membrane.Element.RawVideo.Parser) may be required in a pipeline before the encoder (e.g. when input is read from Membrane.File.Source).

Additionaly, the encoder has to receive proper caps with picture format and dimensions before any encoding takes place.

Please check t/0 for available options.

Element options

Passed via struct Membrane.H264.FFmpeg.Encoder.t/0

  • crf

    any

    Default value: 23

    Constant rate factor that affects the quality of output stream. Value of 0 is lossless compression while 51 (for 8-bit samples) or 63 (10-bit) offers the worst quality. The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.

  • preset

    presets()

    Default value: :medium

    Collection of predefined options providing certain encoding. The slower the preset choosen, the higher compression for the same quality can be achieved.

  • profile

    H264.profile_t()

    Default value: :high

    Defines the features that will have to be supported by decoder to decode video encoded with this element.

Pads

:input

Availability:always
CapsMembrane.Caps.Video.Raw, restrictions:<br />&nbsp;&nbsp;format: one_of([:I420, :I422]),<br />&nbsp;&nbsp;aligned: true
Demand unit:buffers
Direction:input
Mode:pull
Name:input

:output

Availability:always
CapsMembrane.Caps.Video.H264, restrictions:<br />&nbsp;&nbsp;stream_format: :byte_stream,<br />&nbsp;&nbsp;alignment: :au
Direction:output
Mode:pull
Name:output

Link to this section Summary

Types

t()

Struct containing options for Membrane.H264.FFmpeg.Encoder

Functions

Returns pads descriptions for Membrane.H264.FFmpeg.Encoder

Returns description of options available for this module

Link to this section Types

Specs

presets() ::
  :placebo
  | :veryslow
  | :slower
  | :slow
  | :medium
  | :fast
  | :faster
  | :veryfast
  | :superfast
  | :ultrafast

Specs

t() :: %Membrane.H264.FFmpeg.Encoder{
  crf: any(),
  preset: presets(),
  profile: Membrane.Caps.Video.H264.profile_t()
}

Struct containing options for Membrane.H264.FFmpeg.Encoder

Link to this section Functions

Specs

membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]

Returns pads descriptions for Membrane.H264.FFmpeg.Encoder

Specs

options() :: keyword()

Returns description of options available for this module