Find files with specific codec (using ffprobe)

#!/bin/bash if [[ "$1" == "" ]]; then echo "Usage: `basename $0` [codec_value] Common values: hevc = h.265 (High Efficiency Video Coding) h264 = h.264 Any valid output from ffprobe can be used: ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 " exit 0 fi while IFS= read -d $'\0' -r file ; do #printf 'File found: %s\n' "$file" CODEC=`ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$file"` #printf 'Codec found: %s\n' "$CODEC" if [[ "$CODEC" = "$1" ]] then printf '%s: %s\n' "$1" "$file" fi done < <(find . -type f -iname '*' ! -iname "." -print0)
Find files with specific codec (using ffprobe).

1. Requires ffprobe
2. Checks from current directory recursively
3. Lists files that match the parameter provided

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.