Get width or height and add it to file's name with PowerShell ? >> FORUM
Forums

Forums



SearchSearch   Users   Registration   Entrance
Today: 18.01.2026 - 12:52:05
Pages:  1  2  

Get width or height and add it to file's name with PowerShell ?

MessageAuthor

Thanks ! In some cases, I may need also the framerate, thus I could edit the file to create a second bat : can you give just the line to be added in the script ? No need to post another bat. Suggestion : if there is nothing after the point, write only what is before, thus for 30.000 FPS, write only 30, but if i's 29.970, write 29.97. In other words, remove everything atfer the last digit which is not a 0, but only after the point of course (if possible), not to have 3 instead of 30. Sorry to be boring :o ;)




Speed

users main


Statistics:
Messages: 15
Registration: 09.06.2001
25.04.24 - 08:38:04
Message # 11
RE: Get width or height and add it to file's name with PowerShell ?

Do you need the frame rate combined with the frame size and scan type in one file name, or do you want a second batch file which only adds the frame rate to the file name? Luckily MediaInfo can report the raw frame rate exactly in the format you want, so this should not be a problem (string formatting is not a strong point of the batch language - it could be done, though). One problem might be if you feed a file with variable frame rate to the batch file. For such VFR files MediaInfo does not report a frame rate at all, it just reports "VFR". There are 2 possible workarounds: 1. Older MediaInfo versions behaved differently, they did report a frame rate for VFR files. Not sure if I can find such an older version, and an older version might have problems with newer formats. 2. AVSMeter also reports frame rates for VFR files. But here I would have to apply some nasty string formatting tricks... Cheers manolito




Virg///M3

users main


Statistics:
Messages: 846
Registration: 09.23.2003
25.04.24 - 08:47:00
Message # 12
RE: Get width or height and add it to file's name with PowerShell ?

I went ahead and made 2 batch files for adding the frame rate to the file name. For now I assumed that you want a separate batch file for the frame rate thing, but of course this can be changed. Download link: First of all my assumption that MediaInfo can already manage the string format to your needs was wrong. The documentation is incorrect. So I had to apply my nasty batch file tricks, wasn't so hard after all. The first method is to use the older MediaInfo version 0.7.58 which still reports fps values for VFR sources. It is from 2012, so I am not sure how modern formats like HEVC are handled. Of course you can also try this batch file with a current MediaInfo version, but then you will not get any fps value for VFR sources. The other method uses AVSMeter to determine the frame rate. Of course this requires that you have AviSynth installed on your computer. The DSS2 source filter must also be installed in the "AviSynth\Plugins" folder. Cheers manolito




Justin(OKC)

users main


Statistics:
Messages: 55
Registration: 01.27.2002
25.04.24 - 08:57:45
Message # 13
RE: Get width or height and add it to file's name with PowerShell ?

Only if the container is not MKV. Have a look at this little dispute I had with Zenitram a while ago: Anyways, the new version is ready for download: Have fun manolito


---------------------------------------------
Mods: TCK d/a Coilovers, RG4 Monolites wrapped in 273/30/19 Dunlop SP Sport Maxx, Dinan Exhaust, Dinan 3.91 LSD, Dinan Rear Strut Brace, Turner Rear Sub-Frame Reinforcement Kit, Brembo GT 4 Wheel Kit. reaktorcorps...since last thursday The Photograph

truth

users main


Statistics:
Messages: 193
Registration: 06.19.2003
25.04.24 - 09:02:19
Message # 14
RE: Get width or height and add it to file's name with PowerShell ?

Great, thanks ! I see that you didn't put this line ; Code:




Carrerax

users main


Statistics:
Messages: 40
Registration: 08.22.2003
25.04.24 - 09:09:13
Message # 15
RE: Get width or height and add it to file's name with PowerShell ?
HP & Compaq AMD 64 Notebooks : Previous topicNext topic: post production plugins
Pages:  1  2  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants