We're hiring!
*

SRT, typical examples

Justin Kim avatar

Justin Kim
February 20, 2018

Share this post:

Reading time:

Following last week's blog post announcing SRT in GStreamer, I'd like to briefly discuss another way to use an SRT stream: with VLC 3.0!

Released earlier this month, the latest version of the free & open source multimedia player (which also uses the GStreamer framework) now contains SRT modules which had been in development in VLC's master branch. Let's take a look at what VLC says.

$ vlc --list | grep srt
VLC media player 3.0.0 Vetinari (revision 3.0.0-3-g7821ebf808)
  access_output_srt      SRT stream output
  access_srt             SRT input

These modules can be seen in VLC’s preferences menu if “Show All” is checked in the preferences window.

SRT in VLC's preference menu

As we can infer from the name, VLC has input/output SRT modules. The basic usage isn’t different from the case when using UDP or TCP-based stream. From Olivier's article, we got a typical example to stream via SRT, then let's create SRT stream.

gst-launch-1.0 v4l2src ! video/x-raw, height=1080, width=1920 \
    ! videoconvert ! x264enc tune=zerolatency ! video/x-h264, profile=high \
    ! mpegtsmux ! srtserversink uri=srt://:8888/

Then, now, VLC can play the SRT stream with the URL, "srt://ip_address:8888/".

SRT in VLC screenshot

Limitations

Yes, The current SRT modules in VLC is able to work as an SRT player and an SRT stream generator. However, there are some limitations because VLC released version took a part of SRT module patch set.

Stream Encryption

To encrypt and decrypt SRT stream, a passphrase is required. The passphrase property patches have already been merged into VLC master, but not yet released. We are looking forward that next version of VLC has this feature.

Connection modes

We have created 4 different elements for GStreamer, but the current VLC modules only support client mode. That means the current version of VLC can play only if an SRT stream generator runs in listener(server) mode. Supporting all modes in SRT modules of VLC would be next challenge for us.

Conclusion

Hopefully, SRT modules in VLC, also GStreamer SRT plugins will have helped you to build SRT applications. Let's discuss the details of SRT with VLC and GStreamer!

Update (Jan 2019):

In GStreamer 1.16, we've decided to merge the clientsrc and serversrc srt elements into a single source element, and the same for the server. So the example pipeline in 1.16 is:

  gst-launch-1.0 v4l2src ! video/x-raw, height=1080, width=1920 \
    ! videoconvert ! x264enc tune=zerolatency ! video/x-h264,
profile=high \
    ! mpegtsmux ! srtserversink uri=srt://:8888/

Visit Justin's blog.

