Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Qencode-Corp/qencode-api-php-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.04
Choose a base ref
...
head repository: Qencode-Corp/qencode-api-php-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 24, 2020

  1. Copy the full SHA
    b0d7970 View commit details

Commits on Sep 29, 2020

  1. Add metadata

    geroddokar committed Sep 29, 2020
    Copy the full SHA
    5f0d762 View commit details
  2. Copy the full SHA
    41233ca View commit details
  3. Metadata updates

    static functions: get_video_dimensions, get_bitrate, get_framerate, get_duration
    qencode-dev committed Sep 29, 2020
    Copy the full SHA
    f454fcd View commit details
  4. Copy the full SHA
    b9b4af6 View commit details

Commits on Jan 14, 2021

  1. Metadata: fix for php5

    qencode-dev committed Jan 14, 2021
    Copy the full SHA
    8ca2f6a View commit details
  2. updated version in readme

    qencode-dev committed Jan 14, 2021
    Copy the full SHA
    8035050 View commit details
  3. Metadata: fix for PHP5

    qencode-dev committed Jan 14, 2021
    Copy the full SHA
    2ed5b7e View commit details

Commits on Apr 25, 2022

  1. change source video

    RootBA committed Apr 25, 2022
    Copy the full SHA
    76c0268 View commit details

Commits on Feb 21, 2023

  1. Copy the full SHA
    9af3de2 View commit details
  2. Copy the full SHA
    127b71e View commit details
  3. Copy the full SHA
    0962b43 View commit details

Commits on May 26, 2023

  1. fix curl http params

    RootBA committed May 26, 2023
    Copy the full SHA
    efd1c19 View commit details
  2. Copy the full SHA
    7f828b2 View commit details

Commits on Jun 30, 2023

  1. Copy the full SHA
    73d8cd4 View commit details

Commits on Jul 3, 2023

  1. Merge pull request #8 from qencode-dev/dev-2023-05-25-alex-gcp-fix

    Dev 2023 05 25 alex gcp fix
    RootBA authored Jul 3, 2023
    Copy the full SHA
    f939138 View commit details

Commits on Sep 18, 2023

  1. Copy the full SHA
    1206bdd View commit details

Commits on Nov 15, 2023

  1. Fixed CURL options

    qencode-dev committed Nov 15, 2023
    Copy the full SHA
    193c9bc View commit details
  2. Copy the full SHA
    eabee08 View commit details
  3. updated version

    qencode-dev committed Nov 15, 2023
    Copy the full SHA
    23e0ea8 View commit details

Commits on Jan 15, 2024

  1. Copy the full SHA
    68e496d View commit details
  2. Copy the full SHA
    ed8e8cf View commit details
  3. Copy the full SHA
    addc986 View commit details

Commits on Jan 16, 2024

  1. fix for getting status

    qencode-dev committed Jan 16, 2024
    Copy the full SHA
    479d42f View commit details
  2. Copy the full SHA
    e57b2d1 View commit details
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ PHP library for interacting with the Qencode API.
```json
{
"require": {
"qencode/api-client": "1.03.*"
"qencode/api-client": "1.13.*"
}
}
```
1 change: 1 addition & 0 deletions autoload.php
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
"Classes/Destination.php",
"Classes/Format.php",
"Classes/Stream.php",
"Classes/Metadata.php",
"Classes/VideoCodecParameters.php",
"QencodeApiClient.php",
);
49 changes: 49 additions & 0 deletions examples/get_metadata.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
require_once __DIR__ . '/../autoload.php';

use Qencode\Exceptions\QencodeApiException;
use Qencode\Exceptions\QencodeClientException;
use Qencode\Exceptions\QencodeException;
use Qencode\QencodeApiClient;
use Qencode\Classes\Metadata;

// Replace this with your API key
$apiKey = '1234567890123';
$video_url = 'https://nyc3.s3.qencode.com/qencode/bbb_30s.mp4';

$q = new QencodeApiClient($apiKey);

