ffmpeg – ffmpeg video converter

Switches

SwitchFunction
-i url (input)input file url
-y (global)Overwrite output files without asking.
-q[:stream_specifier] q (output,per-stream)
-qscale[:stream_specifier] q (output,per-stream)
Use fixed quality scale (VBR). The meaning of q/qscale is codec-dependent. If qscale is used without a stream_specifier then it applies only to the video stream, this is to maintain compatibility with previous behavior and as specifying the same codec specific value to 2 different codecs that is audio and video generally is not what is intended when no stream_specifier is used.

Tasks

Convert a bunch of flac files to mp3

ffmpeg -i input.flac output.mp3

In a saintseiya folder in home with lower quality then default (0 best, 9 lowest, 4 default):

find -name "*.flac" -exec ffmpeg -i {} -q:a 6 ~/saintseiya/{}.mp3 \;

Using xargs and several processes/threads:

find -name "*.flac"  | xargs -P 0 -I '{}' ffmpeg -i '{}' -q:a 6 ~/saintseiya/'{}'.mp3

Documentation: https://trac.ffmpeg.org/wiki/Encode/MP3

Misc

find -name "*.flac" -exec ffmpeg -i {} -c:v copy {}.aiff \;