How to display total duration of a video/audio folder

Hi all, hi Leo,

I was wondering whether it is possible to display the total length (duration) of a folder containing video and/or audio files.

Many thanks in advance.

The {tmp3} status bar code will show total media duration for any files Opus knows how to get the duration from. You can add it under Preferences / Display / Status Bar. The menu there gives you a list of the other codes.

Having it in the status bar will cause extra disk access when you change folders, which you may not always want (especially on network drives or other slow media). In my own status bar, I make it something I can turn on and off as needed:

// If the folder tab variable "ShowExtraInfo" is set,
//  the line below shows selected/total media duration:
{h!{var:tab:ShowExtraInfo}!{smp3}} {smp3} /{h!}{h!{var:tab:ShowExtraInfo}!{tmp3}} {tmp3} {h!}

I then have this command in the Lister Context menu, so I can right-click the status bar (or file display background; same menu) to toggle the information for the current tab:

@toggle:if $tab:ShowExtraInfo

@if:$tab:ShowExtraInfo
@set tab:ShowExtraInfo
@if:else
@set tab:ShowExtraInfo=on
@if:common
@toggle:update

1 Like

Thanks, Leo. It works just fine.

However suppose I would like the total duration info for each subfolder to be displayed in Duration column inside a tab. Would it be possible to get it displayed there?
Many thanks in advance.

This is great! I was just watching Leo's demo of this at ~ 10:00 in the the Youtube video:
# Part 1/4 - Directory Opus 12.10 Tutorial/Highlights.

Previously, I've been using an app called "PlayTime" by Jody Holmes of SKwire Empire,
but now I'm happy to make use of one more feature of the unrivaled dOpus :muscle:

I've found the specific section of that video and made a link that will queue you up to that spot.

1 Like

Thx @DesertDwarf!

I also noticed that this cool bit of code will give you a summary time for only selected-highlighted videos vs total videos in the folder - like say 6 out of 11 videos for example -
15:44/43:19 - super useful.

1 Like

Leo, I'd like to experiment to have this display all the time - not only as a toggle option - how would I modify that code? (This dOpus functionality is one of the Best for me with all the individual 3 - 10 minute lesson videos I have to study - helps me plan and dedicate a known chunk of time per lesson concept area)

If your other status bar settings are the defaults, you can use this Preset to get that:

Otherwise, this is the code to always display {smp3} selected media duration vs {tmp3} total media duration (while hiding them when not relevant/available):

{h!} {smp3} /{h!}{h!} {tmp3} {h!}

These script columns will show the duration:

Thx Leo - that accomplishes what I wanted in this moment :slight_smile:

and Thx @lxp for the link and your thread -
looks like you invested some time after your original post here, to create some options -
I'm gonna experiment with those columns a little bit as well. :+1:

I've been using Leo's toggle to show/hide the duration of selected or all mp3s in a dir for ages. It has never worked 100% of the time, and I think I recall a post where Jon or Leo acknowledged this, and said the workaround was to restart Opus, and it was actually a Windows issue. Restarting Opus always fixed the issue. I lived with this for ages, no biggie, but now, when I toggle the status bar with...

@set glob:ShowExtraInfo
@if:else
@set glob:ShowExtraInfo=on
@if:common
@toggle:update

The result in the status bar is, 00:00/00:00 regardless of whether I select a file or select nothing. Is some new command or setting on v13 causing this?

You shouldn't need any of that in Opus 13; instead, the status bar duration data won't trigger calculation by itself, but will show that information if something else causes it to be calculated (e.g. turning on the Duration column).

ah yes, I see, so essentially leave the status bar on, and toggle the column, not the status bar display?

Yep. And if you have codes in the status bar config to make things depend on if a variable (glob:ShowExtraInfo) is set, that can be removed.

Thanks Leo, all working swimmingly now, ta

1 Like