Page 1 of 1
Adding Duration to File Name

Posted:
Thu Sep 22, 2016 11:51 am
by wildtvafrica
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?
Re: Adding Duration to File Name

Posted:
Fri Sep 23, 2016 2:35 am
by therube
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)?
Re: Adding Duration to File Name

Posted:
Fri Sep 23, 2016 8:27 am
by wildtvafrica
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.
Re: Adding Duration to File Name

Posted:
Fri Oct 06, 2017 3:53 pm
by JoshRanch
Can you share this script or is it ah ranks thing?
Re: Adding Duration to File Name

Posted:
Sat Jul 20, 2024 3:16 pm
by SMazTX
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
Add Duration to videos

Posted:
Sun Jul 21, 2024 12:19 am
by Luuk
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 '.