Merge pull request #2737 from makowskid/add-audiowaveform

Add BBC Audio Waveform Image Generator
This commit is contained in:
Lan Phan 2020-11-19 18:58:15 +07:00 committed by GitHub
commit 872c2b9eb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 131 additions and 0 deletions

View File

@ -2031,6 +2031,27 @@ To install FFMPEG in the Workspace container
**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise you'll get an error when running the `php-ffmpeg` binary.
<br>
<a name="Install-audiowaveform"></a>
## Install BBC Audio Waveform Image Generator
audiowaveform is a C++ command-line application that generates waveform data from either MP3, WAV, FLAC, or Ogg Vorbis format audio files.
Waveform data can be used to produce a visual rendering of the audio, similar in appearance to audio editing applications.
Waveform data files are saved in either binary format (.dat) or JSON (.json).
To install BBC Audio Waveform Image Generator in the Workspace container
1 - Open the `.env` file
2 - Search for the `WORKSPACE_INSTALL_AUDIOWAVEFORM` argument under the Workspace Container and set it to `true`
3 - Re-build the container `docker-compose build workspace`
4 - If you use the `php-worker` or `laravel-horizon` container too, please follow the same steps above especially if you have processing that have been queued.
**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise you'll get an error when running the `audiowaveform` binary.
<br>
<a name="Install-wkhtmltopdf"></a>
## Install wkhtmltopdf

View File

@ -151,6 +151,7 @@ services:
- INSTALL_POWERLINE=${WORKSPACE_INSTALL_POWERLINE}
- INSTALL_SUPERVISOR=${WORKSPACE_INSTALL_SUPERVISOR}
- INSTALL_FFMPEG=${WORKSPACE_INSTALL_FFMPEG}
- INSTALL_AUDIOWAVEFORM=${WORKSPACE_INSTALL_AUDIOWAVEFORM}
- INSTALL_WKHTMLTOPDF=${WORKSPACE_INSTALL_WKHTMLTOPDF}
- INSTALL_GNU_PARALLEL=${WORKSPACE_INSTALL_GNU_PARALLEL}
- INSTALL_LNAV=${WORKSPACE_INSTALL_LNAV}
@ -245,6 +246,7 @@ services:
- INSTALL_PCNTL=${PHP_FPM_INSTALL_PCNTL}
- ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES}
- INSTALL_FFMPEG=${PHP_FPM_FFMPEG}
- INSTALL_AUDIOWAVEFORM=${PHP_FPM_AUDIOWAVEFORM}
- INSTALL_WKHTMLTOPDF=${PHP_FPM_INSTALL_WKHTMLTOPDF}
- INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF}
- INSTALL_XMLRPC=${PHP_FPM_INSTALL_XMLRPC}
@ -303,6 +305,7 @@ services:
- INSTALL_SWOOLE=${PHP_WORKER_INSTALL_SWOOLE}
- INSTALL_TAINT=${PHP_WORKER_INSTALL_TAINT}
- INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG}
- INSTALL_AUDIOWAVEFORM=${PHP_WORKER_INSTALL_AUDIOWAVEFORM}
- INSTALL_REDIS=${PHP_WORKER_INSTALL_REDIS}
- INSTALL_IMAP=${PHP_WORKER_INSTALL_IMAP}
- INSTALL_XMLRPC=${PHP_WORKER_INSTALL_XMLRPC}
@ -338,6 +341,7 @@ services:
- INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS}
- INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO}
- INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG}
- INSTALL_AUDIOWAVEFORM=${LARAVEL_HORIZON_INSTALL_AUDIOWAVEFORM}
- PUID=${LARAVEL_HORIZON_PUID}
- PGID=${LARAVEL_HORIZON_PGID}
volumes:

View File

@ -174,6 +174,7 @@ WORKSPACE_CHROME_DRIVER_VERSION=2.42
WORKSPACE_TIMEZONE=UTC
WORKSPACE_SSH_PORT=2222
WORKSPACE_INSTALL_FFMPEG=false
WORKSPACE_INSTALL_AUDIOWAVEFORM=false
WORKSPACE_INSTALL_WKHTMLTOPDF=false
WORKSPACE_INSTALL_GNU_PARALLEL=false
WORKSPACE_INSTALL_AST=true
@ -244,6 +245,7 @@ PHP_FPM_INSTALL_SSHPASS=false
PHP_FPM_INSTALL_MAILPARSE=false
PHP_FPM_INSTALL_WKHTMLTOPDF=false
PHP_FPM_FFMPEG=false
PHP_FPM_AUDIOWAVEFORM=false
PHP_FPM_ADDITIONAL_LOCALES="en_US.UTF-8 es_ES.UTF-8 fr_FR.UTF-8"
PHP_FPM_DEFAULT_LOCALE=POSIX
@ -269,6 +271,7 @@ PHP_WORKER_INSTALL_GHOSTSCRIPT=false
PHP_WORKER_INSTALL_SWOOLE=false
PHP_WORKER_INSTALL_TAINT=false
PHP_WORKER_INSTALL_FFMPEG=false
PHP_WORKER_INSTALL_AUDIOWAVEFORM=false
PHP_WORKER_INSTALL_CASSANDRA=false
PHP_WORKER_INSTALL_GEARMAN=false
PHP_WORKER_INSTALL_REDIS=false
@ -300,6 +303,7 @@ LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE=false
LARAVEL_HORIZON_INSTALL_PHPREDIS=true
LARAVEL_HORIZON_INSTALL_MONGO=false
LARAVEL_HORIZON_INSTALL_FFMPEG=false
LARAVEL_HORIZON_INSTALL_AUDIOWAVEFORM=false
LARAVEL_HORIZON_PGID=1000
LARAVEL_HORIZON_PUID=1000

