From: Einar Jørgen Haraldseid Date: Mon, 2 Aug 2021 17:19:16 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.slaskete.net/srv/git/einar-bin X-Git-Url: https://git.slaskete.net/einar-bin/commitdiff_plain/ed9a9b728dddc3157fd86f95364b94237dd3b203?hp=db85db0fa03cc5344adea984b32ba5eb3af67d6f Merge branch 'master' of ssh://git.slaskete.net/srv/git/einar-bin --- diff --git a/mkintro.sh b/mkintro.sh new file mode 100644 index 0000000..0abed27 --- /dev/null +++ b/mkintro.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# This script will make a text based intro movie of 5 seconds lenght + +if [ -f "$1" ]; then + filename=$1 + + # make the source image: + convert xc:black -resize 640x480! -antialias -gravity "Center" -fill white -font Helvetica -pointsize 34 -annotate 0 @$filename "$filename"000.jpg + + # link it 125 times for 5 seconds: + for ((i=1;i<125;i+=1)); do + ln -s "$filename"000.jpg "$filename"`printf "%03d" "$i"`.jpg + done + + # make the movie: + mencoder mf://*.jpg -mf w=640:h=480:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy -o "$filename".avi +# mencoder mf://*.jpg -mf w=640:h=480:fps=25:type=jpg -ovc raw -oac copy -o "$filename".avi + +# clean up after ourselves: + for ((i=1;i<125;i+=1)); do + rm "$filename"`printf "%03d" "$i"`.jpg + done + +else + echo "Usage: mkintro.sh textfile" && exit +fi diff --git a/remux.sh b/remux.sh new file mode 100755 index 0000000..94a14d5 --- /dev/null +++ b/remux.sh @@ -0,0 +1,8 @@ +#!/bin/bash +for mkvfile in *.mkv; do + filename=${mkvfile%.mkv} + ffmpeg -i "${mkvfile}" -c:a copy -c:v copy -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -movflags faststart "${filename}.mp4" + if [[ ${?} == 0 ]]; then + rm "${mkvfile}" + fi +done