PHP code example of mozartk / get-keyframes

1. Go to this page and download the library: Download mozartk/get-keyframes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mozartk / get-keyframes example snippets


// Include your autoload 
\GetKeyFrames;

$info = new GetKeyFrames(); // Initialize your library
$data = $info->getVideoInfo("./samples.mkv"); //load videofiles

print_r($data); //print keyframes result

Array
(
    [frame] => Array
        (
            [0] => 0
            [1] => 1
            [2] => 4
            [3] => 8
            [4] => 250
            [5] => 338
            [6] => 588
            [7] => 838
            [8] => 1088
        )

    [time] => Array
        (
            [0] => 0.000000
            [1] => 0.017000
            [2] => 0.067000
            [3] => 0.133000
            [4] => 4.160000
            [5] => 5.624000
            [6] => 9.784000
            [7] => 13.944000
            [8] => 18.104000
        )

)

ini_set('max_execution_time', -1);