Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add LibSRT #45

Copy link
Copy link
Closed
Closed
Copy link
@rtgoodwin

Description

@rtgoodwin
Issue body actions

Hi hi!

Still a huge fan of this script, still feels like magic :)

Was wondering if it was possible to add LibSRT officially, as it is getting more and more popular (especially for "quick, dependency-free" deploys as relay servers).

I have a patch that will compile, but it's not ideal for 2 reasons:

  1. Currently have to checkout an older git hash because of an incompatibility with released FFMPEG and deprecated calls. This can be worked around with an older commit hash, an older SRT version, or just wait for new FFMPEG (or HEAD). No biggies here. (see "patch" below). I have it as git but could of course wget the commit archive.
  2. More importantly, the SRT package doesn't seem to compile fully statically in the context of this build script. Technically what fails are the included apps, which AFAICT aren't needed at all for libsrt features, but makes me nervous. I spoke at length with the devs in [BUG] Linux: static linking apps fails Haivision/srt#1172 and the project seems to have no problem compiling statically, but I couldn't figure out what about this build script makes it such that it won't compile statically in the context of the script. Given that it is kind of the only other thing that compiles after openssl (besides FFMPEG), I wonder if there's some tweak to the openssl build needed. I tried everything I could think of. Maybe something super simple that will make sense to you all :) Issue seen on Ubuntu (presumably Deb) and Docker; seemed to work on Darwin but haven't quite pinned that down, and the remote VM use case is the point anyway.

Love to work with you on making this work!

Hacky Patch:

if build "srt"; then
        cd "$PACKAGES"
        git clone https://github.com/Haivision/srt.git
        cd srt
        git checkout 10ed37b6d4b49a3042213b029f0de6bca4bcfe83
        #sed -i -e 's/${name} ${srt_link_library})/${name} ${srt_link_library} ${WITH_EXTRALIBS})/' CMakeLists.txt
        cmake -DCMAKE_INSTALL_PREFIX:PATH="${WORKSPACE}" -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DENABLE_APPS=ON -DWITH_EXTRALIBS="-lz -ldl" .
       # if you just set -DENABLE_APPS=OFF these patches aren't needed since it's the included apps that will fail to compile against static ffmpeg
        sed -i -e 's/libsrt.a -ldl -lssl -lcrypto -lpthread/libsrt.a -lssl -lcrypto -lz -ldl -lpthread/' CMakeFiles/srt-live-transmit.dir/link.txt
        sed -i -e 's/libsrt.a -ldl -lssl -lcrypto -lpthread/libsrt.a -lssl -lcrypto -lz -ldl -lpthread/' CMakeFiles/srt-tunnel.dir/link.txt
        sed -i -e 's/libsrt.a -ldl -lssl -lcrypto -lpthread/libsrt.a -lssl -lcrypto -lz -ldl -lpthread/' CMakeFiles/srt-file-transmit.dir/link.txt
        execute make -j $MJOBS
        execute make install
        build_done "srt"
fi

.... 
--enable-libsrt
d-averkiev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.