All Projects → soluble-io → Soluble Mediatools

soluble-io / Soluble Mediatools

Licence: mit
Video / audio conversion, thumbnailing and more ! PHP FFmpeg wrapper

Projects that are alternatives of or similar to Soluble Mediatools

recode-converter
A modern & simple audio converter for video files
Stars: ✭ 22 (-84.4%)
Mutual labels:  converter, ffmpeg
Jave2
The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project
Stars: ✭ 570 (+304.26%)
Mutual labels:  ffmpeg, converter
Modfy.video
A video transcoder and converter built using Web Assembly and FFMPEG to transcode and convert videos right in your browser while protecting your privacy
Stars: ✭ 283 (+100.71%)
Mutual labels:  ffmpeg, converter
Fast Youtube To Mp3 Converter Api
Very Fast YouTube to MP3 & MP4 Converter API
Stars: ✭ 69 (-51.06%)
Mutual labels:  ffmpeg, converter
Axiom
An FFmpeg GUI for Windows
Stars: ✭ 560 (+297.16%)
Mutual labels:  ffmpeg, converter
Ffmpeg Gif Script For Bash
Turn your videos into palette-mapped gifs with this easy script
Stars: ✭ 100 (-29.08%)
Mutual labels:  ffmpeg, converter
Mongolastic
🚥 A dataset migration tool from MongoDB to Elasticsearch and vice versa.
Stars: ✭ 131 (-7.09%)
Mutual labels:  converter
To Milliseconds
Convert an object of time properties to milliseconds: `{seconds: 2}` → `2000`
Stars: ✭ 136 (-3.55%)
Mutual labels:  converter
Video Srt Windows
这是一个可以识别视频语音自动生成字幕SRT文件的开源 Windows-GUI 软件工具。
Stars: ✭ 2,497 (+1670.92%)
Mutual labels:  ffmpeg
Audiobookconverter
Improved AudioBookConverter based on freeipodsoftware release (mp3 to m4b converter)
Stars: ✭ 131 (-7.09%)
Mutual labels:  ffmpeg
Prism Media
Easily transcode media using Node.js 🎶
Stars: ✭ 136 (-3.55%)
Mutual labels:  ffmpeg
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+1352.48%)
Mutual labels:  ffmpeg
Toml To Go
Translates TOML into a Go type in your browser instantly
Stars: ✭ 134 (-4.96%)
Mutual labels:  converter
Avtranscoder
C++ API for LibAV / FFMpeg
Stars: ✭ 130 (-7.8%)
Mutual labels:  ffmpeg
Radigo
Record radiko 📻
Stars: ✭ 135 (-4.26%)
Mutual labels:  ffmpeg
Spacextract
Extraction and analysis of telemetry from rocket launch webcasts (from SpaceX and RocketLab)
Stars: ✭ 131 (-7.09%)
Mutual labels:  ffmpeg
Superview
A small program that takes a 4:3 aspect ratio video file, and transforms it to a 16:9 video using the GoPro SuperView method
Stars: ✭ 137 (-2.84%)
Mutual labels:  ffmpeg
Yjlocationconverter
中国国测局地理坐标(GCJ-02)<火星坐标>、世界标准地理坐标(WGS-84) 、百度地理坐标(BD-09)坐标系转换工具类
Stars: ✭ 131 (-7.09%)
Mutual labels:  converter
Hrconvert2
A self-hosted, drag-and-drop, & nosql file conversion server that supports 62x file formats.
Stars: ✭ 132 (-6.38%)
Mutual labels:  converter
Swiftvideo
Swift Video Framework for Linux, macOS, and iOS/iPadOS
Stars: ✭ 137 (-2.84%)
Mutual labels:  ffmpeg

Logo

PHP 7.1+ Build Status Coverage Code Quality Latest Stable Version Total Downloads PHPStan License

Flexible audio/video conversions and thumbnailing for hiphpies. Wraps around ffmpeg and ffprobe and exposes most of their features, like scaling, clipping, filters, transcoding, audio extraction and much more.

To prevent limitations, the API rather focus on providing developer fine-tuned parameters than giving ready-made recipes. Transcoding and conversions generally requires specific processing, judge by yourself. To help starting, the documentation includes a lot of examples and snippets you can easily try and tune later. Check also alternatives wrappers for ffmpeg, they are good and sometimes offer more magic if you're looking for it.

