Page 1 of 1

Trick to stop truncated decimal numbers via runret() of mediainfo

Posted: 12 Sep 2025 00:51
by arazi89
Hello,

Using simple scripting for a Custom Column (derived from a highend post from a while ago):

$mediaInfo = "C:\Program Files\MediaInfo_CLI\MediaInfo.exe";
$info = regexreplace(runret("$mediaInfo --Inform=Video;%DisplayAspectRatio% ""<cc_item>"""), "\.\d*\r?\n");
return $info;


The above simple script being used multiple times, altered for multiple different data fields returned to multiple different Custom Columns. For video files, most fields are returning just fine via the script for their Custom Column. But two of the fields are not: Video;%DisplayAspectRatio% and General;%FrameRate% . Both of these are decimal numbers that return just fine running mediainfo from the Windows cmd prompt. But via the Custom Column scripting %DisplayAspectRatio% is truncated from 1.777 to 1 And General;%FrameRate% is truncated from 23.976 to 23

Ideally, in the script, I need the full 1.777 Display aspect ratio (decimal number) to use in a calculation with the Video;%Height% value in order to calculate a custom DISPLAY WIDTH column. That is the ultimate goal.

QUESTION: What is the latest trick/workaround to get decimal numbers -- returned from anywhere, but in this specific case from mediainfo --- into a xyplorer script variable so it can be used as a decimal number in a calculation?

Thank you!

Re: Trick to stop truncated decimal numbers via runret() of mediainfo

Posted: 12 Sep 2025 06:58
by highend
Then remove the \.\d* part?

Re: Trick to stop truncated decimal numbers via runret() of mediainfo

Posted: 13 Sep 2025 02:01
by arazi89
highend wrote: 12 Sep 2025 06:58 Then remove the \.\d* part?
Thank you so very much.

I had tried it entirely without the regexreplace() and that didn't change the output. So, I had moved off that trail too early.

Thank you!

Re: Trick to stop truncated decimal numbers via runret() of mediainfo

Posted: 13 Sep 2025 09:50
by admin
"XYplorer 27.10.0800 LLP" ... LLP? Live Long & Prosper? :biggrin:

Re: Trick to stop truncated decimal numbers via runret() of mediainfo

Posted: 14 Sep 2025 02:00
by arazi89
admin wrote: 13 Sep 2025 09:50 "XYplorer 27.10.0800 LLP" ... LLP? Live Long & Prosper? :biggrin:
That's a nice thought, at least! I'm an active 'modest' level Thoroughbred trainer. So with any luck I may stay healthy enough to get half of that.