From 6f2113c15c77ee3ae2b91c07ad4d90199ce556e8 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Sun, 15 Mar 2020 23:45:50 +0100 Subject: [PATCH] Fix bugs --- index.js | 6 ++++++ merge | 5 +++-- test-merge | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index dbbc0da..0827b25 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,12 @@ const port = 3000; const transporter = nodemailer.createTransport(JSON.parse(fs.readFileSync(__dirname + '/auth.json', 'utf-8'))); +try { + fs.mkdirSync(__dirname + '/data'); +} catch (e) { + +} + const root = "https://easy-editing.tforgione.fr/"; function responseText(id) { diff --git a/merge b/merge index 54affec..2e60b95 100755 --- a/merge +++ b/merge @@ -7,15 +7,16 @@ if [ $files -eq 1 ]; then fi convert -density 300 *.pdf -resize 1440x1080! '%01d'.png +count=$(ls *wav | wc -l) -for i in `seq 0 4`; do +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-*wav output.wav +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 diff --git a/test-merge b/test-merge index d30494c..18d8f15 100755 --- a/test-merge +++ b/test-merge @@ -33,6 +33,12 @@ else elif [ $number_of_sounds -ne $number_of_pages ]; then echo >&2 "
  • il y a $number_of_sounds fichiers sonores mais $number_of_pages planches dans vos slides
  • " errored=1 + else + for i in `seq 0 $number_of_sounds`; do + if ! [ -f $i.wav ]; then + "
  • les fichiers sonores doivent s'appeler 0.wav, 1.wav, 2.wav, etc...
  • " + fi + done fi fi