On another side, it likes PSR (psr-log, psr-container, psr-simplecache), tastes php 7.1 in strict mode, tries to fail as early as possible with clear exception messages and ensure that substitution is possible when you need to customize (SOLID friendly).

Under the hood, it relies on the battle-tested symfony/process, its only dependency.

Documentation

All is here: https://soluble-io.github.io/soluble-mediatools/

Requirements

  • PHP 7.1+
  • FFmpeg/FFProbe 3.4+, 4.0+.

Features

Check the doc to get a more detailed overview !!!

Implemented services

VideoConverter

Full doc: here

<?php
use Soluble\MediaTools\Video\Config\FFMpegConfig;
use Soluble\MediaTools\Video\Exception\ConverterExceptionInterface;
use Soluble\MediaTools\Video\{VideoConverter, VideoConvertParams};

$converter = new VideoConverter(new FFMpegConfig('/path/to/ffmpeg'));

$params = (new VideoConvertParams())
    ->withVideoCodec('libx264')    
    ->withStreamable(true)
    ->withCrf(24);                  
    
try {    
    $converter->convert(
        '/path/inputFile.mov', 
        '/path/outputFile.mp4', 
        $params
    );    
} catch(ConverterExceptionInterface $e) {
    // See chapter about exception !!!    
}
       

VideoInfoReader

Full doc: here

<?php
use Soluble\MediaTools\Video\Config\FFProbeConfig;
use Soluble\MediaTools\Video\Exception\InfoReaderExceptionInterface;
use Soluble\MediaTools\Video\VideoInfoReader;
use Soluble\MediaTools\Video\VideoInfo;

$infoReader = new VideoInfoReader(new FFProbeConfig('/path/to/ffprobe'));

// Step 1: Read a media file

try {
    $info = $infoReader->getInfo('/path/video.mp4');
} catch (InfoReaderExceptionInterface $e) {
    // not a valid video (see exception)
}

$duration = $info->getDuration(); // total duration
$format   = $info->getFormatName(); // container format: mkv, mp4

// Step 2: Media streams info (video, subtitle, audio, data).

// Example with first video stream (streams are iterable)

try {    
    $video   = $info->getVideoStreams()->getFirst();
} catch (\Soluble\MediaTools\Video\Exception\NoStreamException $e) {
    // No video stream, 
}
    
$codec   = $video->getCodecName(); // i.e: vp9
$fps     = $video->getFps($decimals=0); // i.e: 24
$width   = $video->getWidth(); // i.e: 1080
$ratio   = $video->getAspectRatio();

// Alternate example  

if ($info->countStreams(VideoInfo::STREAM_TYPE_SUBTITLE) > 0) {
    $sub  = $info->getSubtitleStreams()->getFirst();
    $sub->getCodecName(); // webvtt
}

VideoThumbGenerator

Full doc: here

<?php
use Soluble\MediaTools\Video\Config\FFMpegConfig;
use Soluble\MediaTools\Video\Exception\ConverterExceptionInterface;
use Soluble\MediaTools\Video\{VideoThumbGenerator, VideoThumbParams, SeekTime};

$generator = new VideoThumbGenerator(new FFMpegConfig('/path/to/ffmpeg'));

$params = (new VideoThumbParams())
    ->withTime(1.25);
    
try {    
    $generator->makeThumbnail(
        '/path/inputFile.mov', 
        '/path/outputFile.jpg', 
        $params
    );    
} catch(ConverterExceptionInterface $e) {
    // See chapter about exception !!!    
}
       

VideoAnalyzer

Full doc: here

<?php
use Soluble\MediaTools\Video\Config\FFMpegConfig;
use Soluble\MediaTools\Video\Exception\AnalyzerExceptionInterface;
use Soluble\MediaTools\Video\VideoAnalyzer;

$analyzer = new VideoAnalyzer(new FFMpegConfig('/path/to/ffmpeg'));

try {    
    $interlaceGuess = $analyzer->detectInterlacement(
        '/path/input.mov',
        // Optional:
        //   $maxFramesToAnalyze, default: 1000
        $maxFramesToAnalyze = 200
    );
    
} catch(AnalyzerExceptionInterface $e) {
    // See chapter about exception !!!    
}

$interlaced = $interlaceGuess->isInterlaced(
    // Optional: 
    //  $threshold, default 0.25 (if >=25% interlaced frames, then true) 
    0.25
);

Alternatives

Coding standards and interop

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].