H.264 hardware transcoder using Vulkan Video extensions.
Accepts a single H.264 input stream and produces multiple independently
configured H.264 output streams. Each output pad is configured via pad options
passed through via_out/2.
Pad linking requirement
All output pads must be linked in the same spec in which the transcoder element itself is created. Linking pads in a later spec is not supported.
Example
spec = [
child(:source, source)
|> child(:parser, %Membrane.H264.Parser{...})
|> child(:transcoder, Membrane.VKVideo.Transcoder),
get_child(:transcoder)
|> via_out(Pad.ref(:output, 0), options: [width: 1280, height: 720])
|> child(:sink_hd, sink_hd),
get_child(:transcoder)
|> via_out(Pad.ref(:output, 1), options: [width: 640, height: 360])
|> child(:sink_sd, sink_sd)
]Element options
Passed via struct Membrane.VKVideo.Transcoder.t/0
approx_framerate{non_neg_integer(), pos_integer()} | nilDefault value:
nil
Framerate of the input stream expressed as{numerator, denominator}. It's only used by the rate control mechanism and therefore does not need to be an exact value. If nil, the framerate will be read from the stream format's structure or set to a fixed value of 30 frames per second if framerate is not provided by the stream format.
Pads
:input
Accepted formats:
%Membrane.H264{stream_structure: :annexb, alignment: :au}| Direction: | :input |
| Availability: | :always |
| Flow control: | :auto |
:output
Accepted formats:
%Membrane.H264{stream_structure: :annexb, alignment: :au}| Direction: | :output |
| Availability: | :on_request |
| Flow control: | :auto |
Pad options:
widthnon_neg_integer()Required
Output frame width in pixels.heightnon_neg_integer()Required
Output frame height in pixels.tune:low_latency | :high_qualityDefault value:
:low_latency
Specifies whether the encoder should be optimized for minimal latency (which is important in case of livestreams) or for higher quality (applicable to offline encoding).rate_control:encoder_default | :disabled | {:variable_bitrate, Membrane.VKVideo.Encoder.VariableBitrate.t()} | {:constant_bitrate, Membrane.VKVideo.Encoder.ConstantBitrate.t()}Default value:
:encoder_default
Rate control mode for the output stream. SeeMembrane.VKVideo.Encoderfor available options.scaling_algorithm:nearest_neighbor | :lanczos3 | :bilinearDefault value:
:bilinear
Algorithm used when scaling the input to the output resolution.
Summary
Types
@type output_pad_opts() :: [ width: non_neg_integer(), height: non_neg_integer(), tune: :low_latency | :high_quality, rate_control: :encoder_default | :disabled | {:variable_bitrate, Membrane.VKVideo.Encoder.VariableBitrate.t()} | {:constant_bitrate, Membrane.VKVideo.Encoder.ConstantBitrate.t()}, scaling_algorithm: :nearest_neighbor | :lanczos3 | :bilinear ]
Options for pad :output
@type t() :: %Membrane.VKVideo.Transcoder{ approx_framerate: {non_neg_integer(), pos_integer()} | nil }
Struct containing options for Membrane.VKVideo.Transcoder
Functions
@spec options() :: keyword()
Returns description of options available for this module