Adding SRT support

aaronb

New Member
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
 

NikolausWied

New Member
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 :-)
 

dodgepong

Administrator
Forum Admin
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

New Member
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 :-)
 

dodgepong

Administrator
Forum Admin
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.
 

dodgepong

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

Vasu

New Member
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
 

Filip S

Member
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

Member
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

Member
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:
Code:
srtsrc uri="srt://192.168.86.249:7001?mode=listener" ! decodebin name=bin ! queue ! video. bin. ! queue ! audio.
 
Top