Comments (24)

  1. svy:
    Mar 27, 2018 at 02:26 PM

    Hey, has SRT access module been removed? Its not showing in the Windows version of v3.0

    Reply to this comment

    Reply to this comment

    1. Olivier Crête:
      Mar 27, 2018 at 06:39 PM

      I don't think it's in the Windows build yet, we're actively working on finalizing the Windows integration. There is a problem with the poll/select integration and Windows.

      Reply to this comment

      Reply to this comment

        1. Hi-Angel:
          Mar 31, 2018 at 12:31 PM

          I'm pretty sure poll() is implemented on Windows with WSL. I imagine you gotta find the dll that provides the function, and use it.

          You can list dll exports on Windows with "rabin2 -s some.dll" (from Radare — a FOSS reverse-engineering framework).

          Reply to this comment

          Reply to this comment

        2. Justin Kim:
          Apr 02, 2018 at 12:11 AM

          SRT for windows has been merged into upstream.
          The modules are ready to run in VLC 4.0.0 nightly build. :)

          Reply to this comment

          Reply to this comment

  2. Tony:
    May 12, 2018 at 05:43 AM

    Do you know if SRT will be merged into the ios and Android versions?

    Reply to this comment

    Reply to this comment

    1. Olivier Crête:
      May 14, 2018 at 03:17 PM

      Android definitely, I tried just enabling it and it works, so someone just needs to submit the patch.

      Reply to this comment

      Reply to this comment

      1. rajesh:
        May 22, 2018 at 12:56 PM

        I have found SRT Pipeline examples for Linux platform and they are working.

        I would like to try out on Android, May i know is there any srtserversink, srtclientsrc examples pipeline for android platform ?

        Reply to this comment

        Reply to this comment

        1. Olivier Crête:
          May 22, 2018 at 04:55 PM

          With GStreamer, the pipeline should be the same on all platforms, except for the audio and video video sinks and sources which are specific to a platform.

          Reply to this comment

          Reply to this comment

          1. rajesh:
            May 23, 2018 at 01:38 PM

            i have tried srtserversink with udpsrc and its working as like below.

            #terminal.1
            gst-launch-1.0 -v udpsrc port=9001 ! rndbuffersize max=1316 min=1316 ! srtserversink

            #terminal.2
            gst-launch-1.0 -v srtclientsrc uri="srt://127.0.0.1:7001" ! udpsink host=127.0.0.1 port= 7010

            #terminal.3
            ffmpeg -re -i output.ts -c:v copy -c:a copy -f mpegts udp://127.0.0.1:9001

            #terminal.4
            ffplay udp://127.0.0.1:7010


            But when i tried with filesrc or videotestsrc, its not working as follows.

            how to create pipeline srtserversink with filesrc or videotestsrc?

            is srt supports filesrc instead of udp ?
            if yes, could you give me working pipeline with filesrc?

            Reply to this comment

            Reply to this comment

  3. Samantha:
    Sep 17, 2018 at 02:38 PM

    I have not much knowledge when it comes to it but this is a detailed passage. I'm gonna keep this in mind. SRT really caught my attention so I will manage to study more of it. Thanks for this!

    Reply to this comment

    Reply to this comment

    1. Olivier Crête:
      Sep 18, 2018 at 07:11 AM

      Thank you for the feedback! Please don't hesitate to reach out if you have any questions regarding SRT!

      Reply to this comment

      Reply to this comment

  4. Itsme:
    Feb 18, 2019 at 03:05 AM

    "Supporting all modes in SRT modules of VLC would be next challenge for us."
    Is this done now? For every operating system?

    Or another question, is there like any srt client out for Android? Im thinking about using srt to stream some content but I don't know if clients are aviable. Maybe a oppensource demo apk which I could than extend for my requirements. Or vlc for Android also sounds good if that works.

    Reply to this comment

    Reply to this comment

  5. Gary Carter:
    Jan 14, 2020 at 06:22 PM

    Justin ... way back in 2018, you wrote that VLC only supported Listener mode ...
    It is now 2020, I am trying to get rendezvous mode running.
    Has there been an update to VLC 3.0.8 to your knowledge?
    I tried ...?mode=rendezvous without success.

    Reply to this comment

    Reply to this comment

    1. Olivier Crête:
      Jan 14, 2020 at 06:47 PM

      As far as I know, the VLC integration has not been improved since.

      Reply to this comment

      Reply to this comment

      1. Gary Carter:
        Jan 14, 2020 at 07:16 PM

        Hmm ... then maybe it is better for me to run the srt libraries separately from VLC ... and then just run rtp://... in VLC
        Have you looked at the VLC V4 nightly to see what is there w.r.t. srt modes like rendezvous?

        Reply to this comment

        Reply to this comment

        1. Olivier Crête:
          Jan 14, 2020 at 07:43 PM

          I just checked their git master tree. Using the srt-live-transmit separately is probably safer bet if you want to use VLC.

          Reply to this comment

          Reply to this comment

          1. Gary Carter:
            Jan 14, 2020 at 08:38 PM

            I am not married to VLC for Windows ... I hoped that VLC for Windows would be a convenient test tool.
            I am however married to rendezvous mode as it allows me to deal with the firewall issues that I encounter as I deliver live stream services thru the internet.
            So now I am going to try LINUX, well actually did already and found no support for srt in Raspbian ... I looked at the standard Ubuntu build of VLC 3.0.8 for Ubuntu and saw no references to SRT under the input access modules nor access output suggesting that I need to compile my own from somewhere ... have you ever seen a version of VLC with support for rendezvous mode? if so where?
            thanks for your insight.

            Reply to this comment

            Reply to this comment

            1. Olivier Crête:
              Jan 14, 2020 at 09:38 PM

              There is no such thing as a version of VLC with SRT rendez-vous.. But if you're on Linux with a recent distribution (that has GStreamer 1.16), you can use Totem (aka GNOME Videos) and this should be able to play SRT streams in rendez-vous mode... Assuming you have the GStreamer SRT plugin.

              Reply to this comment

              Reply to this comment

              1. Gary Carter:
                Jan 14, 2020 at 09:56 PM

                Interesting idea to use Gnome ... I will try it
                Separately, I have tried GStreamer successfully with rendezvous mode
                Personally, I am a long time supporter of VLC and thus disappointed that VLC has such limited functionality.

                Reply to this comment

                Reply to this comment

  6. Fahad Shahzad:
    Feb 22, 2022 at 09:55 PM

    Hi,

    I am generating mpegts over udpsink and then srt-live transmit for srt output getting high video jitters including proirity 1 and 2 errors on stream analyzer.
    Is there any way to get rid of these errors.

    gst-launch-1.0 decklinkvideosrc device-number=0 mode=3 ! queue ! video/x-raw ! videoconvert ! x264enc tune=zerolatency ! video/x-h264, profile=high ! mpegtsmux name=mux ! queue ! udpsink host=192.168.1.223 port=8888 autoaudiosrc ! avenc_aac ! aacparse ! mux.


    Thanks

    Fahad

    Reply to this comment

    Reply to this comment

    1. Olivier Crête:
      Feb 23, 2022 at 11:54 PM

      First, you probably want to add "alignment=7" as a parameter to the mpegtsmux, as I the default will send one UDP packet per 188 bytes mpeg-ts packet. In theory, this should give you the right timing. You may also want to use the GStreamer srtsink directly to forward the timing better instead of adding the udpsink+srt-live-transmit step that could add more jitter.

      Reply to this comment

      Reply to this comment

  7. Moni:
    Apr 04, 2022 at 11:36 AM

    Remove the following errors.

    gst-launch-1.0 decklinkvideosrc device-number=0 mode=3 ! queue ! video/x-raw ! videoconvert ! x264enc tune=zerolatency ! video/x-h264, profile=high ! mpegtsmux name=mux ! queue ! udpsink host=192.168.1.223 port=8888 autoaudiosrc ! avenc_aac ! aacparse ! mux.

    Reply to this comment

    Reply to this comment


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

