easy-editing/merge

25 lines
629 B
Plaintext
Raw Normal View History

2020-03-15 23:40:38 +01:00
#!/usr/bin/env bash
files=$(ls | wc -l)
if [ $files -eq 1 ]; then
cd $(ls)
fi
2020-03-16 00:00:29 +01:00
convert -density 300 *.pdf -resize 1440x1080! '%d'.png
2020-03-15 23:45:50 +01:00
count=$(ls *wav | wc -l)
2020-03-16 00:00:29 +01:00
files=""
2020-03-15 23:40:38 +01:00
2020-03-16 00:00:29 +01:00
for i in `seq 0 $(($count - 1))`; do
2020-03-15 23:40:38 +01:00
# fade
duration=$(sox $i.wav -n stat 2>&1 | grep Length | cut -d ':' -f 2 | tr -d '[:space:]')
sox $i.wav faded-$i.wav fade 0:0.1 $(soxi -d $i.wav) 0:0.1
2020-03-16 00:00:29 +01:00
files="$files faded-$i.wav"
2020-03-15 23:40:38 +01:00
echo -e "file '$i.png'\nduration $duration" >> video-input-list.txt
done
2020-03-16 00:00:29 +01:00
sox $files output.wav
2020-03-15 23:40:38 +01:00
ffmpeg -f concat -safe 0 -i video-input-list.txt output.mp4
ffmpeg -i output.mp4 -i output.wav -c:v libx264 final.mp4