Created
March 10, 2020 06:28
-
-
Save Novex/e79b8a7306e251c991a001ab63598507 to your computer and use it in GitHub Desktop.
h265 over srt -> h264 rtmp push
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
MAINTAINER Eyevinn Technology <[email protected]> | |
RUN sed -i 's/archive.ubuntu/jp.archive.ubuntu/g' /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y --force-yes autoconf | |
RUN apt-get install -y --force-yes automake | |
RUN apt-get install -y --force-yes build-essential | |
RUN apt-get install -y --force-yes pkg-config | |
RUN apt-get install -y --force-yes libtool | |
RUN apt-get install -y --force-yes wget | |
RUN apt-get install -y --force-yes yasm | |
RUN apt-get install -y --force-yes libx264-dev | |
RUN mkdir /root/source | |
RUN mkdir /root/source/ffmpeg | |
RUN cd /root/source/ffmpeg && \ | |
wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master && \ | |
tar xzvf fdk-aac.tar.gz && \ | |
cd mstorsjo-fdk-aac* && \ | |
autoreconf -fiv && \ | |
./configure --disable-shared && \ | |
make && \ | |
make install && \ | |
make distclean | |
RUN apt-get install -y --force-yes git | |
RUN apt-get install -y --force-yes cmake | |
RUN apt-get install -y --force-yes python2.7 | |
RUN mkdir -p /root/source/ffmpeg/libaom && \ | |
cd /root/source/ffmpeg/libaom && \ | |
git clone https://aomedia.googlesource.com/aom && \ | |
cmake ./aom && \ | |
make && \ | |
make install | |
RUN apt-get install -y --force-yes python3 python3-pip ninja-build | |
RUN pip3 install meson | |
RUN apt-get install -y --force-yes nasm | |
RUN cd /root/source/ffmpeg && \ | |
git clone https://code.videolan.org/videolan/dav1d.git && \ | |
cd dav1d && \ | |
meson build --buildtype release && \ | |
ninja -C build && \ | |
ninja -C build install && \ | |
ldconfig | |
RUN apt-get install -y --force-yes libvpx-dev | |
RUN apt-get install -y --force-yes libssl-dev | |
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes tclsh | |
RUN cd /root/source/ffmpeg && \ | |
git clone https://github.com/Haivision/srt.git && \ | |
cd srt && \ | |
./configure && \ | |
make && make install && \ | |
ldconfig | |
RUN apt-get install -y --force-yes libx265-dev libnuma-dev | |
RUN apt-get install -y --force-yes libfreetype6-dev | |
RUN cd /root/source/ffmpeg && \ | |
wget http://ffmpeg.org/releases/ffmpeg-4.2.1.tar.bz2 && \ | |
tar xjvf ffmpeg-*.tar.bz2 | |
RUN apt-get install -y librtmp-dev libunistring-dev | |
RUN cd /root/source/ffmpeg/ffmpeg* && \ | |
./configure \ | |
--pkg-config-flags="--static" \ | |
--enable-gpl \ | |
--enable-libfdk-aac \ | |
--enable-libx264 \ | |
--enable-libaom \ | |
--enable-libdav1d \ | |
--enable-libvpx \ | |
--enable-librtmp \ | |
--enable-libsrt \ | |
--enable-libx265 \ | |
--enable-libfreetype \ | |
--enable-version3 \ | |
--enable-nonfree && \ | |
make && \ | |
make install | |
ARG PRESET=superfast | |
ENV PRESET=${PRESET} | |
CMD ffmpeg -re -i "srt://0.0.0.0:1234?pkt_size=1316&mode=listener" -c:v libx264 -preset ${PRESET} -g 60 -b:v 6M -maxrate 6M -bufsize 1M -c:a aac -b:a 160k -ar 44100 -threads 0 -f flv "rtmp://rtmp-input/publish/live" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment