Skip to content

Instantly share code, notes, and snippets.

@vladdancer
Last active February 5, 2021 16:27
Show Gist options
  • Save vladdancer/3c1f687e2a2852f71276d14546fadeb3 to your computer and use it in GitHub Desktop.
Save vladdancer/3c1f687e2a2852f71276d14546fadeb3 to your computer and use it in GitHub Desktop.
FFmpeg converting m4a, wav files to mp3 examples.
ffmpeg -i in.m4a -codec:a libmp3lame -qscale:a 2 out.mp3
ffmpeg -i in.wav -codec:a libmp3lame -qscale:a 2 out.mp3
ffmpeg -i in.m4v -vcodec copy -acodec copy out.mp4
# Dealing in bulk mode, origin: https://stackoverflow.com/a/33766147/552540
for i in *.wav; do ffmpeg -i "$i" -codec:a libmp3lame -qscale:a 2 "${i%.*}.mp3"; done
# show media file info
ffmpeg -i in.mp4
# find video track ID and set as -map param value
ffmpeg -i in.mp4 -map 0:0 -vcodec copy out-wo-audio.mp4
# speed factor -> +50%
ffmpeg -i in.mp4 -vf "setpts=(PTS-STARTPTS)/1.5" -crf 18 out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment