Skip to content

Instantly share code, notes, and snippets.

@alexkuang0
Created April 27, 2022 05:52
Show Gist options
  • Save alexkuang0/3405c85e0392a006de9f9d65dc3939fe to your computer and use it in GitHub Desktop.
Save alexkuang0/3405c85e0392a006de9f9d65dc3939fe to your computer and use it in GitHub Desktop.
Extract audios from all videos in a directory
# assume that all videos in the directory are of the same codec
# first choose one of the videos to see the codec of audio
ffprobe xxx.mp4
# batch convert (in this example: mp4 -> aac)
for i in *.mp4; do ffmpeg -i "$i" -vn -acodec copy "${i%.*}.aac"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment