VCDP / FFmpeg-patch

This repository contains a collection of FFmpeg* patches and samples to enable CNN model based video analytics capabilities (such as object detection, classification, recognition) in FFmpeg* framework.
Other
65 stars 23 forks source link

Add srt protocol to docker #8

Open ndujar opened 4 years ago

ndujar commented 4 years ago

I would suggest to add SRT protocol to the docker image:

## libsrt https://github.com/Haivision/srt ARG LIBSRT_VERSION=1.4.1 ENV DEBIAN_FRONTEND noninteractive RUN apt-get install libssl-dev tclsh -y RUN DIR=/tmp/srt && \ mkdir -p ${DIR} && \ cd ${DIR} && \ wget https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX=/usr/local && \ make && \ make install DESTDIR="/home/build" && \ make install && \ rm -rf ${DIR}

Then compile ffmpeg with this ability:

RUN cd /home/FFmpeg && \ find ${FFMPEG_MA_PATH}/patches -type f -name '*.patch' -print0 | sort -z | xargs -t -0 -n 1 patch -p1 -i && \ cp /root/patch/opencv.pc /usr/lib/pkgconfig/ && \ cp /root/patch/cvdef.h /usr/local/include/opencv4/opencv2/core/cvdef.h && \ ./configure --prefix="/usr" --extra-cflags="-I$IE_PATH/include" --extra-ldflags="-L$IE_PATH/lib/intel64" --libdir=/usr/lib/x86_64-linux-gnu --extra-libs="-lpthread -lm" --enable-shared --enable-gpl --enable-libass --enable-libfreetype --enable-openssl --enable-nonfree --enable-libdrm --enable-libmfx --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libjson_c --enable-libsrt --enable-libinference_engine_c_api --enable-libopencv --enable-python3 && \ make -j8 && \ make install DESTDIR="/home/build" && \ cp -rf python /home/build/python

Thanks! :)

linxie47 commented 4 years ago

Hi @ndujar, could you give a reason for this change? Thanks!

ndujar commented 4 years ago

Hi @linxie47: It would be just a matter of completion. Currently, the docker image supports a good amount of transport protocols: Supported file protocols: Input: async cache concat crypto data ffrtmpcrypt ffrtmphttp file ftp gopher hls http httpproxy https mmsh mmst pipe rtmp rtmpe rtmps rtmpt rtmpte rtmpts rtp srtp subfile tcp tls udp udplite unix Output: crypto ffrtmpcrypt ffrtmphttp file ftp gopher http httpproxy https icecast md5 pipe prompeg rtmp rtmpe rtmps rtmpt rtmpte rtmpts rtp srtp tee tcp tls udp udplite unix

However, I found out thath SRT is missing, and it is gaining traction as a good alternative to other "classic" protocols that are slowly becoming outdated.

Secure Reliable Transport (SRT) is an open source video transport protocol that optimizes streaming performance across unpredictable networks, such as the Internet, by dynamically adapting to the real-time network conditions between transport endpoints. This helps minimize effects of jitter and bandwidth changes, while error-correction mechanisms help minimize packet loss. SRT supports end-to-end encryption with AES.[1] When performing retransmissions, SRT only attempts to retransmit packets for a limited amount of time based on the latency as configured by the application. This is especially useful for organizations where the LAN is congested and packet loss is common. For example, streaming from a crowded convention (everyone is fighting over the same LAN) to a production studio is bound to decrease the quality of the video transmission. Utilizing SRT as the transport protocol (as opposed to MPEG-TS, RTP or RTSP) helps to minimize these issues and delivers the video feed to the decoder destination optimally.

It is very useful to be able to stream directly from a VCDP's docker image with low latency.

Thanks :)

linxie47 commented 4 years ago

Thanks for the reply. If you'd like to add this function, please submit one Pull Request.