mkvmerge -o output-with-sound.mkv -A input-video.mkv soundfile.mp3
Month: June 2017
Batch lossless optimize images in Linux, Mac OS and Windows
Linux and Mac OS:
find . -iname '*.png' -exec optipng -o7 -strip all "{}" \;
find . -iregex '.*\.\(jpg\|jpeg\|jpe\|jif|jfif|jfi\)$' -exec jpegoptim --all-progressive --strip-all --strip-com --strip-exif --strip-iptc --strip-icc "{}" \;Batch resize images with different sizes for each orientation in Linux, Mac OS and Windows
#!/bin/bash
I=0
for f in *.jpg
do
(( I++ ))
r=$(printf "%03d" $I)
read w h <<< $(convert "$f" -ping -format "%w %h" info: )
if [ $w -gt $h ]; then
echo "$f is $h tall and $w wide (landscape)"
convert "$f[800x>]" $r.jpg
else
echo "$f is $h tall and $w wide (portrait)"
convert "$f[395x>]" $r.jpg
fi
done