All Projects → char0n → Ffmpeg Php

char0n / Ffmpeg Php

Licence: bsd-3-clause
FFmpegPHP is a pure OO PHP port of ffmpeg-php library that was written in C. It adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. It has methods for returning frames from movie files as images that can be manipulated using PHP's image functions. This works well for automatically creating thumbnail images from movies. FFmpegPHP is also useful for reporting the duration and bitrate of audio files (mp3, wma...). FFmpegPHP can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv...)

Projects that are alternatives of or similar to Ffmpeg Php

Ffmpeg Video Player
An FFmpeg and SDL Tutorial.
Stars: ✭ 149 (-66.59%)
Mutual labels:  audio, ffmpeg
Fanplayer
A portable video player based on ffmpeg for windows and android platform.
Stars: ✭ 229 (-48.65%)
Mutual labels:  audio, ffmpeg
Aeneas
aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
Stars: ✭ 1,942 (+335.43%)
Mutual labels:  audio, ffmpeg
Sonos Web
Web interface for Sonos audio systems
Stars: ✭ 114 (-74.44%)
Mutual labels:  audio, ffmpeg
Mpc Hc
MPC-HC's main repository. For support use our Trac: https://trac.mpc-hc.org/
Stars: ✭ 3,567 (+699.78%)
Mutual labels:  audio, ffmpeg
Prism Media
Easily transcode media using Node.js 🎶
Stars: ✭ 136 (-69.51%)
Mutual labels:  audio, ffmpeg
Mpv
🎥 Command line video player
Stars: ✭ 17,018 (+3715.7%)
Mutual labels:  audio, ffmpeg
Ffmpeg Example
FFMPEG 0.11-4.4/LibAV 0.8-11 example application with byte exact reading
Stars: ✭ 44 (-90.13%)
Mutual labels:  audio, ffmpeg
Androidffmpeg
android 读取摄像头和麦克风,使用rtmp推流
Stars: ✭ 298 (-33.18%)
Mutual labels:  audio, ffmpeg
Youtube Audio Stream
youtube audio stream
Stars: ✭ 276 (-38.12%)
Mutual labels:  audio, ffmpeg
Soundpusher
Virtual audio device, real-time encoder and SPDIF forwarder for macOS
Stars: ✭ 91 (-79.6%)
Mutual labels:  audio, ffmpeg
Ffmpegcore
A .NET FFMpeg/FFProbe wrapper for easily integrating media analysis and conversion into your C# applications
Stars: ✭ 429 (-3.81%)
Mutual labels:  audio, ffmpeg
Aurio
Audio Fingerprinting & Retrieval for .NET
Stars: ✭ 84 (-81.17%)
Mutual labels:  audio, ffmpeg
Digital video introduction
A hands-on introduction to video technology: image, video, codec (av1, vp9, h265) and more (ffmpeg encoding).
Stars: ✭ 12,184 (+2631.84%)
Mutual labels:  audio, ffmpeg
Androidaudioconverter
Convert audio files inside your Android app easily. Supported formats: AAC, MP3, M4A, WMA, WAV and FLAC.
Stars: ✭ 1,156 (+159.19%)
Mutual labels:  audio, ffmpeg
Online Video Editor
API based Online Video Editing using FFMPEG & NodeJs for Backend Editing
Stars: ✭ 176 (-60.54%)
Mutual labels:  audio, ffmpeg
Flavy
Simple API for convert audio/video files, get thumbnails from video, information of files
Stars: ✭ 25 (-94.39%)
Mutual labels:  audio, ffmpeg
Tdarr
Tdarr - Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking (Windows, macOS, Linux & Docker)
Stars: ✭ 911 (+104.26%)
Mutual labels:  audio, ffmpeg
Swiftffmpeg
A Swift wrapper for the FFmpeg API
Stars: ✭ 243 (-45.52%)
Mutual labels:  audio, ffmpeg
Mystiq
Qt5/C++ FFmpeg Media Converter
Stars: ✭ 393 (-11.88%)
Mutual labels:  audio, ffmpeg

CircleCI

FFmpegPHP

FFmpegPHP is a pure OO PSR-4 compatible PHP port of ffmpeg-php library (that was written in C). It adds an easy to use, object-oriented API for accessing and retrieving information from video and audio files. It has methods for returning frames from movie files as images that can be manipulated using PHP image functions. This works well for automatically creating thumbnail images from movies. FFmpegPHP is also useful for reporting the duration and bitrate of audio files (mp3, wma...). FFmpegPHP can access many of the video formats supported by ffmpeg (mov, avi, mpg, wmv...)

Drop-in replacement for ffmpeg-php

FFmpegPHP can be used as a drop in replacement for ffmpeg-php library.

Documentation

FFmpegPHP API documentation can be found here http://char0n.github.io/ffmpeg-php/.

Requirements

  • PHP >=7
  • PHP extensions: gd, mbstring, xml
  • ffmpeg or ffprobe

Installation

Source code

Grab the source code located in src/ directory and use it as you seem appropriate.

Composer installation

Grab the composer.phar which can install packages published on packagist.

 $ wget https://raw.githubusercontent.com/composer/getcomposer.org/1b137f8bf6db3e79a38a5bc45324414a6b1f9df2/web/installer -O - -q | php

This command will create file called composer.phar.

Create a file called composer.json and paste the following JSON into it:

 {
    "require": {
        "char0n/ffmpeg-php": "^3.0.0"
    }
 }

Install the FFmpegPHP by running the following command:

$ php composer.phar install

After this command is successfully executed, the new directory called vendor/ is created. File structure of your current working directory should now look like this:

 - composer.json
 - composer.phar
 - vendor/

To verify that everything works as expected create new file called test.php inside your current working directory with the following content.

<?php
require_once './vendor/autoload.php';

use Char0n\FFMpegPHP\Movie;

$movie = new Movie('./test.mp4');
var_dump($movie->getDuration()); 

Before you run the script you need to also download the testing movie file:

$ wget https://github.com/char0n/ffmpeg-php/raw/master/tests/data/test.mp4

Now run it.

$ php test.php

The output should be something similar to the following:

float(32.14)

Note

Notice the first line (require './vendor/autoload.php';) in the above script. This line is necessary because it configures how the FFmpegPHP will be included into your scripts and it auto-magically knows where to look for FFmpegPHP.

Using FFmpegPHP

Object Oriented interface

FFmpegPHP is build using PSR-4 standard and it's interface is purely Object Oriented. We're using standar OOP patterns to create our API.

use Char0n\FFMpegPHP\Movie;

$movie = new Movie('/path/to/media.mpeg');
$movie->getDuration(); // => 24

Compatibility layer

On top of our OO interface, there is an additional one that provides full compatibility with original ffmpeg-php library.

use Char0n\FFMpegPHP\Adapters\FFMpegMovie as ffmpeg_movie;

$movie = new ffmpeg_movie('/path/to/media.mpeg');
$movie->getDuration(); // => 24

Partnership with GoDaddy

GoDaddy started to use FFmpegPHP as part of it's services from November 2018. If you need a server with ffmpeg and FFmpegPHP installed on it contact GoDaddy and they'll do it for you as part of its "Expert Service". As author of FFmpegPHP I agreed to provide support for users coming from GoDaddy asking about FFmpegPHP. All incoming GoDaddy customers, please use GitHub issues as a support channel.

Author

References

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].