Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
OUTPUT_FORMAT=$1
shift
parallel -j 2 "ffmpeg -threads 1 -i {} -f $OUTPUT_FORMAT {.}.$OUTPUT_FORMAT" ::: "$@"
@nicolaschan
nicolaschan / convert.sh
Created May 4, 2019 04:07
Wrapper script to parallelize ffmpeg
#!/bin/sh
# Wrapper script to help parallelize batches of ffmpeg conversions to a single output format
# For example, it can convert all your mp4 files to mp3 format in parallel (or any other formats ffmpeg supports)
# By Nicolas Chan (MIT Licensed)
# Usage: ./convert.sh FORMAT [INPUT_FILES...]
# Example usage: ./convert.sh mp3 *.mp4
# Dependencies:

setuid/setgid/sticky Cheatsheet (Linux)

setuid (s) setgid (s) sticky (t)
Directory ignored New subfiles inherit group Only owner of subfile can (re)move it*
File Executes as file owner Executes as group ignored

Sticky bit can be set with chmod as the first of four digits, or using {+,-}s (for setuid/setgid) and {+,-}t (for sticky). For example, to enable setuid,

chmod u+s $FILE  # Add setuid to a file
chmod 4755 $FILE # Possible permissions of /bin/ping
* *
____o___ *
__ /_________\ _ * *
/ | | / _ *
| | | / /
| | |/ /
\__| /
\__________/
### Keybase proof
I hereby claim:
* I am nicolaschan on github.
* I am nicolaschan (https://keybase.io/nicolaschan) on keybase.
* I have a public key whose fingerprint is 031F 9EF0 3743 AD69 58E6 E8D2 2ACC 08B4 69A2 1FEB
To claim this, I am signing this object: