Mediainfo Bitrate number formate

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
DarKHawK
Posts: 17
Joined: 25 Nov 2012 04:55

Mediainfo Bitrate number formate

Post by DarKHawK »

Hi,

Using this script to get the bitrate of video files:

Code: Select all

$round = 1;
    $div = ".";
    $mediaInfo = "C:\MediaInfo\MediaInfo.exe";
 $length = regexreplace(runret("$mediaInfo --Inform=Video;%BitRate% ""<cc_item>"""), "\n");
 return $length;
It returns a lot of zeros.

And using:

Code: Select all

Video;%BitRate/String%
The numbers have a space instead of decimal point so it can't be sorted correctly.
Image

So how do I divide Video;%BitRate% by a 1000 or remove the space from Video;%BitRate/String%

Thank you.

jupe
Posts: 3446
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Mediainfo Bitrate number formate

Post by jupe »

Here is one way,

Code: Select all

 $length = regexreplace(regexreplace(runret("$mediaInfo --Inform=Video;%BitRate/String% ""<cc_item>"""), "\r\n"), "(\d) (\d)", "$1$2");

highend
Posts: 14926
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Mediainfo Bitrate number formate

Post by highend »

Code: Select all

    $mediaInfo = "C:\MediaInfo\MediaInfo.exe";
    return regexreplace(replace(runret("$mediaInfo --Inform=Video;%BitRate/String% ""<cc_item>"""), <crlf>), "[ \t](?=\d)");
One of my scripts helped you out? Please donate via Paypal

DarKHawK
Posts: 17
Joined: 25 Nov 2012 04:55

Re: Mediainfo Bitrate number formate

Post by DarKHawK »

Thank You

Post Reply