2

I can see the time length in Windows explorer, but there are 124 files. I'd rather not have to add them up manually. I have ffmpeg and VLC also if that would help.

Chloe
  • 5,776
  • 23
  • 71
  • 118

3 Answers3

3

I think this question is quite alike the one asked before at How to get video duration in seconds?

With bellow command you can get the duration of a given video file (e.g. file1.mp4):
ffmpeg -i file1.mp4 2>&1 | grep "Duration" | cut -f4 -d' ' | cut -f1 -d','

With for loop , it is easy to get duration of each file:
for f in *.mp4; do ffmpeg -i $f 2>&1 | grep "Duration" | cut -f4 -d' ' | cut -f1 -d',' done

Then to sum them up by any external spreedsheet utility (e.g. Excel). If you insist to use command line to get the total, you can still refer to the method provided by this How to get video duration in seconds?, to covert each duration into seconds, then to add all seconds up.


EDIT:
As you mentioned Windows Explorer, I assume you are using Windows only and here bellow are pure Windows based (and ffmpeg as you mentioned already) solutions (you may need to provide path to ffmpeg):
for %f in (*.mp4) do @ffmpeg -i %f 2>&1 | findstr Duration > result.txt

The result looks like:

  Duration: 00:00:18.20, start: 0.000000, bitrate: 17085 kb/s
  Duration: 00:00:45.12, start: 0.000000, bitrate: 16913 kb/s
  Duration: 00:00:41.93, start: 0.000000, bitrate: 17083 kb/s

Again, with Excel, you can easily split the duration part and sum them up. Or you can refer to https://stackoverflow.com/questions/4441827/windows-command-for-cutting-columns-from-a-text to use Windows command line only to get the duration only.

Yingyu YOU
  • 199
  • 4
1

Depending on the type of video file it is, but if it's say a mp4 video file, then select the videos together by clicking one, +CTRL, then another, then another until you are done all the while holding the CTRL button down. Or CTRL+A to select all videos in a folder. Then the total running time will show in the windows detail pane just as a single video file would.

ejbytes
  • 2,014
  • 3
  • 13
  • 25
  • It doesn't do that. I selected all videos and it only says '124 items selected' in the status bar. I also clicked Properties and Details and it doesn't show the total time there either. – Chloe Jun 09 '16 at 04:34
  • What type of video file is it? I won't show on flv files. But avi, mpg, mp4, wmv, yes. – ejbytes Jun 09 '16 at 04:35
  • I just looked up ffmpeg; is that a video file decoder or transcoder file? – ejbytes Jun 09 '16 at 04:41
1

I tried to select all and click Properties > Details but it wouldn't show the total. OK I see that I had selected two VTT subtitle files. I deselected the VTT files and went to Properties > Details and now I see the total is 71 hours. (I don't know what a Windows bar is.)

Chloe
  • 5,776
  • 23
  • 71
  • 118