which also improves cleaning regexp
--- /dev/null
+#! /bin/sh
+
+find $@ \
+ -type f \
+ -print0 \
+| xargs \
+ -0 \
+ -P "$(nproc)" \
+ -I {} \
+ sh -c 'printf "%s\0%s\0\0" $(mimetype -b "{}") "{}"' \
+| gawk -v RS='\0\0' -v ORS='\0' '/^video/ {sub("^[^\0]+\0", ""); print}'
set -e
-find "$DIR_VIDEO" \
- -type f \
- -print0 \
-| xargs \
- -0 \
- -P "$(nproc)" \
- -I{} \
- sh -c 'printf "%s %s\n" $(mimetype -b "{}") "{}"' \
-| awk '/^video/ {sub($1 " +", ""); print}' \
-> "$FILE_VIDEO_CATALOG"
+video-find "$DIR_VIDEO" | xargs -0 -I% echo % > "$FILE_VIDEO_CATALOG"