All Products
Search
Document Center

:Integrate the Native RTS SDK on Windows

Last Updated:Dec 02, 2025

This guide explains how to integrate the Native RTS SDK into a player (built on the FFmpeg framework) on Windows for Real-time Streaming (RTS).

Procedure

This topic uses MSYS2 to compile FFmpeg 4.2 as an example. In the MSYS2 installation directory, open the mingw64.exe terminal.

  1. Download and decompress the Windows package of the Native RTS SDK. For the download link, see Release notes.

  2. Copy the rtsdec.c and rtsenc.c files to the libavformat directory of the FFmpeg source code.

    Modify the Makefile file. Add rtsdec.o and rtsenc.o to the list of object files to be built:

    001

  3. To enable support for the Alibaba Real-Time Communication (ARTC) protocol by default, modify the allformats.c file.

    002

    extern AVInputFormat  ff_rtc_demuxer;
  4. Modify the ffplay.c file.

    ffplay.c

    /* connect rts library to rts plugin
     */
    struct rts_glue_funcs;
    extern const struct rts_glue_funcs *get_rts_funcs(int version);
    extern void av_set_rts_demuxer_funcs(const struct rts_glue_funcs *funcs);

    1.1

     || !strcmp(s->iformat->name, "artc")

    1

    av_set_rts_demuxer_funcs(get_rts_funcs(2));
  5. Modify the Makefile file in the same directory as ffplay.c.

    2

    $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1)) -lRtsSDK --verbose
    
    ifeq ($(TARGET_OS),windows)
    LDFLAGS += -L../../release/windows/x86_64/RtsSDK/lib/ -lRtsSDK
    endif
    ifeq  ($(TARGET_OS),mac)
      LDFLAGS += -L../../release/mac/x86_64/RtsSDK/lib -lRtsSDK
    endif
  6. Compile and run the code.

    ./ffplay "artc://<streaming URL>"

    Note

    For the lowest possible latency, run the following command: ./ffplay -fflags nobuffer -flags low_delay "artc://<streaming URL>".

    PREFIX_DIR=`pwd`/"build-out-windows"
    CFLAGS="$CFLAGS -DWIN32  -D_WIN32 -DNDEBUG"
    
    ./configure \
        --prefix=$PREFIX_DIR \
        --extra-cflags="$CFLAGS" \
        --enable-shared \
        --disable-static \
        --enable-gpl \
        --enable-nonfree \
        --enable-libfdk-aac \
        --disable-decoder=hevc \
        --disable-parser=hevc  \
        --disable-encoders  || exit 1
    
    make TARGET_OS=windows -j8 && make install  || exit 1
    cp /mingw64/bin/SDL2.dll ${PREFIX_DIR}/bin
    cp ../../release/windows/x86_64/RtsSDK/lib/RtsSDK.dll ${PREFIX_DIR}/bin
    echo "FFmpeg created in $PREFIX_DIR"