# Adding SRT support



## aaronb (Feb 14, 2019)

Hello There!
I am working on adding SRT support to OBS. Using a libsrt-enabled version of FFmpeg, I can add an srt source, and it will play in OBS.
Now I am looking at creating an outgoing stream. Any recommendations or guidance on the best way of doing this? 
Thanks!
Aaron


----------



## aaronb (Feb 14, 2019)

Actually, I see I can add a custom format in the recording mode. No need to change anything.


----------



## hundlos (Feb 19, 2019)

can u Post more details in it ? really interested in srt as we own bunch of haivisions


----------



## NikolausWied (Feb 28, 2019)

I am although very interested in using SRT in OBS would be very straight forward to have low latency streams between locations in HQ
Would be a great benefit for bidirectional communicational Video setups :-)


----------



## zubac (Apr 25, 2019)

Any updates on SRT with OBS?


----------



## dodgepong (Apr 25, 2019)

There is a pull request open for it, and we are working with the author as well as Haivision to fix some of the issues before we can merge it.


----------



## Joshua222 (May 23, 2019)

I am although very interested in using SRT in OBS would be very straight forward to have low latency streams between locations in HQ
Would be a great benefit for bidirectional communicational Video setups :-)


----------



## joshua.king87 (May 28, 2019)

Bumping this thread. Is SRT fully supported/merged into latest versions of OBS?


----------



## dodgepong (May 29, 2019)

We're still waiting to hear back from Haivision about the issues that need to be fixed in libsrt. Specifically, libsrt needs to support mbedTLS, which the the transport layer security library that we use.


----------



## MarcCymontkowski (Sep 5, 2019)

SRT with mbedtls support was released end of July: https://github.com/Haivision/srt/releases/tag/v1.3.3


----------



## icecore44 (Oct 8, 2019)

Is there any update on this? How is the progress?


----------



## dodgepong (Oct 8, 2019)

Now that we're back from TwitchCon, we should have a chance to review the PR hopefully within the next few weeks.


----------



## Vasu (Nov 10, 2019)

aaronb said:


> Hello There!
> I am working on adding SRT support to OBS. Using a libsrt-enabled version of FFmpeg, I can add an srt source, and it will play in OBS.
> Now I am looking at creating an outgoing stream. Any recommendations or guidance on the best way of doing this?
> Thanks!
> Aaron


Hi,  Could you share the configuration steps on OBS for ingesting srt stream ?  Thanks -vasu


----------



## icecore44 (Dec 5, 2019)

dodgepong said:


> Now that we're back from TwitchCon, we should have a chance to review the PR hopefully within the next few weeks.


Hi, may I ask what is the current progress? thanks!


----------



## Filip S (Dec 14, 2019)

aaronb said:


> Actually, I see I can add a custom format in the recording mode. No need to change anything.



I would like to know how you did it if you can show an example - I believe you add it for outgoing SRT from OBS.
Also I am interested to on how to get a SRT stream from my video cams via SRT - currently I can do udp unicast form or rtmp.

I have succeed to compile the SRT (SRT Library version: 1.4.1)  with srt-ffplay   srt-file-transmit  srt-live-transmit  srt-tunnel on my RaspberryP4 with Raspian I am still trying to compile ffmpeg to also include the SRT protocol but maybe its not needed - I am not sure about it as I am new to this and just trying to improve my current setup with SRT.

Best Regards


----------



## Filip S (Dec 20, 2019)

This script can work with rtmp but SRT to my OBS or restream device would be more nice ;)

#! /bin/bash
# Undegroundnews.dk RaspberryPI4 

printf "\n### Live Stream\n"

#OBS_DEST="-f flv rtmp://stream.undergroundnews.dk/appname/key"

# The udp://127.0.0.1:4002 is really a SRT Ready Destination ;)
# echo "To be or not to be SRT Ready...."
# srt-live-transmit -v udp://127.0.0.1:4002:pkt_size=1316&bitrate=5500000 srt://{public ip}:9001"
# Remember to do a port forward in your firewall to your OBS/VLC/VMIX
# On the OBS computer run
# srt-live-transmit srt://:9001 udp://127.0.0.1:4002

OBS_DEST="-f mpegts udp://127.0.0.1:4002?pkt_size=1316&bitrate=5500000"

##########################################################################
# SSL Stunnel destination to facebook via 127.0.0.1 note port 127.0.0.1:19350 is used in stunnel
#OBS_DEST="-f flv rtmp://127.0.0.1:19350/rtmp/{yourkey}"

#####################


#Videocodec="h264"
Videocodec="h264_omx"
#Videocodec="libx265"
#Videocodec="libx264"
#Videocodec="mpeg2video"

VideoDev="/dev/video0"
AudioDev="hw:1,0"

# -pix_fmts
#Pixelformat="yuv420p"
#Pixelformat="yuv422p"

#printf "\n### Resets usb device first\n"

# Camlink problem test 
# sudo usbreset 0fd9:0061
# camlink 4K
# sudo usbreset 0fd9:0066
# echo "Waiting 30 secs"
# sleep 30


printf "\n### Ready to start Transmission using $Videocodec codec\n"

ffmpeg -hide_banner -f alsa -ac 2 -i $AudioDev -re -f v4l2 -i $VideoDev -c copy -vcodec $Videocodec\
 -acodec aac -b:a 128k -ar 44100\
 -qmin 2 -qmax 51 -b:v 4M -maxrate:v 100M -g 50 -keyint_min 25\
 -crf 18\
 -tune zerolatency \
 -preset veryfast \
-flags +global_header\
 $OBS_DEST

printf "\n### End of the streaming transmission\n"


----------



## ethaniel (Jul 20, 2021)

If srt doesn't work on your linux obs installation, the simple solution is to add the gstreamer module to obs and then create a gstreamer source with the following config:

```
srtsrc uri="srt://192.168.86.249:7001?mode=listener" ! decodebin name=bin ! queue ! video. bin. ! queue ! audio.
```


----------

