From 67dde45d243c1af22768c685894d6cc7497d8f66 Mon Sep 17 00:00:00 2001 From: Dawid Makowski Date: Sat, 10 Oct 2020 22:39:43 +0800 Subject: [PATCH] Add BBC Audio Waveform Image Generator --- DOCUMENTATION/content/documentation/index.md | 21 +++++++++++++++ docker-compose.yml | 4 +++ env-example | 4 +++ laravel-horizon/Dockerfile | 27 ++++++++++++++++++++ php-fpm/Dockerfile | 24 +++++++++++++++++ php-worker/Dockerfile | 27 ++++++++++++++++++++ workspace/Dockerfile | 24 +++++++++++++++++ 7 files changed, 131 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index cecfa396..ad75e90e 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -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. +
+ +## 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. + +
## Install wkhtmltopdf diff --git a/docker-compose.yml b/docker-compose.yml index cb056aca..eabce3e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/env-example b/env-example index 0d4ebe6c..3b52a4b9 100644 --- a/env-example +++ b/env-example @@ -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 diff --git a/laravel-horizon/Dockerfile b/laravel-horizon/Dockerfile index 7e3cfa30..38b2a695 100644 --- a/laravel-horizon/Dockerfile +++ b/laravel-horizon/Dockerfile @@ -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 \ diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index d05426d3..1837b452 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -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: ##################################### diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile index 211dcb40..084e2dd2 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile @@ -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 diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 6d059bac..0043dd80 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -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: #####################################