bashoneliners.com

Welcome to bashoneliners.com, a curated collection of practical and well-explained Bash one-liners, snippets, tips and tricks. We aim to make each published one-liner to be of high quality: useful, easy to read, follows best practices, with clear, detailed, accurate explanation. These one-liners should help you automate tasks, troubleshoot problems, whether it be in system administration, file management, networking or programming.

Convert directory of videos to MP4 in parallel

for path in *.avi; do echo "${path%.avi}"; done | xargs -I{} -P9 HandBrakeCLI -i {}.avi -o {}.mp4

August 13, 2013shavenwarthog

Convert any 16:9 video to play on a QHD widescreen Android phone

ffmpeg -i $1 -y -threads 0 -subq 6 -deinterlace -level 30 -f mp4 -acodec libfaac -ab 160k -ar 24000 -ac 2 -vcodec libx264 -b 1000k -maxrate 1000k -bufsize 2000k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -coder 0 -refs 2 -flags +loop -vol 256 -trellis 1 -me_method umh -async 1 $2

April 18, 2012openiduser44

Convert from avi format to mp4 encoding

ffmpeg -i file.avi file.mp4

April 11, 2012bashoneliners