This simple Bash script checks video files within a specified directory for audio tracks. If a video file lacks an audio track, the script moves it to a no_audio subdirectory within its original location. It supports several video formats including MP4, AVI, MOV, and MKV.
- FFmpeg: The script uses
ffprobefrom the FFmpeg suite to inspect audio streams in video files. Ensure FFmpeg is installed andffprobeis available in your system's PATH.
- Open a terminal.
- Navigate to the directory containing the script.
- Run the script with the directory you want to check as the argument:
./find-files-without-audio.sh /path/to/directory
Replace /path/to/directory with the actual path where your video files are stored.
The script will recursively search through the specified directory for video files with the extensions .mp4, .avi, .mov, and .mkv. If a video file does not contain an audio track, it will be moved to a no_audio subdirectory within its original directory, and a message will be printed to the console.
This script does not alter the video files other than moving those without audio to a different directory. Ensure you have the necessary permissions to read and write in the directories you're working with.