# eflvmux

`eflvmux` is an extension to the `flvmux`, capable of multiplexing multiple tracks and signalling advanced codecs in FOURCC format as per Enhanced RTMP (V2) specification.

Note: The `audio` pad can only send the data in legacy FLV format and the `audio_%u` can only send it in the Enhanced FLV format. So it is important to specify the corresponding pad template while linking pads using `gst_element_link_pads` or `_parse_launch`. Failing to specify the pad template can result in sending the data in the wrong FLV format.

## Example launch line streaming 2 audio tracks to Twitch

    gst-launch-1.0 videotestsrc pattern=ball ! 'video/x-raw,format=I420,width=1280,height=720,framerate=30/1' ! \
       timeoverlay ! videoconvert ! x264enc tune=zerolatency key-int-max=30 ! h264parse ! eflvmux name=mux ! \
       rtmp2sink location="rtmp://ingest.global-contribute.live-video.net/app/$STREAM_KEY" \
       audiotestsrc wave=ticks ! fdkaacenc ! mux.audio \
       audiotestsrc !  fdkaacenc ! mux.audio_1

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstAggregator
                        ╰──GstFlvMux
                            ╰──eflvmux

## Implemented interfaces

    GstTagSetter

## Factory details

Authors: – Taruntej Kanakamalla

Classification: – `Codec/Muxer`

Rank – primary

Plugin – flv

Package – GStreamer Good Plug-ins

## Pad Templates

### `audio`

    audio/x-adpcm:
             layout: swf
           channels: { (int)1, (int)2 }
               rate: { (int)5512, (int)11025, (int)22050, (int)44100 }
    audio/mpeg:
        mpegversion: 1
              layer: 3
           channels: { (int)1, (int)2 }
               rate: { (int)5512, (int)8000, (int)11025, (int)22050, (int)44100 }
             parsed: true
    audio/mpeg:
        mpegversion: { (int)4, (int)2 }
      stream-format: raw
    audio/x-nellymoser:
           channels: { (int)1, (int)2 }
               rate: { (int)5512, (int)8000, (int)11025, (int)16000, (int)22050, (int)44100 }
    audio/x-raw:
             format: { U8, S16LE }
             layout: interleaved
           channels: { (int)1, (int)2 }
               rate: { (int)5512, (int)11025, (int)22050, (int)44100 }
    audio/x-alaw:
           channels: { (int)1, (int)2 }
               rate: 8000
    audio/x-mulaw:
           channels: { (int)1, (int)2 }
               rate: 8000
    audio/x-speex:
           channels: 1
               rate: 16000

Presence – request

Direction – sink

Object type – GstFlvMuxPad

### `audio_%u`

    audio/mpeg:
        mpegversion: 1
              layer: 3
           channels: { (int)1, (int)2 }
               rate: { (int)5512, (int)8000, (int)11025, (int)22050, (int)44100 }
             parsed: true
    audio/mpeg:
        mpegversion: { (int)4, (int)2 }
      stream-format: raw

Presence – request

Direction – sink

Object type – GstFlvMuxPad

### `src`

    video/x-flv:

Presence – always

Direction – src

Object type – GstAggregatorPad

### `video`

    video/x-flash-video:
    video/x-flash-screen:
    video/x-vp6-flash:
    video/x-vp6-alpha:
    video/x-h264:
      stream-format: avc

Presence – request

Direction – sink

Object type – GstFlvMuxPad

### `video_%u`

    video/x-h264:
      stream-format: avc
    video/x-h265:
      stream-format: hvc1

Presence – request

Direction – sink

Object type – GstFlvMuxPad

The results of the search are