13

I have a bunch of small video files in a folder and I thought clicking on Properties of the folder would give me the total duration of all the video clips combined but it didn't. What is the simplest way to count the total time of many different clips in a folder? In the same folder I have some .srt files too.

Also, I use VLC player; is there a way to use it to solve my problem? I don't have Windows Media Player.

Win 7. IE 8.

8
  • 1
    How comfortable are you with scripting? This solution would work, but you would need to tweak it a bit to get the total: stackoverflow.com/questions/1987648/…
    – EBGreen
    Feb 21 '12 at 21:21
  • 1
    If you select the items in the file browser, then in the bottom I can see the total length of the selected items.
    – Bernhard
    Feb 21 '12 at 21:24
  • 2
    @Bernhard should be an answer not a comment.
    – Moab
    Feb 21 '12 at 21:51
  • @EBGreen I can't script at all.
    – verve
    Feb 21 '12 at 22:20
  • @Bernhard I tried this but I just get the total file size at the bottom!
    – verve
    Feb 21 '12 at 22:23
21

You can use the Windows Explorer Filter.

  • Open the desired folder on Windows Explorer (WindowsKey-E);
  • Click at the search bar (or use Ctrl-F);
  • Type System.Kind:=Video;
  • Select all video files from the result list;
  • Open their properties (Right Mouse Button -> Properties);

The total duration calculation will be shown in the Details tab;

1
6

As long as windows is able to read video metadata, right-clicking on them and going in Details does indeed show the total length. I just tested here on a combination of .MP4 and .WMV and it worked.

For windows to read video metadata properly, you may need to have Windows Media Player installed as well as appropriate codecs (using codec packs such as Shark007, K-Lite and CCCP is a good idea). Whether you can see thumbnails or not in Windows Explorer should give you an indication.

Other than that, you could use a media application that supports video and shows total time in playlists, such as Winamp.

3
  • My files are .FLV and MPEG-4 plus some .srt files scattered in the folder I'm trying to check. Will it work on these? Hmm...two of the video files have thumbnails but the rest are a single sheet of white.
    – verve
    Feb 22 '12 at 8:35
  • No. Windows Explorer cannot read FLV metadata.
    – iglvzx
    Feb 22 '12 at 8:38
  • @verve I'm not sure about FLV. Maybe not as per iglvzx. As for SRT, they are subtitle files so there are no video or durations on those.
    – mtone
    Feb 22 '12 at 16:17
5

Its very very simple. Just select all the videos. Put into VLC media player. Now click on the toggle playlist button. There you will see on top left just beside playlist total video playtime is shown.

image

1
4

You can use Mpv (for Windows too). Here I use it in Cygwin/Mingw:

mpv --term-playing-msg='SO_DURATION=${=duration}' --no-config --no-cache --quiet --frames=1 --vo=null --ao=null Selfie_del_futuro.ogv | grep ^SO_DURATION
SO_DURATION=45.053229

You can change SO_DURATION if you like, it is just a marker so that it can be grepped.

3
  • 1
    What's the stuff in the grey window?
    – verve
    Feb 21 '12 at 22:21
  • Example usage of mplayer from a Bash prompt in the Cygwin terminal. Lines starting with "$" are commands and lines without "$" are output. The third line is there to show you that the command only outputs one line, which means you can easily parse and sum it with other durations. Feb 21 '12 at 23:34
  • 1
    It works in Linux as well. It collects the lengths. Then we can use e.g. a Python code to add those values if we deleted the part before the numbers: with open("lengths") as f: values = f.read().splitlines() print(sum([float(v) for v in values]) Aug 11 '16 at 15:18
3

If you select the items in the file browser, then in the bottom I can see the total length of the selected items.

As requested, here are some sample screenshots (from Windows 7).

3
  • Add a screenshot to prove it Nov 8 '15 at 9:44
  • 1
    now try it with .flv files :)
    – jiggunjer
    Dec 9 '15 at 1:44
  • Ha! I tried so many ways but turns out Windows Media Player is there to rescue! You can humiliate WMP all you want but it is dependable when needed ;)
    – Macindows
    Jun 15 '20 at 10:45
2

Install this extension in VLC. It works like a charm.

2
  • I think this is best for OP. If it works.
    – jiggunjer
    Dec 9 '15 at 1:43
  • VLC can show the total playlist length without any extension. Maybe it couldn't do it in 2012 (when this answer was written), but it does it now.
    – lbalazscs
    Jan 9 '17 at 15:12
1

Select all files in question inside File Explorer. Take a Right Click & Go to Properties. In Properties Window, Take Details Tab. Lookout for the value of Length and there it is! Hope it works. It sure works in Win 7 for Videos as I checked.

3
  • OP: "I have a bunch of small video files in a folder and I thought clicking on Properties of the folder would give me the total duration of all the video clips combined but it didn't" Nov 8 '15 at 9:43
  • 1
    The OP looked at the properties of the folder.  This answer is saying, "Go into the folder, and then select all the (video) files in the folder, and get their collected properties.  I can confirm (on my system) that what the OP tried, doesn't work, and this answer does.  YMMV.
    – Scott
    Nov 8 '15 at 11:03
  • Works on Windows 10! Jun 20 at 10:02
0

For Windows, see this answer.

You can select the audio files in a folder, then

  1. look in the Details pane at the bottom of your Windows explorer window [switch this on in Organise, Layout, Details pane]

  2. right-click, Properties, Details tab.

Both ways will show you the total length of the selected files.

If you want to include subfolders then you'll need to do a search on the top level folder of interest - search on type: mp3 or wma or whatever format you use and it will return all the corresponding files within that folder tree. Select them all in the search results window and then as I've written above.

If you have used a mixture of audio formats, you'll have to repeat the procedure for each type.

0

You can use ffprobe of the ffmpeg project. If you want to do it on the command line on a Linux or Mac OS X system (and maybe soon also Windows):

IFS='
'

for mf in *; do len=$(ffprobe $mf 2>&1 | grep Duration); echo "$len --- $mf"; done

You can even sort them by lenth:

for mf in *; do len=$(ffprobe $mf 2>&1 | grep Duration); echo "$len --- $mf"; done | sort

Explanation:

  • The first command IFS= is for adjust shell globbing (ignore spaces in filenames).
  • Then there is a for-loop over all files in the current directory (that is the *).
  • Inside the for-loop a subshell $(……) is opened, where the ffprobe command is started, the output, which is normally going to STDERR is redirected (2>) to STDOUT (abbreviated with &1), then piped to grep, which searches and prints all lines containing the word Duration.
  • The result of the subshell is saved into the variable $len.
  • After the subshell the length and the name of the file is printed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.