Download the PHP package converter-studio/converter-studio-php without Composer

On this page you can find all versions of the php package converter-studio/converter-studio-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package converter-studio-php

Converter Studio for PHP

The official PHP client for the Converter Studio API. Convert iPhone photos (HEIC), camera RAW photos, videos, audio, documents, spreadsheets, presentations, e-books, subtitles, fonts, data files and archives (67 formats) from your PHP code. The conversion runs on Converter Studio's servers, so there is nothing else to install on yours: no ImageMagick, no FFmpeg, no LibreOffice.

Installation

Then create an API key on your account page (keys start with cvs_live_; keep them secret) and put it in the environment:

Every conversion uses your account's credits, the same as on the website: free accounts get credits every day, Pro and Premium their monthly credits. Most files cost 1 credit; audio and video are priced by their length (video also by its frame size and the format made) once Converter Studio has looked at them. See pricing.

Usage

Convert a file

convert() uploads the file, starts the conversion and waits until it is done (10 minutes at most by default: timeout:). The source can be:

ConverterStudio\Source also has fromPath() and fromUrl(), to say which a string is (a local file whose name starts with http).

download() never replaces an existing file in a folder unless overwrite: true: the result gets -1, -2... before its extension. The file appears only once it is complete. You can also stream the result to any open stream, such as the browser:

or get it in memory ($client->downloadContents($conversion)). Results are kept for 6 hours, and anyone with $conversion->downloadUrl can download the result until $conversion->expiresAt.

Settings

options takes the API's conversion settings, the same as on the website. A few of them:

Setting For
quality: 'high', 'balanced', 'small' video, JPG, WebP, AVIF
height: '1080', '720', '480', '360' video (never upscaled)
maxSize: MB MP4 that must fit a size
maxKb: KB JPG, WebP, AVIF that must fit a size
longSide, resizeWidth, resizeHeight, fit resizing images
keepMetadata, keepLocation: true keep a photo's camera details and GPS (off)
bitrate: '64'... '320', channels, trimStart, trimEnd audio
pageRange: '1-3, 5', pdfA: true documents to PDF
ocr: true, ocrLanguage scanned PDFs to Word or text
compression: 'light', 'balanced', 'strong' PDF to a smaller PDF
password a locked ZIP, 7Z or RAR (used once, never stored)

The full list, and which settings apply to which conversion, is on the API page. Settings that do not apply to a conversion are ignored; a name the API does not know is refused (BadRequestException).

Formats and account

Price limits

A conversion goes ahead on its own when it costs at most maxCredits (20 by default). A dearer one waits for your go-ahead and costs nothing until then:

maxCredits: 0 only gets the price.

Step by step

convert() is built from these, which you can call yourself:

wait() returns a finished conversion or throws (see Errors). It lets the API hold each status request until something changes, and pauses between answers that come back early (1 second, doubling up to 10). convert(..., wait: false) returns as soon as the conversion has started.

Callbacks and retries

Errors

Every exception derives from ConverterStudio\Exception\ConverterStudioException, and getMessage() is a sentence meant for people (for API errors, the API's own message). Wrong arguments throw PHP's InvalidArgumentException.

Exception (in ConverterStudio\Exception) When
ApiException the API answered with an error: ->statusCode, ->errorCode (notEnoughCredits...), ->params
AuthenticationException (401) the API key does not work
InsufficientCreditsException (402) not enough credits (params: needed, balance)
FileTooLargeException (413), UnprocessableException (422) the file is over the plan's limit; the file cannot be converted that way (unsupportedConversion)
BadRequestException, NotFoundException, ConflictException, GoneException, PermissionDeniedException 400, 404, 409, 410, 403
RateLimitException (429), ServerException (5xx) retried on their own first (maxRetries, 2 by default); ->retryAfter in seconds
ConversionFailedException the conversion failed, expired or was canceled: ->errorCode, ->conversion; failures are not charged
ConfirmationRequiredException the price is over maxCredits: ->credits, ->conversion
ConversionTimeoutException not done within timeout; it may still finish (->conversion->id)
MissingApiKeyException, ApiConnectionException, ApiTimeoutException no key; the API could not be reached
LocalFileException a local file could not be read or written (or is already there)

Configuration

The API key is only sent to baseUrl; upload and download links carry their own tokens. It is kept out of var_dump(), print_r() and stack traces, and a client cannot be serialized. Requests go through PHP's curl extension; a class of your own that implements ConverterStudio\Http\Transport can send them instead.

Limits

Privacy

Your files are sent to Converter Studio (converter.studio) to be converted. Uploaded files are deleted as soon as they are converted, and results 6 hours later. Each request also says which client sent it (X-Converter-Studio-Client: php/<version>), for usage statistics only. See the privacy policy and the terms.

Links

MIT licensed. © Converter Studio.


All versions of converter-studio-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package converter-studio/converter-studio-php contains the following files

Loading the files please wait ...