Membrane Element: H264 v0.1.1 Membrane.Element.FFmpeg.H264.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.Element.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.

Link to this section Summary

Functions

Returns pads specification for Membrane.Element.FFmpeg.H264.Encoder

Returns description of options available for this module

Link to this section Types

Link to this type

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

Link to this type

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

Struct containing options for Membrane.Element.FFmpeg.H264.Encoder

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

    Defaults to :high

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

    Defaults to :medium

  • crf - 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.

    Defaults to 23

Link to this section Functions

Returns pads specification for Membrane.Element.FFmpeg.H264.Encoder

They are the following:

  • Pad :output

    • availability: :always
    • caps: Membrane.Caps.Video.H264, params: stream_format:byte_stream, alignment:au
    • direction: :output
    • mode: :pull
  • Pad :input

    • availability: :always
    • caps: Membrane.Caps.Video.Raw, params: formatin([:I420, :I422]), alignedtrue
    • demand unit: :buffers
    • direction: :input
    • mode: :pull

Returns description of options available for this module