summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.travis.sh4
-rw-r--r--.travis.yml2
-rw-r--r--Makefile16
-rw-r--r--README.rst2
-rwxr-xr-xsetup.sh44
5 files changed, 58 insertions, 10 deletions
diff --git a/.travis.sh b/.travis.sh
index 930fe85..8818262 100755
--- a/.travis.sh
+++ b/.travis.sh
@@ -27,7 +27,7 @@ case "$1" in
ac_cv_header_gif_lib_h=no \
ac_cv_header_tiffio_h=no \
ac_cv_header_GL_glut_h=no \
- ./configure --disable-shared --disable-dependency-tracking --enable-libwebpmux
+ ./configure --disable-shared --disable-dependency-tracking --enable-libwebpmux --quiet
make $MAKEOPTS
sudo make $MAKEOPTS install
cd ..
@@ -53,7 +53,7 @@ case "$1" in
cd ..
cd ffmpeg
- ./configure --disable-everything --disable-programs --disable-runtime-cpudetect --enable-decoder=mpeg4 --enable-decoder=pcm_s16le --enable-decoder=vorbis --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=wav --enable-encoder=huffyuv --enable-encoder=libfdk_aac --enable-encoder=libopus --enable-encoder=libtheora --enable-encoder=libvpx_vp8 --enable-encoder=libvpx_vp9 --enable-encoder=libx264 --enable-encoder=pcm_s16le --enable-encoder=rawvideo --enable-ffmpeg --enable-filter=aresample --enable-gpl --enable-hardcoded-tables --enable-libfdk_aac --enable-libopus --enable-libtheora --enable-libvpx --enable-libx264 --enable-muxer=ipod --enable-muxer=mp4 --enable-muxer=ogg --enable-muxer=wav --enable-muxer=webm --enable-muxer=yuv4mpegpipe --enable-nonfree --enable-protocol=file
+ ./configure --disable-everything --disable-logging --disable-programs --disable-runtime-cpudetect --enable-decoder=mpeg4 --enable-decoder=pcm_s16le --enable-decoder=vorbis --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=wav --enable-encoder=huffyuv --enable-encoder=libfdk_aac --enable-encoder=libopus --enable-encoder=libtheora --enable-encoder=libvpx_vp8 --enable-encoder=libvpx_vp9 --enable-encoder=libx264 --enable-encoder=pcm_s16le --enable-encoder=rawvideo --enable-ffmpeg --enable-filter=aresample --enable-gpl --enable-hardcoded-tables --enable-libfdk_aac --enable-libopus --enable-libtheora --enable-libvpx --enable-libx264 --enable-muxer=ipod --enable-muxer=mp4 --enable-muxer=ogg --enable-muxer=wav --enable-muxer=webm --enable-muxer=yuv4mpegpipe --enable-nonfree --enable-protocol=file
make $MAKEOPTS
sudo make $MAKEOPTS install
cd ..
diff --git a/.travis.yml b/.travis.yml
index 129e01a..e0f90a1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
language: c
python: "3.3"
node_js: "0.11"
-env: MINIMAL=1 CFLAGS="-O2 -march=native -pipe" CXXFLAGS="-O2 -march=native -pipe" MAKEOPTS="-s"
+env: MINIMAL=1 CFLAGS="-O2 -march=native -pipe" CXXFLAGS="-O2 -march=native -pipe" MAKEOPTS="-s" V=
before_install: ./.travis.sh before_install
install: ./.travis.sh install
script: ./setup.sh
diff --git a/Makefile b/Makefile
index 32a59a8..d8a2e39 100644
--- a/Makefile
+++ b/Makefile
@@ -39,16 +39,32 @@ video: $(CVIDEO)
%.y4m: %.mkv
$(FFMPEG) -i "$<" -c:a copy "$@"
+ifdef NOTEMP
+%.mp4: %.mkv
+else
%.mp4: %.y4m
+endif
$(FFMPEG) -i "$<" -c:v libx264 -preset slower -tune animation -movflags empty_moov -profile:v baseline -c:a libfdk_aac -vbr 1 "$@"
+ifdef NOTEMP
+%.webm: %.mkv
+else
%.webm: %.y4m
+endif
$(FFMPEG) -i "$<" -crf 10 -b:v 1M -c:a copy "$@"
+ifdef NOTEMP
+%.vp9.webm: %.mkv
+else
%.vp9.webm: %.y4m
+endif
$(FFMPEG) -i "$<" -strict -2 -c:v libvpx-vp9 -crf 8 -b:v 1M -c:a libopus -vbr 1 -b:a 64k "$@"
+ifdef NOTEMP
+%.ogv: %.mkv
+else
%.ogv: %.y4m
+endif
$(FFMPEG) -i "$<" -c:v libtheora -qscale:v 10 -c:a copy "$@"
# === AUDIO ===
diff --git a/README.rst b/README.rst
index 12865f1..8faec47 100644
--- a/README.rst
+++ b/README.rst
@@ -47,7 +47,7 @@ Build steps
3. Install prerequisites, download DeflOpt and defluff and place exes in this directory.
4. Run setup.sh. If you're on Windoze, sucks for you. Use a better OS. Patches may or may not be accepted.
5. Run nginx.sh to start nginx, then navigate to localhost:8080 in your browser.
--- OR --
+ -- OR --
5. Open www/index.html in a browser.
Disabling unused conversions
diff --git a/setup.sh b/setup.sh
index b8f40bc..0a53722 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1,15 +1,47 @@
#!/bin/bash
-if ! grep -q -- -j <<< "$MAKEOPTS"; then
- MAKEOPTS="-j`nproc` $MAKEOPTS"
- echo "No -j detected, setting $MAKEOPTS automatically."
- printf "%sGiB free RAM, approx 1GiB/core required (depending on ffmpeg settings)." "$(free -gt | tail -n 1 | awk '{print $4}')"
-fi
-
set -e -x
cd $(dirname $0)
+check-reqs_no() {
+}
+
+check-reqs_disk() {
+ local space
+
+ space=$(df -P . 2>/dev/null | awk 'FNR == 2 {print $4}')
+
+ if [[ $? == 0 && -n $space && $space -lt $1 ]] ; then
+ echo >&2 "Warning: There is NOT at least $1 KiB disk space available, build may fail."
+ fi
+}
+
+check-reqs_memory() {
+ local actual_memory
+
+ if [[ -r /proc/meminfo ]] ; then
+ actual_memory=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
+ fi
+ if [[ -n $actual_memory && $actual_memory -lt $((1024 * $1)) ]] ; then
+ echo >&2 "Warning: There is NOT at least $1 KiB RAM available, build may fail."
+ echo >&2 "If it does, try setting MAKEOPTS lower or simply re-running this script."
+ fi
+}
+
+if ! grep -q -- -j <<< "$MAKEOPTS"; then
+ NPROC="`nproc`"
+ MAKEOPTS="-j$NPROC $MAKEOPTS"
+ echo >&2 "No -j detected, setting $MAKEOPTS automatically."
+ check-reqs_memory $(( NPROC * 262144 )) # 256 MiB/job
+ if [[ $NOTEMP ]]; then
+ check-reqs_disk 500000 # 500 MiB
+ else
+ check-reqs_disk 13000000
+ echo >&2 "If you have insufficient disk space (indicated if so above), consider setting NOTEMP=1 to disable generation of Y4M files."
+ fi
+fi
+
cd unrpyc
# silence build failure
make $MAKEOPTS install || true