json2video/json2video-php-sdk
Composer 安装命令:
composer require json2video/json2video-php-sdk
包简介
PHP SDK for JSON2Video API: Create videos programmatically
README 文档
README
Note: Updated for API v2.0
Create videos programmatically in PHP
Create and edit videos: add watermarks, resize videos, create slideshows, add soundtrack, automate the creation of videos in multiple languages, add voice-over, add text animations.
JSON2Video is a video editing API that simplifies creating, editing and customising videos programmatically. Its dead simple approach, close to the web development mindset, makes it the ultimate solution for developers that want to create or customise videos in an automated way.
Additionally, the simple integration of real HTML5+CSS elements, the already built-in text animations and voice generation (TTS) converts JSON2Video in the best solution in its category.
Use cases
- Automate the production of promotional videos for your e-commerce products
- Automate publication of social media videos created directly from your news feed
- Customize your advertising campaigns with different images, videos, texts and create tens or hundreds of different options
- From weather forecasts to traffic bulletins or financial reports, if you have a data source you can create an audiovisual experience
- Convert your text, pictures and information into engaging videos of your real estate properties
- Add watermarks, bumpers, titles; Concatenate different videos into one; Add voice-over or music; Create photo slideshows; …
Get your FREE API Key
JSON2Video is free to use. Get your API Key at JSON2Video.com
Documentation
The API Specification will provide you with all the details of the JSON payload and the endpoints.
For a step by step guide, read the Tutorial that will introduce you through all features with code examples.
PHP SDK installation
You can use JSON2Video PHP SDK as a Composer package or with a simple require_once.
Using require_once
The simplest way :-)
- Download all.php from the /bundled folder into your project directory
- Import the library:
<?php require_once 'path/to/the/sdk/all.php'; use JSON2Video\Movie; use JSON2Video\Scene;
Using Composer
The SDK has no external dependencies on other packages.
- Open the terminal and cd to your project directory
- Use composer:
composer require json2video/json2video-php-sdk
Hello world
JSON2Video makes video creation easy as a piece of cake:
<?php require 'vendor/autoload.php'; use JSON2Video\Movie; use JSON2Video\Scene; // Create a new movie $movie = new Movie; // Set your API key // Get your free API key at https://json2video.com $movie->setAPIKey(YOUR_API_KEY); // Set movie quality: low, medium, high $movie->quality = 'high'; $movie->draft = true; // Create a new scene $scene = new Scene; // Set the scene background color $scene->background_color = '#4392F1'; // Add a text element printing "Hello world" in a fancy way (basic/006) // The element is 10 seconds long and starts 2 seconds from the scene start // Element's vertical position is 50 pixels from the top $scene->addElement([ 'type' => 'text', 'style' => '003', 'text' => 'Hello world', 'duration' => 10, 'start' => 2 ]); // Add the scene to the movie $movie->addScene($scene); // Call the API and start rendering the movie $result = $movie->render(); var_dump($result); //$result = $movie->getStatus('cLiLZ7fKeMvjb4b8'); //var_dump($result); // Wait for the render to finish $movie->waitToFinish(); ?>
This is the resulting video:
json2video/json2video-php-sdk 适用场景与选型建议
json2video/json2video-php-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.51k 次下载、GitHub Stars 达 27, 最近一次更新时间为 2021 年 12 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 json2video/json2video-php-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 json2video/json2video-php-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 29
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-09