View Source Membrane.VP9.Encoder (Membrane VPx plugin v0.4.0)
Element that encodes a VP9 stream.
This element can receive a Membrane.KeyframeRequestEvent
on it's :output
pad to force the
next frame to be a keyframe.
Buffers produced by this element will have the following metadata that inform whether the buffer contains a keyframe:
%{vp9: %{is_keyframe: is_keyframe :: boolean()}}
Element options
Passed via struct Membrane.VP9.Encoder.t/0
encoding_deadline
Membrane.Time.t() | :auto
Default value:
:auto
Determines how long should it take the encoder to encode a frame. The longer the encoding takes the better the quality will be. If set to 0 the encoder will take as long as it needs to produce the best frame possible. Note that this is a soft limit, there is no guarantee that the encoding process will never exceed it. If set to:auto
the deadline will be calculated based on the framerate provided by incoming stream format. If the framerate isnil
a fixed deadline of 10ms will be set.rc_target_bitrate
pos_integer() | :auto
Default value:
:auto
Gives the encoder information about the target bitrate (in kb/s). If set to:auto
the target bitrate will be calculated automatically based on the resolution and framerate of the incoming stream. Some reference recommended bitrates can be also found hereg_lag_in_frames
non_neg_integer()
Default value:
5
The number of input frames the encoder is allowed to consume before producing output frames. This allows the encoder to base decisions for the current frame on future frames. This does increase the latency of the encoding pipeline, so it is not appropriate in all situations (ex: realtime encoding).Note that this is a maximum value -- the encoder may produce frames sooner than the given limit. If set to 0 this feature will be disabled.
cpu_used
non_neg_integer() | nil
Default value:
nil
A parameter used to balance between compression and performance.Setting a lower value increases the encoding time but improves the quality and compression efficiency of the output video. Setting a higher value speeds up the encoding at the cost of lower quality and large file sizes. The parameter needs to either be nil or be in range 0-15. If it's nil, the default libvpx value is applied.
g_threads
pos_integer() | nil
Default value:
nil
Specifies how many OS threads can be used by the encoder. If it's nil, the default libvpx value is applied.
Pads
:input
Accepted formats:
Membrane.RawVideo
Direction: | :input |
Availability: | :always |
Flow control: | :auto |
:output
Accepted formats:
VP9
Direction: | :output |
Availability: | :always |
Flow control: | :auto |
Summary
Types
Struct containing options for Membrane.VP9.Encoder
Types
@type t() :: %Membrane.VP9.Encoder{ cpu_used: non_neg_integer() | nil, encoding_deadline: Membrane.Time.t() | :auto, g_lag_in_frames: non_neg_integer(), g_threads: pos_integer() | nil, rc_target_bitrate: pos_integer() | :auto }
Struct containing options for Membrane.VP9.Encoder
Functions
@spec options() :: keyword()
Returns description of options available for this module