Introduction
Introduction Statistics Contact Development Disclaimer Help
Fix input read errors by providing ffmpeg with blank stdin - bitreich-tv - Meme…
git clone git://bitreich.org/bitreich-tv git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfr…
Log
Files
Refs
Tags
LICENSE
---
commit 60592b8f08f20a71d6fca1bd3ec1e4baa42667a1
parent 2c603b4a4ac3a953f11aac4157aae322f52a9e80
Author: Anders Damsgaard <[email protected]>
Date: Sun, 16 Aug 2020 20:57:36 +0200
Fix input read errors by providing ffmpeg with blank stdin
Diffstat:
M brtv-generate-title-slides.sh | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/brtv-generate-title-slides.sh b/brtv-generate-title-slides.sh
@@ -18,34 +18,35 @@ video_resolution=1280x720
# slide style
bgcolor=magenta
-fcolor=white
+fgcolor=white
# show title slides for this duration [s]
title_display_time=5
### CONFIGURATION END
+temp="$(mktemp).png"
title_slide() {
- img="$(basename "${1%.*}".png)"
- printf 'title_slide %s -> %s\n' "$1" "$img"
convert -size "$video_resolution" "xc:${bgcolor}" \
-pointsize 48 -fill "$fgcolor" \
- -gravity center -draw "text 0,0 '#${img%.*}'" "$img"
+ -gravity center -draw "text 0,0 '${1}'" "$temp"
ffmpeg -y \
+ -loglevel error \
-f lavfi \
-i anullsrc=r=48000 \
- -i "$img" \
+ -i "$temp" \
-t "${title_display_time}" \
$ffmpeg_codec \
- "$2" && rm "$img"
+ "$2" < /dev/null
+ printf '%s\n' "$2"
}
mkdir -p "$title"
-# make title slide for every file in $1/ if they do not already exist
-while IFS='
-' read -r line; do
- out_path="${title}/$(basename "${f%.*}.${video_ext}")"
- [ ! -f "$out_path" ] && title_slide "$f" "$out_path"
+# make title slide for every tag in first column of stdin
+# (if title slide doesn't already exist)
+while read -r tag url; do
+ out="${title}/${tag#\#}.${video_ext}"
+ [ ! -f "$out" ] && title_slide "$tag" "$out"
done
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.