Sum the length for selected video files at the state line. Is it possible?
Moderators: Hacker, petermad, Stefan2, white
-
- Junior Member
- Posts: 6
- Joined: 2024-02-29, 12:54 UTC
Sum the length for selected video files at the state line. Is it possible?
Hello.
Is it possible to configure TC to sum the length for selected video files and display it at the "state line" (near file size) ?
Here:
Image: https://i.postimg.cc/7L6RBD75/TC-issue.jpg
Is it possible to configure TC to sum the length for selected video files and display it at the "state line" (near file size) ?
Here:
Image: https://i.postimg.cc/7L6RBD75/TC-issue.jpg
Re: Sum the length for selected video files at the state line. Is it possible?
No, it's not and this has been discussed before. Use a plugin like MediaTime in conjunction with a custom columns view to get the total runtime of files within a directory. To get only the runtime of some of these files you could copy or hardlink them into a separate directory.
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
-
- Junior Member
- Posts: 6
- Joined: 2024-02-29, 12:54 UTC
Re: Sum the length for selected video files at the state line. Is it possible?
It is possible to determine the total time of media files (e.g. 3gp|asf|avi|mkv|mov|mp3|mp4|mpg|wma|wmv|vob)
by clicking a button - in a separate window(!) - not in the footer.
The following is required for this:
by clicking a button - in a separate window(!) - not in the footer.
The following is required for this:
- .vbs file from user Fla$her
- Save the file e.g. under the following name: CalculatingTheTotalDurationOfSelectedMediaFiles.vbs
- Then drag the .vbs file into the button bar
- Add the following to the "Parameters" field:
Code: Select all
%WL 3gp|asf|avi|mkv|mov|mp3|mp4|mpg|wma|wmv|vob
- Option: Overwrite the entry in the "Icon file" field as follows:
shell32.dll ... and select e.g. no. 118 as icon ... - Add the following to the Tooltip field:
Code: Select all
CalculatingTheTotalDurationOfSelectedMediaFiles.vbs - Fla$her|Parameter: %WL 3gp||asf||avi||mkv<||mov||mp3||mp4||mpg||wma||wmv||vob|/c = copy the result to the clipboard|https://www.ghisler.ch/board/viewtopic.php?p=446565#p446565
- As already mentioned by user Dalai, install the Total Commander plugin MediaTime
by double-clicking *in Total Commander(!)* on the file "wdx_MediaTime_1.1.rar".- Position the cursor on a video file and hold down the Ctrl key
- Right-click on any column header and release the Ctrl key
- Select the menu item "Configure this custom columns view..."
- Click on the "Add column" button
- Enter the following:
Name: Duration (1 level)
Width: 65
Field content: [=mediatime.Duration (1 level)] - Click on the "Apply" button and then on "OK"
- The "Duration (1 level)" column shows the "Duration" of media files.
- Mark all media files e.g. with the command: cm_ExchangeSelBoth or only individual files
- Click on the button with the command: Path\to\CalculatingTheTotalDurationOfSelectedMediaFiles.vbs
- The total duration is displayed --> Important note: Always make sure that e.g. only video files are selected,
because if there are .mp3 files among them, these would be included in the total runtime,
due to the parameter setting: 3gp|asf|avi|mkv|mov|mp3|mp4|mpg|wma|wmv|vob - Option: The total duration which is displayed in the separate window with the title "Total duration of selected media files"
can be transferred to the clipboard using the "Textify" tool.
-
- Junior Member
- Posts: 6
- Joined: 2024-02-29, 12:54 UTC
Re: Sum the length for selected video files at the state line. Is it possible?
2Sergio Leone
I would also like to add that the use of a "Custom columns view" is OPTIONAL (see point 2. above).
It would be sufficient to call the vb script via button to determine the total playing time.
In my opinion, however, the creation of a "Custom columns view" is highly recommended.
If you want to restore your previous view afterwards, I recommend using the button below.
The explanations of the individual commands can be found in the command browser
[button with command: cm_CommandBrowser] or in the "HISTORY.TXT" file.
Windows 11 Pro (x64) Version 23H2 (OS Build 22631.3235) | TC 11.03 x64/x86
Overview: View Mode | Auto Switch Mode | Custom columns view
I would also like to add that the use of a "Custom columns view" is OPTIONAL (see point 2. above).
It would be sufficient to call the vb script via button to determine the total playing time.
In my opinion, however, the creation of a "Custom columns view" is highly recommended.
If you want to restore your previous view afterwards, I recommend using the button below.
The explanations of the individual commands can be found in the command browser
[button with command: cm_CommandBrowser] or in the "HISTORY.TXT" file.
BUTTON - View mode <default>
Configuration > Options... > View mode > <Default>
- Columns view: Full
- Sort order: Name
- Columns view: Full
- Sort order: Name
Code: Select all
TOTALCMD#BAR#DATA
cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_RereadSource,cm_rereadsource 1,cm_rereadsource 2,cm_rereadsource 3
wcmicons.dll,86
cm_SrcViewMode0,cm_SrcAllFiles,cm_50Percent,cm_RereadSource,cm_rereadsource 1,2,3|View mode <Default>: cm_SrcViewMode0|Active panel!|-|cm_RereadSource Ctrl+R|-|cm_rereadsource 1 )|cm_rereadsource 2 )|cm_rereadsource 3 ) --> see: HISTORY.TXT!
-1
Create a Button in the Buttonbar (copy/paste CODE)
- Click on "SELECT ALL" (to the right of CODE:), then press CTRL+C (copy to clipboard).
- Right-click on any place in the button bar, then click on "Paste".
⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺⸺ - Option1: Point to the new button (slightly longer): 'Tooltip' is shown (-> description to the button).
A maximum of 259 characters is allowed for the tooltip. | = create line break, || = create | as separator character. - Option2: Button bar - "Tooltip" field: A single space deactivates the display of the tooltip.
If the "Tooltip" field is empty, the content of the "Command" field is displayed. - Option3: See FAQs and explanation: Button-code (TOTALCMD#BAR#DATA) <-- <Ctrl+click on the link...>
Windows 11 Pro (x64) Version 23H2 (OS Build 22631.3235) | TC 11.03 x64/x86
Overview: View Mode | Auto Switch Mode | Custom columns view
-
- Junior Member
- Posts: 6
- Joined: 2024-02-29, 12:54 UTC
Re: Sum the length for selected video files at the state line. Is it possible?
2tuska, thanks.
I've done accordingly to your advices both variants - works great. More over, I've assigned Ctrl+i hotkey on VBS script calling, now it's much more convenient.
Previously for video length calculation i'd been using Alt+Enter --> Details - and it takes more time.
Found one issue with script: if do Ctrl+B (show all files from directories), select some videos and than calling a script it doesn't work. Got an error.
I've done accordingly to your advices both variants - works great. More over, I've assigned Ctrl+i hotkey on VBS script calling, now it's much more convenient.
Previously for video length calculation i'd been using Alt+Enter --> Details - and it takes more time.
Found one issue with script: if do Ctrl+B (show all files from directories), select some videos and than calling a script it doesn't work. Got an error.
Re: Sum the length for selected video files at the state line. Is it possible?
I'm glad it worked out.Sergio Leone wrote: 2024-03-01, 06:35 UTC 2tuska, thanks.
I've done accordingly to your advices both variants - works great.
More over, I've assigned Ctrl+i hotkey on VBS script calling, now it's much more convenient.

Mmh, I did not experience this behaviour with Branch View (With Subdirs) - Ctrl+B.Sergio Leone wrote: 2024-03-01, 06:35 UTC Found one issue with script: if do Ctrl+B (show all files from directories),
select some videos and than calling a script it doesn't work. Got an error.
I would try it again with other directories.
[If the error still occurs, the script author may be able to help you].
Re: Sum the length for selected video files at the state line. Is it possible?
Why, if it's easier to remove '|mp3' and '|wma' from the parameters?tuska wrote: 2024-02-29, 14:34 UTC 5. The total duration is displayed --> Important note: Always make sure that e.g. only video files are selected,
because if there are .mp3 files among them, these would be included in the total runtime,
due to the parameter setting: 3gp|asf|avi|mkv|mov|mp3|mp4|mpg|wma|wmv|vob
This is just an example. Everyone can change the extension list as they want, as long as the codecs are in place.
There is also an option without coders, but with MediaInfoActiveX.dll. For those who need it, I can give a solution with this component.
Why, if there is already a /c key?tuska wrote: 2024-02-29, 14:34 UTC 6. Option: The total duration which is displayed in the separate window with the title "Total duration of selected media files"
can be transferred to the clipboard using the "Textify" tool.
Copy it in this window by Ctrl+C and paste it here.
Overquoting is evil! 👎
-
- Junior Member
- Posts: 6
- Joined: 2024-02-29, 12:54 UTC
Re: Sum the length for selected video files at the state line. Is it possible?
2Fla$her screenshot
https://ibb.co/XJ8Jc5w
translation:
.....
string: 23
symbol: 4
Error: overflow '[string 769564]'
cod: 800A006
....
https://ibb.co/XJ8Jc5w
translation:
.....
string: 23
symbol: 4
Error: overflow '[string 769564]'
cod: 800A006
....
Re: Sum the length for selected video files at the state line. Is it possible?
2Sergio Leone
The point is not Ctrl+B, but that the 3rd TimeSerial parameter cannot accept a number greater than 2¹⁵-1.
I've come across this before, but then I forgot.
The point is not Ctrl+B, but that the 3rd TimeSerial parameter cannot accept a number greater than 2¹⁵-1.
I've come across this before, but then I forgot.
Fixed:
Code: Select all
'—————————————————————————————— VBS —————————————————————————————
' Purpose: Calculating the total duration of selected media files
' Parameters: %WL <filter extensions via |> [/c]
' /c — copy the result to the clipboard instead of displaying
' Example: %WL 3gp|asf|avi|mkv|mov|mp3|mp4|mpg|wma|wmv|vob /c
'————————————————————————————————————————————————————————————————
Option Explicit: Dim A, oDesk, oFSO, oList, F, Dur
Const Title = " Total duration of selected media files"
Set A = WSH.Arguments: If A.Count = 0 Then WSH.Quit
Set oDesk = CreateObject("Shell.Application").NameSpace(0)
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oList = oFSO.OpenTextFile(A(0),,,-1)
Do: F = oList.ReadLine
If Right(F, 1) <> "\" Then _
If InStr(1, "|" & A(1) & "|", "|" & oFSO.GetExtensionName(F) & "|", 1) Then _
Dur = Dur + CDbl(oDesk.ParseName(F).ExtendedProperty("Duration"))
Loop Until oList.AtEndOfStream: oList.Close
Set oList = Nothing: Set oDesk = Nothing: Set oFSO = Nothing
If IsEmpty(Dur) Then
MsgBox "There are no suitable media files!", 262192, Title
Else
Dur = Duration(FormatNumber(CDbl(Dur/10000000), 0))
If A.Named.Exists("c") Then
With CreateObject("WScript.Shell")
If .Run("%ComSpec% /q/c <nul set /p=""" & Dur & """|clip", 0, 1) Then _
.Run "mshta ""javascript:close(clipboardData.setData('text','" & Dur & "'))""", 7
End With
Else MsgBox Space(14) & Dur, 262208, Title End If
End If
Function Duration(V)
If V < 32768 Then
Duration = Right("0" & TimeSerial(0, 0, V), 8)
Else
Dim D, H1, H, M1, M, S
D = Int(V/86400) : H1 = V - D * 86400
H = Int(H1/3600) : M1 = H1 - H * 3600
M = Int(M1/60) : S = M1 - M * 60
If D = 0 Then D = "" Else _
If D = 1 Then D = D & " day " Else D = D & " days "
Duration = D & Right("0" & TimeSerial(H, M, S), 8)
End If
End Function
Overquoting is evil! 👎
-
- Junior Member
- Posts: 6
- Joined: 2024-02-29, 12:54 UTC
Re: Sum the length for selected video files at the state line. Is it possible?
2Fla$her, works excelent. Thank you!