简体   繁体   中英

How to configure ffmpeg with libsrt (Secure Reliable Transport) protocol?

I want to configure ffmpeg with libsrt (Secure Reliable Transport) protocol on linux-Ubuntu OS, I followed the steps from this link

But when run $./configure --enable-libsrt command it gives me an error:

ERROR: srt >= 1.3.0 not found using pkg-config

I modified the configuration file, it executed the above command but when i run $ make command it end up with the following errors:

LD  ffmpeg_g
libavformat/libavformat.so: undefined reference to `srt_socket'
libavformat/libavformat.so: undefined reference to `srt_bind'
libavformat/libavformat.so: undefined reference to `srt_getsockopt'
libavformat/libavformat.so: undefined reference to `srt_close'
libavformat/libavformat.so: undefined reference to `srt_epoll_add_usock'
libavformat/libavformat.so: undefined reference to `srt_startup'
libavformat/libavformat.so: undefined reference to `srt_connect'
libavformat/libavformat.so: undefined reference to `srt_epoll_release'
libavformat/libavformat.so: undefined reference to `srt_listen'
libavformat/libavformat.so: undefined reference to `srt_getlasterror'
libavformat/libavformat.so: undefined reference to `srt_getlasterror_str'
libavformat/libavformat.so: undefined reference to `srt_cleanup'
libavformat/libavformat.so: undefined reference to `srt_setsockopt'
libavformat/libavformat.so: undefined reference to `srt_sendmsg'
libavformat/libavformat.so: undefined reference to `srt_clearlasterror'
libavformat/libavformat.so: undefined reference to `srt_epoll_wait'
libavformat/libavformat.so: undefined reference to `srt_epoll_remove_usock'
libavformat/libavformat.so: undefined reference to `srt_epoll_create'
libavformat/libavformat.so: undefined reference to `srt_recvmsg'
libavformat/libavformat.so: undefined reference to `srt_accept'
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'ffmpeg_g' failed
make: *** [ffmpeg_g] Error 1

What are exact steps to enable libsrt with ffmpeg ? Am i missing anything ? Is there any patch i have to add to existing ffmpeg source ?

Thanks in advance !!!

The answer you referred to assumes the question asker was following the Ubuntu compile guide on the FFmpeg Wiki (because they claimed to be doing so). The compile guide "installs" external libraries into ~/ffmpeg_build for a variety of reasons . The libsrt instructions in that answer does the same to fit with the wiki article. Therefore, it is expected that you will use the additional compilation options as shown in the wiki to deal with this when compiling ffmpeg .

  1. Undo whatever changes you made to configure .
  2. Follow the linked answer and compile libsrt if you haven't already.
  3. Now compile ffmpeg .

     make distclean PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --enable-libsrt --pkg-config-flags="--static"

Alternatively, if you don't want to have to use most of those extra options then omit -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" when compiling libsrt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM