Add Total Video Lengths to Root Folders

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Add Total Video Lengths to Root Folders

Postby erk » Tue Aug 11, 2020 4:59 pm

Hi, I have tons of video folders which contains various type videos. I need to add total video lengths to root folders.

Here's an example

Structure:

Folder1
--- File1.mp4
--- File2.mkv
--- File3.avi
---

Folder2
--- Subfolder1
------ File4.mp4
------ File5.mkv
------
--- Subfolder2
------ File6.avi
------ File7.mpeg
---
------
------

After Rename:


Folder1 to Folder1 [4h 26m]
Folder2 to Folder2 [64h 50m]

Is it so impossible?

Thanks for support, best regards.
erk
 
Posts: 3
Joined: Tue Aug 11, 2020 4:44 pm

Re: Add Total Video Lengths to Root Folders

Postby therube » Tue Aug 11, 2020 8:31 pm

Don't think you can do that with BRU.

Would think you could automate something, with ffmpeg (ffprobe.exe).
Get total duration of video files in a directory.

Once you have the total length of a particular directory, store that number in a variable, then use REN.

So say you stored the tot_len in %tot_len, then you could do something like:
REN dirname dirname-%tot_len%
So it might be something like
C:\TMP\VID1\, & tot_len=02.01.00
You'd end up with
C:\TMP\VIDE1-02.01.00\

Similarly, you'd want your batch file loop through a directory tree...

(Devils in the details ;-).)
therube
 
Posts: 1319
Joined: Mon Jan 18, 2016 6:23 pm

Re: Add Total Video Lengths to Root Folders

Postby erk » Sun Aug 16, 2020 10:20 am

Thank you therube.

Actually I had tried that but after your replying I tried again. My problem that I couldn't easily understand script things. Maybe if there's very large project like 10 TB, I try to fiddle.

Now, I found a way. Very gui method :) Q-Dir! This software great works. There's a tutorial about it: https://www.softwareok.com/?page=Windows/Tip/Q-Dir/28

1 - Download, unzip and start Q-Dir portable. Download link: https://www.softwareok.com/?Download=Q-Dir
2 - Navigate the directory
3 - From dropdown menu: Extras > Data size information > Show Q-Dir internal size information
4 - And activate the column length. Move the column next to the name.
5 - Hold down the Ctrl key and and briefly click on the "Length" column with the left mouse button.
6 - MAGIC HAPPENS. It will generate the lengths of audio/video files with sub-directories.
7 - From dropdown menu: File > Export
8 - Exported text is formatted tabbed. You can easily edit any tabbed text editor or spreadsheet. Create a text file formatted like OldFolderName | NewFolderName
9 - Use Bulk Rename Utility. Actions > Import Rename-Pairs. MAGIC HAPPENS.

Thanks all developers for these freeware solutions.
erk
 
Posts: 3
Joined: Tue Aug 11, 2020 4:44 pm

Re: Add Total Video Lengths to Root Folders

Postby erk » Sun Aug 16, 2020 10:29 am

erk wrote:8 - Exported text is formatted tabbed. You can easily edit any tabbed text editor or spreadsheet. Create a text file formatted like OldFolderName | NewFolderName


I want to share regular expression to create pair file. You can use any regular expression supported text editor like Notepad++

Search:
Code: Select all
(.+?)\t(\d\d)?:(\d\d)?\:.+


Replace:
Code: Select all
\1|\1 [\2h \3m]


Note: Please rearrange column in Q-Dir before exporting. Name > Length
erk
 
Posts: 3
Joined: Tue Aug 11, 2020 4:44 pm


Return to BRU Support