You may find this windows batch script useful if you have a large collection
of video files. It creates a sorted listing of all the video files in the
current folder (and all subfolders). Each line lists one video file with the
following information about the file (in this order):
Duration (hh:mm:sec)
Average bit rate (kb/s)
Codec type
Resolution (horiz x vert)
File size (MBytes)
File extension
File name (with path)
The script displays a dot on the console for every video file processed to let
you know that the script is still running. When all the files have been processed
the file count as well as the totals for Duration and File size are displayed.
These totals are also included as the first line of the result file which is
always named vidtime.txt in the current folder.
Here is a sample output file. When the script was invoked, the current folder
contained 10 video files and no subfolders:
************* Total run time 12:22:26 ******************* 10 video files, 4.8 GB
00:01:02 221 kbs mpeg1 320x240 1 MB .wmv --- Anticipation
01:20:16 1045 kbs h264 1280x720 629 MB .mp4 --- Before Sunset 2004
00:05:15 531 kbs flv1 640x480 20 MB .flv --- Benjamin Franklin
01:48:00 993 kbs h264 1280x536 804 MB .mp4 --- Ex Machina 2015
00:01:12 204 kbs msvid 240x180 1 MB .mov --- Indecent Proposal
01:34:34 1037 kbs h264 1280x720 736 MB .mkv --- Inside Out 2015
01:16:23 550 kbs mpeg4 720x288 315 MB .avi --- Lady and the Tramp 1955
02:29:46 561 kbs mpeg2 720x304 630 MB .avi --- Lincoln 2012
01:42:49 947 kbs wmv3 988x720 730 MB .avi --- Singin in the Rain 1952
02:03:09 1048 kbs h264 1280x528 968 MB .mp4 --- The Walk 2015
For this script to run, you must have these two additional files:
sed.exe
Go to
http://gnuwin32.sourceforge.net/packages/sed.htm
and download the "Binaries" zip file. Extract sed.exe from the bin folder and put
it anywhere to like as long as it is on your path. (This the only file you need from
the archive.) Other versions of sed may work, although I only tested it with GNU sed.
Extract ffprobe.exe from the bin folder and put it anywhere you like as long as it
is on your path. (This is the only file you need from the archive.)
If this script or the scripts described below produce results you don't expect, try
commenting out the last line ("del") which deletes all the temporary files. Viewing
those temporary files may help you figure out what went wrong.
This script is similar to the previous one except that it looks for mp3 audio files
instead of video files. As with the previous script, you also must have sed and ffprobe.
The result file is always named mp3time.txt in the current folder.
I have tested this script with a collection containing over 100,000 files, but below is a sample
output file from a much smaller collection. When the script was invoked, the current folder
contained 2 folders each of which contained six mp3 files. The number after the audio duration
is the bitrate in kilobits per second:
****** 12 mp3 files ************** 4:09:24 Total run time, 289 MB ************
00:02:45 64K 1.32 MB --- Live\Advice to Little Girls
00:22:33 128K 21.65 MB --- Live\Cannibalism in the Cars
00:02:26 256K 4.68 MB --- Live\No Two People
00:38:56 128K 37.37 MB --- Live\Stolen White Elephant
00:28:11 128K 27.07 MB --- Live\Taming the Bicycle
00:31:47 64K 15.25 MB --- Live\Travelling with a Refomer
00:02:40 256K 5.13 MB --- Visit\Bloop Bleep
00:04:08 96K 2.98 MB --- Visit\Buying a House
00:20:15 128K 19.44 MB --- Visit\Dogs Tale
00:02:42 256K 5.20 MB --- Visit\Little White Duck
00:02:15 192K 3.29 MB --- Visit\Mental Makeup
01:30:46 213K 145.23 MB --- Visit\Rough Around the Edges
If your audio collection contains only mp3 files (by far the most popular audio format) then
you will probably prefer the previous script, but if you use any of the alternative audio
formats then this is the script you want. The result file is always named
audiotime.txt in the current folder.
Here is a sample output file. When the script was invoked, the current folder contained
9 audio files using each of the 9 audio formats supported by audiotime.bat:
Feel free to email me (at the address shown on my home page) with any questions or
comments you may have about these scripts. Also if you encounter an audio or video
file that causes the script to behave inappropriately, I would be grateful if you
let me know.