Click here to download: vidtime.bat (ver 27-Dec-2025)
You may find this windows batch script useful if you have a large collection
of video files. It creates a results file which includes a sorted listing of
all the video files in the current folder (and all subfolders). Note that you
must start vidtime in the folder containing the video files and/or subfolders
containing video files.
The results file is always named vidtime.txt and saved in the current folder.
Each line of the listing shows 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.
Here is a sample results 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 DOS path. (This the only file you need from
the archive.) Other versions of sed may work, although I only tested it with GNU sed.
ffprobe.exe
Go to https://www.ffmpeg.org/download.html
and click on the Windows icon and then on one of the links for "Windows EXE files".
After downloading any build, extract ffprobe.exe from the bin folder and put it anywhere you like as long as it
is on your DOS path. (This is the only file you need from the archive.)
As it is running vidtime creates these four temporary files in the windows temp folder:
vidtmpA.txt: Contains merged output from ffprobe.exe which is called once for every video file found
vidtmpB.txt: sed extracts the relevant data from vidtmpA.txt and saves it into this file
(with "?" marks delineating each field).
vidtmpC.txt: sed rearranges the data in vidtmpB.txt in a readable form for the results file and stores the result here.
vidtmpD.bat: This batch file is created to sum the durations and file sizes of each video file.
The line containing the sums computed by vidtmpD.bat is appended to vidtmpC.txt which then is finally sorted alphabetically to create the results file.
Normally vidtime.bat deletes the 4 temporary files described above after creating the results file.
However if you want to view these temporary files to figure out how vidtime works, call vidtime with any argument, as in:
vidtime arg
where "arg" is any word or any number. (Normally vidtime is called without any arguments.)
When vidtime sees that an argument has been supplied it will skip the step where it deletes the temporary files,
vidtime2.bat
Click here to download: vidtime2.bat (ver 26-Dec-2025)
This script is used in the same way as vidtime.bat described above and serves the same purpose.
However it uses a different method to extract the desired information from the video files.
vidtime.bat does this with ffprobe.exe and vidtime2 does this with MediaInfo.exe
Often problems with videos in your video collection will be discovered by one or both of these batch
and sometimes only by noticing that the results from the two batch files are different.
The results file is always named vidtime2.txt and saved in the current folder
and contains the same information as the vidtime.bat results file. One difference in the results files however
is that different abbreviations are used to describe the video codecs so the two results files will never be
identical.
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 DOS 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 MediaInfo.exe from this zip file and put it anywhere you like as long as it
is on your DOS path. (This is the only file you need from the archive.)
As it is running vidtime2 creates these six temporary files in the windows temp folder:
vtmpA.txt: Contains merged output from MediaInfo.exe which is called once for every video file found
vtmpB.txt: sed extracts the relevent data from vtmpA.txt and saves it into this file
(with "?" marks delineating each field).
vtmpC.txt: sed rearranges the data in vtmpB.txt in a readable form for the results file and stores the result here.
vtmpD.txt: sed makes a few modifications to the vtmpC.txt file to improve readability with the result stored here.
vtmpE.bat: This batch file is created to sum the durations and file sizes of each video file.
mediaInform.txt: This text file is created to tell MediaInfo which data to extract from the video files.
The line containing the sums computed by vtmpE.bat is appended to vdtmpD.txt which then is finally sorted alphabetically to create the results file.
Normally vidtime2.bat deletes the 6 temporary files described above after creating the results file.
However if you want to view these temporary files to figure out how vidtime2 works, call vidtime2 with any argument, as in:
vidtime2 arg
where "arg" is any word or any number. (Normally vidtime2 is called without any arguments.)
When vidtime2 sees that an argument has been supplied it will skip the step where it deletes the temporary files,
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 Reformer
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:
Click here to download: listsubs.bat (ver 11-Jan-2026)
Click here to download: listsub.exe (An auxiliary program required to run listsubs.bat)
Click here to download: listsub.cpp (The source code for the auxiliary program above)
This script creates a sorted list of video files in the current folder (including subfolders).
Each video file takes up one line in the output file which is always named
subtitles.txt which is saved in the current folder.
Following each video filename (on the same line) is a list of subtitles by language that are
embedded into the video file followed by a list of external subtitles for the video.
The most common type of video file to include an imbedded subtitle is .mkv although .mp4 may also included
subtitles. Some file types (.avi for example) don't have the ability to include and imbedded subtitle.
Note that I'm not talking about hard coded subtitles (which are encoded into the video pixels). Any video file type may include hard coded subtitles, but they are less common and less desirable since you can't select your
language and you can't even turn them off or adjust it's size, position, font, or any other aspect of appearance.
(Detecting the presence of hard coded subtitles is difficult and listsubs makes no attempt to do that.)
Here are some typical sample lines from an output file:
path\video1.mkv English Spanish French
path\video2.mkv -----------------------------------------------------------------------
path\video3.mkv English?
path\video4.mp4 .French.srt .Spanish.srt .srt
path\video5.mkv Arabic German Italian .srt
path\video6.avi .srh
path\video7.mp4 .SRT
path\video8.mp4 English Portuguese .Chinese.srt .srt
This output tells you that:
video1 has three embedded subtitles (for the languages shown)
video2 has no embedded or external subtitles
video3 has one embedded subtitle but it's language was not specified.
The language is presumed to be English since that is common, but
it's followed by a "?" mark to indicate that this is just a guess.
video4 has 3 external subtitle files named:
video4.French.srt
video4.Spanish.srt
video4.srt
video5 has 3 embedded subtitles and one external subtitle file named vidoe5.srt
video6 has no embedded or external subtitles but includes hard coded subtitles.
listsubs can't detect hard coded subtitles so you would expect to see the
long row of dashes (as with video2). However, as I often do with my collection
a zero length file named video6.srh was put into the same folder. That's why
.srh appears after the video file name instead of the row of dashes.
video7 has a single external subtitle file named video7.SRT.
video8 includes two embedded subtitles (English and Portuguese) as well
as 3 external subtitle files (in the same folder with video8.mp4) with the following names:
video8.Chinese.srt
video8.srt
Video8.French-Canadian.srt
Note that the last external subtitle does not appear in the output file. There are
two reasons for that. The first reason is that "Video8" is in capitalized, whereas
the video filename is in lower case. (The match must be exact.) The second reason is
that the language name includes a hyphen, but only alphabetic characters are allowed.
You could use "FrenchCanadian" instead or you could use "French (Canadian)" because
that commonly used form is collapsed to "FrenchCanadian" (by line 5 of the sed expression)
listsubs recognizes .both .srt and .SRT and treats them the same. So you may choose the lower or upper case
extension randomly, or you may use the case of the extension to tell you something about the subtitle file.
For example in my video collection, I always use the lower case extension (.srt) for real subtitles
and I use the upper case version (.SRT) to indicate that I have not been able to find the subtitles
for this video in any public database. A zero length .SRT works for this purpose, although I usually
use the following .SRT file:
1
00:00:00,000 --> 00:00:01,999
Subtitles not found at open subtitles.com
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.