try {
log_message('Getting metadata for: '.$video_url.' ...');
$video_info = $q->getMetadata($video_url);

list($width, $height) = Metadata::get_video_dimensions($video_info);
log_message('width, px: '.$width);
log_message('height, px: '.$height);

$bitrate = Metadata::get_bitrate($video_info);
log_message('bitrate, b/s: '.$bitrate);

$framerate = Metadata::get_framerate($video_info);
log_message('framerate, fps: '.$framerate);

$duration = Metadata::get_duration($video_info);
log_message('duration, sec: '.$duration);

echo "DONE!";

} catch (QencodeClientException $e) {
// We got some inconsistent state in client application (e.g. task_token not found when requesting status)
log_message('Qencode Client Exception: ' . $e->getCode() . ' ' . $e->getMessage());
} catch (QencodeApiException $e) {
// API response status code was not successful
log_message('Qencode API Exception: ' . $e->getCode() . ' ' . $e->getMessage());
} catch (QencodeException $e) {
// API call failed
log_message('Qencode Exception: ' . $e->getMessage());
var_export($q->getLastResponseRaw());
}

function log_message($msg) {
echo $msg."\n";
}
28 changes: 28 additions & 0 deletions examples/get_status.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
require_once __DIR__ . '/../autoload.php';

use Qencode\Exceptions\QencodeApiException;
use Qencode\Exceptions\QencodeException;
use Qencode\QencodeApiClient;
use Qencode\Classes\TranscodingTask;

//This example gets task status from main api endpoint (api.qencode.com)

$api_endpoint = 'https://api.qencode.com';
//replace with your api key
$apiKey = 'acbde123456';
//replace with your task token value
$task_token = 'fd17cc37c84f1233c0f62d6abcde123';
$status_url = $api_endpoint.'/v1/status';
$q = new QencodeApiClient($apiKey, $api_endpoint);

$params = array('task_tokens[]' => $task_token);
$response = $q->post($status_url, $params);
$status = $response['statuses'][$task_token];
if ($status == null) {
throw new QencodeClientException('Task '. $task_token. ' not found!');
}
if (array_key_exists('status_url', $status)) {
$status_url = $status['status_url'];
}
print_r($status);
64 changes: 0 additions & 64 deletions examples/start_encode.php

This file was deleted.

3 changes: 2 additions & 1 deletion examples/start_encode2.php
Original file line number Diff line number Diff line change
@@ -13,7 +13,8 @@

// Replace this with your API key
$apiKey = '12345678';
$video_url = 'https://qa.qencode.com/static/1.mp4';
//$video_url = 'https://qa.qencode.com/static/1.mp4';
$video_url = 'https://nyc3.s3.qencode.com/qencode/bbb_30s.mp4';

$q = new QencodeApiClient($apiKey);

5 changes: 3 additions & 2 deletions examples/start_encode2_json.php
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@
$apiKey = '12345678';
$params = '
{"query": {
"source": "https://qa.qencode.com/static/timer.mp4",
"source": "https://nyc3.s3.qencode.com/qencode/bbb_30s.mp4",
"encoder_version": 2,
"format": [
{
"output": "mp4",
@@ -62,4 +63,4 @@

function log_message($msg) {
echo $msg."\n";
}
}
85 changes: 0 additions & 85 deletions examples/start_encode2_stitch.php

This file was deleted.

62 changes: 0 additions & 62 deletions examples/start_encode_stitch.php

This file was deleted.

34 changes: 34 additions & 0 deletions src/Classes/Format.php
Original file line number Diff line number Diff line change
@@ -3,12 +3,18 @@
namespace Qencode\Classes;

class Format {

/**
* Output video format. Currently supported values are mp4, webm, advanced_hls, advanced_dash. Required.
* @var string
*/
public $output;

/**
* Output metadata version.
* @var string
*/
public $metadata_version;
/**
* Output video file extension (for MP4 - defaults to '.mp4', for WEBM - defaults to '.webm').
* @var string
@@ -32,4 +38,32 @@ class Format {
* @var Stream
*/
public $stream;

/**
* Enables/Disables per-title encoding mode. Defaults to 0.
* @var int
*/
public $optimize_bitrate;

/**
* Limits the lowest CRF (quality) for Per-Title Encoding mode to the specified value.
* Possible values: from 0 to 51. Defaults to 0
* @var int
*/
public $min_crf;

/**
* Limits the highest CRF (quality) for Per-Title Encoding mode to the specified value.
* Possible values: from 0 to 51. Defaults to 0
* @var int
*/
public $max_crf;

/**
* Adjusts best CRF predicted for each scene with the specified value in Per-Title Encoding mode.
* Should be integer in range -10..10. Defaults to 0
* @var int
*/
public $adjust_crf;

}
Loading