-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM ubuntu:bionic | ||
LABEL maintainer="Werner Robitza <werner.robitza@gmail.com>" | ||
LABEL name="ffmpeg_quality_metrics" | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends ca-certificates curl file g++ git locales make uuid-runtime python3-pip \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \ | ||
&& useradd -m -s /bin/bash linuxbrew \ | ||
&& echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers | ||
|
||
USER linuxbrew | ||
WORKDIR /home/linuxbrew | ||
ENV PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH \ | ||
SHELL=/bin/bash | ||
|
||
RUN git clone https://github.com/Linuxbrew/brew.git /home/linuxbrew/.linuxbrew/Homebrew \ | ||
&& mkdir /home/linuxbrew/.linuxbrew/bin \ | ||
&& ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/ \ | ||
&& brew config | ||
|
||
RUN brew tap varenc/ffmpeg \ | ||
&& brew install varenc/ffmpeg/ffmpeg --with-libvmaf | ||
|
||
COPY requirements.txt . | ||
RUN pip3 install -r requirements.txt | ||
|
||
COPY ffmpeg_quality_metrics.py . | ||
|
||
ENTRYPOINT ["python3", "./ffmpeg_quality_metrics.py"] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Helper script to run Docker container | ||
|
||
usage() { | ||
echo "Usage: $0 <dist> <ref> [OPTIONS]" | ||
echo | ||
echo " <dist> -- distorted video" | ||
echo " <ref> -- reference video" | ||
echo " [OPTIONS] -- further options passed to ffmpeg_quality_metrics.py" | ||
exit 1 | ||
} | ||
|
||
if [ $# -lt 2 ]; then | ||
usage | ||
fi | ||
|
||
distFile="$1" | ||
refFile="$2" | ||
|
||
distFileBasename="$(basename $1)" | ||
refFileBasename="$(basename $2)" | ||
|
||
distDir="$(realpath "$(dirname "$1")")" | ||
refDir="$(realpath "$(dirname "$2")")" | ||
|
||
shift; shift | ||
|
||
docker run \ | ||
--rm \ | ||
-v "$distDir":"/tmp/dist" \ | ||
-v "$refDir":"/tmp/ref" \ | ||
-t ffmpeg_quality_metrics \ | ||
./ffmpeg_quality_metrics.py \ | ||
"/tmp/dist/$distFileBasename" \ | ||
"/tmp/ref/$refFileBasename" \ | ||
"$@" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pandas |