Created
July 5, 2019 16:20
-
-
Save rogersguedes/4538f12439c6fc71e290b58d7cfa7c0b to your computer and use it in GitHub Desktop.
This script parses file info generated by ffmpeg and, if the first stream is an audio stream, moves to file to from $1 to $2
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
#!/bin/bash | |
# This script parses file info generated by ffmpeg and, if the first stream is an audio stream, moves to file to from | |
# $1 to $2 | |
# https://www.computerhope.com/unix/bash/read.htm | |
find $1 -maxdepth 1 -type f -print0 | | |
while IFS= read -r -d '' line | |
do | |
ffmpeg -i "${line}" 2>&1 | grep --color=always "Stream #0:0[()a-z]*: Audio" > /dev/null | |
if [ $? -eq 0 ]; then | |
echo ${line} | |
mv "${line}" $2 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment