Created
June 3, 2020 00:46
-
-
Save visualblind/0cd3b280e0e0ed59130f23f1528a2ddd to your computer and use it in GitHub Desktop.
Output the audio codec of media files with FFmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
find . -depth -maxdepth 2 -regextype posix-extended -regex '.*\.mkv$|.*\.mp4$' -type f -exec bash -c 'echo "{}" $(ffprobe -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 "{}")' \; | |
# stdout media files not using the AAC codec: | |
find . -mount -depth -maxdepth 2 -regextype posix-extended -regex '.*mkv$|.*mp4$' -type f -exec bash -c \ | |
'echo "{}" $(ffprobe -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "{}")' 2>/dev/null \; \ | |
| grep -v 'aac$' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment