Adding Duration to File Name

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

Adding Duration to File Name

Postby wildtvafrica » Thu Sep 22, 2016 11:51 am

I need to bulk rename video files and need to put the duration of each video into the file name, but I have no idea how to do this.

Can anyone give me an idea of an expression I can use to add it to my file name, please?
wildtvafrica
 
Posts: 2
Joined: Thu Sep 22, 2016 11:41 am

Re: Adding Duration to File Name

Postby therube » Fri Sep 23, 2016 2:35 am

I don't see where it does that?
Does it?

Date, time, EXIF, ID3 tags, but not seeing video?

Suppose you could create a batch file & send the video files to ffprobe, filtering its results, sending that filtered data to a text file, generating a "Rename-pair" that you'd import into BRU (but that would seem to be a somewhat convoluted process)?
therube
 
Posts: 1427
Joined: Mon Jan 18, 2016 6:23 pm

Re: Adding Duration to File Name

Postby wildtvafrica » Fri Sep 23, 2016 8:27 am

therube wrote:I don't see where it does that?
Does it?

Date, time, EXIF, ID3 tags, but not seeing video?

Suppose you could create a batch file & send the video files to ffprobe, filtering its results, sending that filtered data to a text file, generating a "Rename-pair" that you'd import into BRU (but that would seem to be a somewhat convoluted process)?


Thanks for responding. Yeah, that will take forever and I need to do this fast and repeat the process weekly. But I did have someone program a small script for me that just adds the duration to the end of the filename. Very quick and much less painful.
wildtvafrica
 
Posts: 2
Joined: Thu Sep 22, 2016 11:41 am

Re: Adding Duration to File Name

Postby JoshRanch » Fri Oct 06, 2017 3:53 pm

Can you share this script or is it ah ranks thing?
JoshRanch
 
Posts: 3
Joined: Fri Oct 06, 2017 3:45 pm

Re: Adding Duration to File Name

Postby SMazTX » Sat Jul 20, 2024 3:16 pm

You could do it - but would need to use Javascript Renaming (which requires you to purchase a commercial license). Do a search in the help file for System.Media.Duration
SMazTX
 
Posts: 8
Joined: Mon Feb 21, 2022 2:01 pm

Add Duration to videos

Postby Luuk » Sun Jul 21, 2024 12:19 am

First to verify the checkmark for "Renaming Options, ID3/Exif/FileProperties, Extract Windows File Properties".
For spaces on both sides, Add(7) would use < (System.Media.Duration) > to add the duration like " 00-12-30 ".

If needing to insert the duration as some special format, then Add(7) should use <($System.Media.Duration)>.
Then AutoDate(8) should have Mode=None, Fmt==Custom, and a Custom like ' %Hh-%Mm-%Ss ' or ' %Mm-%Ss '
Those two would insert the durations more like..................................... ' 00h-12m-30s ' or ' 12m-30s '.
Luuk
 
Posts: 803
Joined: Fri Feb 21, 2020 10:58 pm


Return to BRU Support