summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-16 15:41:15 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-16 15:41:45 +0200
commit45d8b559bccbde5cde1b325faba6177b9b6c6558 (patch)
tree3eb7fb5c91abdefc70d7c6e17748041f32a99d4d /bin
parent80b59372497e0d43294e388155d2938e48a3084e (diff)
Relabel input/logo/output, and list at top.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/decode+edit13
-rwxr-xr-xbin/decode+edit+encode15
-rwxr-xr-xbin/decode+edit+encode+stream8
-rwxr-xr-xbin/decode+edit+loop+encode+stream8
-rwxr-xr-xbin/encodevideo+loop+stream6
-rwxr-xr-xbin/loop+encode+stream6
6 files changed, 27 insertions, 29 deletions
diff --git a/bin/decode+edit b/bin/decode+edit
index ed4ac8b..9a96210 100755
--- a/bin/decode+edit
+++ b/bin/decode+edit
@@ -4,18 +4,17 @@
set -e
-HEIGHT=360
-
-MOVIE=../src/omni/show0/earth.mp4
+INPUT=../src/omni/show0/earth.mp4
LOGO=../../content/icon_small.png
+OUTPUT=../tmp/omni/show0/earth.yuv
-TMPMOVIE=../tmp/omni/show0/earth.yuv
+HEIGHT=360
-mkdir -p $(dirname "$TMPMOVIE")
+mkdir -p $(dirname "$OUTPUT")
# + loop-in-filter trick based on http://video.stackexchange.com/a/16933
ffmpeg -threads auto -y \
- -i "$MOVIE" \
+ -i "$INPUT" \
-i "$LOGO" -filter_complex 'overlay=main_w-overlay_w-20:main_h-overlay_h-20' \
-an \
- -f yuv4mpegpipe "$TMPMOVIE"
+ -f yuv4mpegpipe "$OUTPUT"
diff --git a/bin/decode+edit+encode b/bin/decode+edit+encode
index ac0ab7c..82bbc88 100755
--- a/bin/decode+edit+encode
+++ b/bin/decode+edit+encode
@@ -4,20 +4,19 @@
set -e
-HEIGHT=360
-VBITRATE=500000
-
-MOVIE=../src/omni/show0/earth.mp4
+INPUT=../src/omni/show0/earth.mp4
LOGO=../../content/icon_small.png
+OUTPUT=../tmp/omni/show0/earth.webm
-TMPMOVIE=../tmp/omni/show0/earth.webm
+HEIGHT=360
+VBITRATE=500000
-mkdir -p $(dirname "$TMPMOVIE")
+mkdir -p $(dirname "$OUTPUT")
# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming
# + scale+watermark trick based on http://stackoverflow.com/a/10937357
ffmpeg -threads auto -y -re \
- -i "$MOVIE" \
+ -i "$INPUT" \
-i "$LOGO" \
-filter_complex \
"[0:v]scale=-1:$HEIGHT[bg];
@@ -29,4 +28,4 @@ ffmpeg -threads auto -y -re \
-undershoot-pct 95 -bufsize $((6000*VBITRATE/1000)) -rc_init_occupancy $((4000*VBITRATE/1000)) \
-max-intra-rate 0 \
-qmin 4 -qmax 56 \
- -f webm "$TMPMOVIE"
+ -f webm "$OUTPUT"
diff --git a/bin/decode+edit+encode+stream b/bin/decode+edit+encode+stream
index 014a848..48137bf 100755
--- a/bin/decode+edit+encode+stream
+++ b/bin/decode+edit+encode+stream
@@ -2,6 +2,9 @@
set -e
+INPUT=../src/omni/show0/earth.mp4
+LOGO=../../content/icon_small.png
+
HOST=${1:-morla}
if [ "$HOST" = "$(hostname --short)" ]; then
IP=127.0.0.1
@@ -16,14 +19,11 @@ ABITRATE=64000
HEIGHT=360
VBITRATE=500000
-MOVIE=../src/omni/show0/earth.mp4
-LOGO=../../content/icon_small.png
-
# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming
# + scale+watermark trick based on http://stackoverflow.com/a/10937357
# + Drop frames, aggressively treat as static, and use fastest cpu
ffmpeg -threads auto -re \
- -i "$MOVIE" \
+ -i "$INPUT" \
-i "$LOGO" \
-vf \
"[0:v]scale=-1:$HEIGHT[bg];
diff --git a/bin/decode+edit+loop+encode+stream b/bin/decode+edit+loop+encode+stream
index bf17f33..64495ed 100755
--- a/bin/decode+edit+loop+encode+stream
+++ b/bin/decode+edit+loop+encode+stream
@@ -5,6 +5,9 @@
set -e
+INPUT=../src/omni/show0/earth.mp4
+LOGO=../../content/icon_small.png
+
HOST=${1:-morla}
if [ "$HOST" = "$(hostname --short)" ]; then
IP=127.0.0.1
@@ -19,15 +22,12 @@ ITERATIONS=${3-0} # endless by default
HEIGHT=360
VBITRATE=500000
-MOVIE=../src/omni/show0/earth.mp4
-LOGO=../../content/icon_small.png
-
# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming
# + loop-in-filter trick based on http://video.stackexchange.com/a/16933
# + scale+watermark trick based on http://stackoverflow.com/a/10937357
# + Drop frames, aggressively treat as static, and use fastest cpu
ffmpeg -threads auto -re \
- -f lavfi -i "movie=filename=$MOVIE:loop=$ITERATIONS, setpts=N/(FRAME_RATE*TB)" \
+ -f lavfi -i "movie=filename=$INPUT:loop=$ITERATIONS, setpts=N/(FRAME_RATE*TB)" \
-i "$LOGO" \
-filter_complex \
"[0:v]scale=-1:$HEIGHT[bg];
diff --git a/bin/encodevideo+loop+stream b/bin/encodevideo+loop+stream
index 67e14d5..bb4f581 100755
--- a/bin/encodevideo+loop+stream
+++ b/bin/encodevideo+loop+stream
@@ -2,6 +2,8 @@
set -e
+INPUT=../tmp/omni/show0/earth.yuv
+
HOST=${1:-morla}
if [ "$HOST" = "$(hostname --short)" ]; then
IP=127.0.0.1
@@ -13,12 +15,10 @@ FIRSTPORT=${2:-5002} # even number - next 3 ports used too
VBITRATE=500000
-TMPMOVIE=../tmp/omni/show0/earth.yuv
-
# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming
# + Drop frames, aggressively treat as static, and use fastest cpu
ffmpeg -threads auto -re \
- -stream_loop -1 -i "$TMPMOVIE" \
+ -stream_loop -1 -i "$INPUT" \
-an \
-pix_fmt yuv420p \
-codec:v vp8 -quality realtime -deadline realtime -cpu-used 15 \
diff --git a/bin/loop+encode+stream b/bin/loop+encode+stream
index 0f29ed1..f8403dd 100755
--- a/bin/loop+encode+stream
+++ b/bin/loop+encode+stream
@@ -4,6 +4,8 @@
set -e
+INPUT=../tmp/omni/show0/earth.yuv
+
HOST=${1:-morla}
if [ "$HOST" = "$(hostname --short)" ]; then
IP=127.0.0.1
@@ -17,12 +19,10 @@ ABITRATE=64000
VBITRATE=500000
-TMPMOVIE=../tmp/omni/show0/earth.yuv
-
# based on http://www.webmproject.org/docs/encoder-parameters/#real-time-cbr-encoding-and-streaming
# + Drop frames, aggressively treat as static, and use fastest cpu
ffmpeg -threads auto -re \
- -stream_loop -1 -i "$TMPMOVIE" \
+ -stream_loop -1 -i "$INPUT" \
-codec:a libopus -ac 2 -b:a "$ABITRATE" -ar 48000 \
-vn \
-f rtp "rtp://$IP:$FIRSTPORT?pkt_size=1200" \