PHP code example of arhitector / transcoder-ffmpeg

1. Go to this page and download the library: Download arhitector/transcoder-ffmpeg 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/ */

    

arhitector / transcoder-ffmpeg example snippets


public *::__construct(string $filePath [, array $options = array()])

// для аудио
$audio = new Arhitector\Transcoder\FFMpeg\Audio('audio.mp3', [/* опции */]);

// видео или изображение
$video = new Arhitector\Transcoder\FFMpeg\Video('video.mp4', [/* опции */]);

// и для субтитров
$subtitle = new Arhitector\Transcoder\FFMpeg\Subtitle('subtitles.ass');

$options = [
	'ffmpeg.path' => 'path/bin/ffmpeg.exe',
	'ffmpeg.threads' => 12,
	'ffprobe.path' => 'usr/bin/ffprobe',
	'timeout' => 3600
];

$audio = new Arhitector\Transcoder\FFMpeg\Audio('audio.mp3', [
	'timeout' => 300,
	// 'ffmpeg.path' => 'ffmpeg',
	// ...
]);

$adapter = new Arhitector\Transcoder\FFMpeg\Adapter([
	/* опции */
]);

$video->save(new Jpeg, 'picture.jpg');

$video->save(new Png, 'picture-%05d.jpg');