Log in

View Full Version : Finding videos without audio in a mass of files?


cafevincent
21st October 2017, 07:24
If you had to find mkv,mp4 files that have no audio tracks in a mass of 15000 videos, how would approach the situation? I know very little about video tools but I do know batch scripting. Gimme anything to get me started please?

tebasuna51
21st October 2017, 10:12
You can use MediaInfo (CLI version) with a formated output like this Audio.txt file:

General;File : %FileName%.%FileExtension%\r\n
Audio;Audio : %Format%

And create a Info_audio.log file in each folder running a MediaInfo_aud.bat:

@echo off
rem Folder with MediaInfo-CLI (%DT%), at same folder must be Audio.txt
set DT=D:\Programa\Util\MediaInfo
FOR %%I IN (*.*) DO "%DT%\MediaInfo.exe" --Inform=file://"%DT%\Audio.txt" "%%I" >> Info_audio.log

The log file is something like:

File : File 01 with audio.mkv
Audio : AC-3Audio : AC-3
File : File 02 without audio.mkv

File : File 03 with audio.mkv
Audio : AC-3Audio : AC-3
...

raffriff42
21st October 2017, 18:12
Another way:
MediaInfo, File menu, Open, Folder;
** (it will take a long time for a big folder)
** (in fact, better restrict folders to say, 1000 files)
then File, Export, select CSV tab, set options;
** (the options just determine what columns are created)
open CSV in spreadsheet

cafevincent
22nd October 2017, 01:06
Now I'm getting things done, thanks for both of ya. Turns out some of the ones that don't have audio actually have a silent audio track :mad:

LoRd_MuldeR
22nd October 2017, 12:28
You can use FFmpeg with filter "volumedetect" in order to detect mean_volume and max_volume. If this is below a certain threshold, you can assume the file has a "silent" audio track.
https://www.ffmpeg.org/ffmpeg-filters.html#volumedetect

Or you can use the "silencedetect" filter, which should also be able to detect "silent" sections (of the specified minimum duration) within an audio track that is not "totally silent". Depends on what you need.
https://www.ffmpeg.org/ffmpeg-filters.html#silencedetect