Return the bit rate of the video in bits per second.

NOTE: This only works for files with constant bit rate.

@return int
321097
public function getVideoBitRate()
    {
        if ($this->videoBitRate === null) {
            $match = [];
            preg_match(self::$REGEX_VIDEO_BITRATE, $this->output, $match);
            $this->videoBitRate = (int)(array_key_exists(1, $match) ? ($match[1] * 1000) : 0);
        }

        return $this->videoBitRate;
    }
777313
public function next()
    {
        do {

            if($this->bit == -1) {
                $this->bit = 0;
                return array('x'=>$this->x, 'y'=>$this->y);
            }

            $x = $this->x;
            $y = $this->y;
            $w = $this->width;

            if($this->bit == 0) {
                $x--;
                $this->bit++;
            } else {
                $x++;
                $y += $this->dir;
                $this->bit--;
            }

            if($this->dir < 0) {
                if($y < 0) {
                    $y = 0;
                    $x -= 2;
                    $this->dir = 1;
                    if($x == 6) {
                        $x--;
                        $y = 9;
                    }
                }
            } else {
                if($y == $w) {
                    $y = $w - 1;
                    $x -= 2;
                    $this->dir = -1;
                    if($x == 6) {
                        $x--;
                        $y -= 8;
                    }
                }
            }
            if($x < 0 || $y < 0) return null;

            $this->x = $x;
            $this->y = $y;

        } while(ord($this->frame[$y][$x]) & 0x80);

        return array('x'=>$x, 'y'=>$y);
    }
122936
public function getTaxRate()
    {
        $rate = 0;
        $obj = $this->getTaxFromCategory();

        if ($obj) {
            $rate = $obj->Rate;
        }

        $this->extend("updateTaxRate", $rate);

        return $rate;
    }
1164120
public static function bitrate ($bitrate, $unit = '')
		{
			if (is_numeric($bitrate) and $bitrate >= 0)
			{
				if (( !$unit && $bitrate >= 1000000 ) || $unit == 'mb/s')
					return round($bitrate / ( 1000000 )) . ' mb/s';
				elseif (( !$unit && $bitrate >= 1000 ) || $unit == 'kb/s')
					return round($bitrate / ( 1000 )) . ' kb/s';

				return round($bitrate) . ' b/s';
			}

			return null;
		}
695184
public function getTotalMillis() : int
    {
        $millis = $this->seconds * 1000;
        $millis += \intdiv($this->nanos, 1000000);

        return $millis;
    }
373371
public function getFrameCount()
    {
        if ($this->frameCount === null) {
            $this->frameCount = (int)($this->getDuration() * $this->getFrameRate());
        }

        return $this->frameCount;
    }
1246338
public function speed() {
		static $tick, $iteration = 0, $speed = 0;

		if (!$this->_start) {
			return 0;
		} else if (!$tick) {
			$tick = $this->_start;
		}

		$now = microtime(true);
		$span = $now - $tick;
		if ($span > 1) {
			$iteration++;
			$tick = $now;
			$speed = ($this->_current / $iteration) / $span;
		}

		return $speed;
	}
1327930
public Integer[] getSupportedFrameRates() {
		AVRational frameRates = avCodec.supported_framerates();

		if (getType() != MediaType.VIDEO || frameRates == null)
			return null;

		List<Integer> rates = new ArrayList<Integer>();

		AVRational frameRate;
		int index = 0;
		while ((frameRate = frameRates.position(index++)) != null)
			rates.add((int) av_q2d(frameRate));

		// ascending order
		Collections.sort(rates);

		return rates.toArray(new Integer[0]);
	}
738721
public int frameSize() {
        switch (layerDescription) {
            case 3:
                // Layer 1
                return (12 * getBitRate() / getSampleRate() + (paddingBit ? 1 : 0)) * 4;
            case 2:
            case 1:
                // Layer 2 and 3
                if (audioVersionId == 3) {
                    // MPEG 1
                    return 144 * getBitRate() / getSampleRate() + (paddingBit ? 1 : 0);
                } else {
                    // MPEG 2 or 2.5
                    return 72 * getBitRate() / getSampleRate() + (paddingBit ? 1 : 0);
                }
            default:
                // Unknown
                return -1;
        }
    }
1059982
protected function _getNextCode()
    {
        if ($this->_bytePointer == $this->_dataLength) {
            return 257;
        }

        $this->_nextData = ($this->_nextData << 8) | (ord($this->_data[$this->_bytePointer++]) & 0xff);
        $this->_nextBits += 8;

        if ($this->_nextBits < $this->_bitsToGet) {
            $this->_nextData = ($this->_nextData << 8) | (ord($this->_data[$this->_bytePointer++]) & 0xff);
            $this->_nextBits += 8;
        }

        $code = ($this->_nextData >> ($this->_nextBits - $this->_bitsToGet)) & $this->_andTable[$this->_bitsToGet-9];
        $this->_nextBits -= $this->_bitsToGet;

        return $code;
    }
566142
private int findBitRate(int bitrateIndex, int version, int layer)
	{
		int ind = -1;

		if (version == MPEG_V_1)
		{
			if (layer == MPEG_L_1)
			{
				ind = 0;
			}
			else if (layer == MPEG_L_2)
			{
				ind = 1;
			}
			else if (layer == MPEG_L_3)
			{
				ind = 2;
			}
		}
		else if ((version == MPEG_V_2) || (version == MPEG_V_25))
		{
			if (layer == MPEG_L_1)
			{
				ind = 3;
			}
			else if ((layer == MPEG_L_2) || (layer == MPEG_L_3))
			{
				ind = 4;
			}
		}

		if ((ind != -1) && (bitrateIndex >= 0) && (bitrateIndex <= 15))
		{
			return bitrateTable[bitrateIndex][ind];
		}
		return -1;
	}
420373
public function castByte()
    {
        $min = self::BYTE_MIN_VALUE;
        $max = self::BYTE_MAX_VALUE;

        $castFunction = function ($value) use ($min, $max) {
            return $value < 0 ? $min : $max;
        };

        if (is_numeric($this->value) && $this->value >= $min && $this->value <= $max) {
            return $this->value;
        }

        return $this->handleMismatch($castFunction, 'byte');
    }
965467
public function getDuration()
    {
        if (!isset($this->data['events']['__section__'])) {
            return 0;
        }

        $lastEvent = $this->data['events']['__section__'];

        return $lastEvent->getOrigin() + $lastEvent->getDuration() - $this->getStartTime();
    }
895551
public int bitrate()
	{
		if (h_vbr == true)
		{
			return ((int) ((h_vbr_bytes * 8) / (ms_per_frame() * h_vbr_frames)))*1000;		
		}
		else
		{
			if (h_layer<=0)
				return 0;
			else
				return bitrates[h_version][h_layer - 1][h_bitrate_index];
		}
	}
310447
public function getDuration(): float {
        return $this->duration ? $this->duration : microtime(true) - $this->startTime;
    }
323587
public function getMicroseconds() {
        try {
            $t = microtime(true);
            $micro = sprintf("%06d",($t - floor($t)) * 1000000);
            return intval($micro);
        }  catch (\Exception $e){
            die($e);
        }    
    }
996819
public function getAudioBitRate()
    {
        if ($this->audioBitRate === null) {
            $match = [];
            preg_match(self::$REGEX_AUDIO_BITRATE, $this->output, $match);
            $this->audioBitRate = (int)(array_key_exists(1, $match) ? ($match[1] * 1000) : 0);
        }

        return $this->audioBitRate;
    }