Mesa CI and the power of pre-merge testing

08/10/2024

Having multiple developers work on pre-merge testing distributes the process and ensures that every contribution is rigorously tested before…

A shifty tale about unit testing with Maxwell, NVK's backend compiler

15/08/2024

After rigorous debugging, a new unit testing framework was added to the backend compiler for NVK. This is a walkthrough of the steps taken…

A journey towards reliable testing in the Linux Kernel

01/08/2024

We're reflecting on the steps taken as we continually seek to improve Linux kernel integration. This will include more detail about the…

Building a Board Farm for Embedded World

27/06/2024

With each board running a mainline-first Linux software stack and tested in a CI loop with the LAVA test framework, the Farm showcased Collabora's…

Smart audio filters with WirePlumber 0.5

26/06/2024

WirePlumber 0.5 arrived recently with many new and essential features including the Smart Filter Policy, enabling audio filters to automatically…

The latest on cmtp-responder, a permissively-licensed MTP responder implementation

12/06/2024

Part 3 of the cmtp-responder series with a focus on USB gadgets explores several new elements including a unified build environment with…

Open Since 2005 logo

Our website only uses a strictly necessary session cookie provided by our CMS system. To find out more please follow this link.

Collabora Limited © 2005-2024. All rights reserved. Privacy Notice. Sitemap.