View Source Membrane.FLV.Demuxer (Membrane FLV Plugin v0.12.0)

Element for demuxing FLV streams into audio and video streams. FLV format supports only one video and audio stream. They are optional however, FLV without either audio or video is also possible.

When a new FLV stream is detected and an output pad for it has not been linked yet, the element will notify its parent with new_stream_notification_t/0 and start buffering the packets for the stream until the requested output pad is linked. Please note that if the parent ignores the notification, the element will eventually raise an error as it can't buffer the incoming packets indefinitely.

If you want to pre-link the pipeline instead of linking dynamically on new stream notifications, you can use the following output pads:

  • Pad.ref(:audio, 0) for audio stream
  • Pad.ref(:video, 0) for video stream The 0 in the pad reference is the stream ID and according to the FLV specification, it must always be 0.

Note

The demuxer implements the Enhanced RTMP specification in terms of parsing. It does NOT support processing of the protocols other than H264 and AAC.

Pads

:input

Accepted formats:

%RemoteStream{content_format: content_format, type: :bytestream} when content_format in [nil, FLV]
Direction::input
Availability::always
Flow control::auto

:video

Accepted formats:

%H264{stream_structure: {:avc3, _dcr}}
Direction::output
Availability::on_request
Flow control::auto

:audio

Accepted formats:

RemoteStream
%AAC{encapsulation: :none, config: {:audio_specific_config, _config}}
Direction::output
Availability::on_request
Flow control::auto

Summary

Types

List of formats supported by the demuxer.

Type of notification that is sent when a new FLV stream is detected.

Notification that is sent when the demuxer encounters a video codec that is not supported by the element.

Types

@type codec_t() :: Membrane.FLV.audio_codec_t() | :H264

List of formats supported by the demuxer.

For video, only H264 is supported. Other video codecs will result in unsupported_codec_notification_t/0 and dropping all the following packets on all pads, expecting the parent to shut down. Audio codecs other than AAC might not work correctly, although they won't throw any errors.

Link to this type

new_stream_notification_t()

View Source
@type new_stream_notification_t() :: {:new_stream, Membrane.Pad.ref(), codec_t()}

Type of notification that is sent when a new FLV stream is detected.

Link to this type

unsupported_codec_notification_t()

View Source
@type unsupported_codec_notification_t() ::
  {:unsupported_codec, Membrane.FLV.video_codec_t() | :AV1 | :HEVC | :VP9}

Notification that is sent when the demuxer encounters a video codec that is not supported by the element.