View File

@ -126,6 +126,33 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apk add ffmpeg \
;fi
# Install BBC Audio Waveform Image Generator:
ARG INSTALL_AUDIOWAVEFORM=false
RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \
apk add git make cmake gcc g++ libmad-dev libid3tag-dev libsndfile-dev gd-dev boost-dev libgd libpng-dev zlib-dev \
&& apk add autoconf automake libtool gettext \
&& wget https://github.com/xiph/flac/archive/1.3.3.tar.gz \
&& tar xzf 1.3.3.tar.gz \
&& cd flac-1.3.3 \
&& ./autogen.sh \
&& ./configure --enable-shared=no \
&& make \
&& make install \
&& cd .. \
&& git clone https://github.com/bbc/audiowaveform.git \
&& cd audiowaveform \
&& wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz \
&& tar xzf release-1.10.0.tar.gz \
&& ln -s googletest-release-1.10.0/googletest googletest \
&& ln -s googletest-release-1.10.0/googlemock googlemock \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
;fi
# Install Cassandra drivers:
ARG INSTALL_CASSANDRA=false
RUN if [ ${INSTALL_CASSANDRA} = true ]; then \

View File

@ -857,6 +857,30 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apt-get -y install ffmpeg \
;fi
###########################################################################
# BBC Audio Waveform Image Generator:
###########################################################################
USER root
ARG INSTALL_AUDIOWAVEFORM=false
RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \
apt-get -y install git wget make cmake gcc g++ libmad0-dev libid3tag0-dev libsndfile1-dev libgd-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev \
&& git clone https://github.com/bbc/audiowaveform.git \
&& cd audiowaveform \
&& wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz \
&& tar xzf release-1.10.0.tar.gz \
&& ln -s googletest-release-1.10.0/googletest googletest \
&& ln -s googletest-release-1.10.0/googlemock googlemock \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
;fi
#####################################
# wkhtmltopdf:
#####################################

View File

@ -168,6 +168,33 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apk --update add ffmpeg \
;fi
# Install BBC Audio Waveform Image Generator:
ARG INSTALL_AUDIOWAVEFORM=false
RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \
apk add git make cmake gcc g++ libmad-dev libid3tag-dev libsndfile-dev gd-dev boost-dev libgd libpng-dev zlib-dev \
&& apk add autoconf automake libtool gettext \
&& wget https://github.com/xiph/flac/archive/1.3.3.tar.gz \
&& tar xzf 1.3.3.tar.gz \
&& cd flac-1.3.3 \
&& ./autogen.sh \
&& ./configure --enable-shared=no \
&& make \
&& make install \
&& cd .. \
&& git clone https://github.com/bbc/audiowaveform.git \
&& cd audiowaveform \
&& wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz \
&& tar xzf release-1.10.0.tar.gz \
&& ln -s googletest-release-1.10.0/googletest googletest \
&& ln -s googletest-release-1.10.0/googlemock googlemock \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
;fi
# Install AMQP:
ARG INSTALL_AMQP=false

View File

@ -1305,6 +1305,30 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apt-get -y install ffmpeg \
;fi
###########################################################################
# BBC Audio Waveform Image Generator:
###########################################################################
USER root
ARG INSTALL_AUDIOWAVEFORM=false
RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \
apt-get -y install git wget make cmake gcc g++ libmad0-dev libid3tag0-dev libsndfile1-dev libgd-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev \
&& git clone https://github.com/bbc/audiowaveform.git \
&& cd audiowaveform \
&& wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz \
&& tar xzf release-1.10.0.tar.gz \
&& ln -s googletest-release-1.10.0/googletest googletest \
&& ln -s googletest-release-1.10.0/googlemock googlemock \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
;fi
#####################################
# wkhtmltopdf:
#####################################