23 lines
596 B
Bash
Executable File
23 lines
596 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
files=$(ls | wc -l)
|
|
|
|
if [ $files -eq 1 ]; then
|
|
cd $(ls)
|
|
fi
|
|
|
|
convert -density 300 *.pdf -resize 1440x1080! '%01d'.png
|
|
count=$(ls *wav | wc -l)
|
|
|
|
for i in `seq 0 $count`; do
|
|
# 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
|
|
echo -e "file '$i.png'\nduration $duration" >> video-input-list.txt
|
|
done
|
|
|
|
sox faded-{0..$count}.wav output.wav
|
|
|
|
ffmpeg -f concat -safe 0 -i video-input-list.txt output.mp4
|
|
ffmpeg -i output.mp4 -i output.wav -c:v libx264 final.mp4
|