To prepare our next courses, I'm working on a set of tools called "product packager": shell programs to compress videos, pictures, create html and PDF documents... It's here (work-in-progress): https://github.com/GDquest/product-packager … Is there a good alternative to eval to build commands?
-
Show this thread
-
Regarding the question: I use eval here to build an ffmpeg command for each video: https://github.com/GDQuest/product-packager/blob/master/programs/optimize_videos.sh#L98-L107 … This makes the code easy to manage in shell script, it lets me build complex commands with some conditions (see next tweet)
1 reply 0 retweets 3 likesShow this thread -
Here's an example of evaluated command: ffmpeg -hwaccel auto -y -v quiet -i "pastures.mp4" -c:v libx264 -crf 20 -preset slow -an -filter "scale=1280:720" "./temp_pastures.mp4" I'm wondering if anyone has a better solution to this problem than using eval in sh language.
5 replies 0 retweets 2 likesShow this thread
Next up, add to the top: set -euo pipefail To make this more robust. This will stop on any error return (-e), abort on using any unset var (-u) and abort on any pipe failure.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.