Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have many folders of mp3 files, and I would like to have a list of the combined duration of all the mp3s in each folder. That would be the ideal solution, but some means of doing a directory print attaching the individual mp3 duration would also be good. Any help would be much appreciated. I am running Windows 7 Home Premium, but have access to a number of other Windows/Mac OS.

Edit - I actually found an solution using the export function in the freeware program Tagscanner.

share|improve this question
    
I have a WPF application I wrote that will do that (amongst other things), but I haven't uploaded it anywhere yet - still really for internal use only. However, if nothing else come up I could let you have a copy. –  ChrisF Jan 11 '11 at 22:01
add comment

2 Answers

If you're working on Mac OS or any Unix system you can install ffmpeg and use the following command to extract the duration of a single file:

ffmpeg -i filename.mp3 2>&1 | egrep "Duration" | cut -d ' ' -f 4 | sed s/,//

That would for example return "00:08:17.4".

You can use this in a shell script of course, so for example this would list all of the mp3 files in a folder and their duration to the right.

#!/bin/bash
# call me with mp3length.sh directory
# e.g. ./mp3length . 
# or ./mp3length my-mp3-collection

for file in $1/*.mp3
do
    echo -ne $file "\t"
    ffmpeg -i "$file" 2>&1 | egrep "Duration"| cut -d ' ' -f 4 | sed s/,//
done
share|improve this answer
add comment

You can add a column to the file list in Wİndows Explorer. Add "Length" property colum to folder. Then select all off the mp3 files in the folder. You can see total length in the bottom summary pane of win.exp...

(Not the whole solution to your question but you said "any help would be appreciated :D)

share|improve this answer
    
Thanks, this is pretty much what I do at the moment. The problem is these files are across many hard drives, so I want to be able to export this info to use in spreadsheets and the like without doing it all manually. –  Anastasia Jan 12 '11 at 6:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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