yedincisenol/video-intelligence
Composer 安装命令:
composer require yedincisenol/video-intelligence
包简介
Laravel wrapper for GCloud Video Intelligence PHP client
README 文档
README
Laravel Install
- Add composer
composer require "yedincisenol/video-intelligence"
- Add service provider (For Laravel 5.6 before)
config/app.php
'providers' => [ ... yedincisenol\VideoIntelligence\LaravelServiceProvider::class ],
- Add Facede
config/app.php
'aliases' => [ ... 'VideoIntelligence' => \yedincisenol\VideoIntelligence\LaravelFacede::class ],
- Fill Environments
copy theese parameters to your project .env and fill
VIDEO_INTELLIGENCE_CREDENTIALS_PATH=
How to get credentials file? Visit here
- Laravel Usage
use VideoIntelligence;
VideoIntelligence::annotateVideo(['inputUri' => 'gs://pandora-test/video-1.mp4', 'features' => [1]]);
$operationResponse = VideoIntelligence::annotateVideo(['inputUri' => 'gs://pandora-test/video-1.mp4', 'features' => [1]]);
$operationResponse->pollUntilComplete();
if ($operationResponse->operationSucceeded()) {
$results = $operationResponse->getResult();
foreach ($results->getAnnotationResults() as $result) {
echo 'Segment labels' . PHP_EOL;
foreach ($result->getSegmentLabelAnnotations() as $labelAnnotation) {
echo "Label: " . $labelAnnotation->getEntity()->getDescription()
. PHP_EOL;
}
echo 'Shot labels' . PHP_EOL;
foreach ($result->getShotLabelAnnotations() as $labelAnnotation) {
echo "Label: " . $labelAnnotation->getEntity()->getDescription()
. PHP_EOL;
}
echo 'Frame labels' . PHP_EOL;
foreach ($result->getFrameLabelAnnotations() as $labelAnnotation) {
echo "Label: " . $labelAnnotation->getEntity()->getDescription()
. PHP_EOL;
}
}
} else {
$error = $operationResponse->getError();
echo "error: " . $error->getMessage() . PHP_EOL;
}
For more detail visit here
Label Codes: here
- Publish Config file (Optional)
php artisan vendor:publish --tag=videointelligence
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-09