Based on the script by
klownboy, I was playing with other MediaInfo parameters and noticed something strange:
Code: Select all
// Let MediaInfo tell the bit rate of the video, send the output to clipboard
run "cmd /c D:\MediaInfo\MediaInfo.exe --Output=Video;%BitRate% ""<cc_item>"" | clip", , 2, 0;
$output = substr("<clipboard>", 0, -1); // get rid of the line ending
echo $output; // I get the correct value (in bps, but the unit is not part of the output)
echo $output / 1024; // I get 0
echo $output + 333; // I get 333
// So for some reason, whenever doing any sort of math with $output, it is evaluated as 0, but echo $output alone gives the right result
echo floor($output) / 1024; // This fixed the problem, round() worked as well, probably ceil() too...
return round(round($output) / 1024); // OK
echo $output;works fine, but not
echo $output + 333;? What is in $output exactly? It doesn't look like having any decimal places based on the echo result, yet the fact that it requires round() or floor() in order to behave properly in math also indicates that it isn't an integer either. So what exactly is this thing?
XYplorer Beta Club
