summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/decode+edit+encodeDV25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/decode+edit+encodeDV b/bin/decode+edit+encodeDV
new file mode 100755
index 0000000..a853d81
--- /dev/null
+++ b/bin/decode+edit+encodeDV
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# FIXME: Handle audio
+
+set -e
+
+INPUT=../src/omni/show0/earth.mp4
+LOGO=../../content/icon_small.png
+OUTPUT=../tmp/omni/show0/earth.dv
+
+HEIGHT=360
+VBITRATE=256000
+
+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
+# + Add 1s latency (deadline)
+ffmpeg -hide_banner -threads auto -y \
+ -i "$INPUT" \
+ -i "$LOGO" \
+ -filter_complex \
+ "[0:v]scale=-1:$HEIGHT[bg];
+ [bg][1:v]overlay=main_w-overlay_w-20:main_h-overlay_h-20" \
+ -target pal-dv "$OUTPUT"