Thursday, August 13, 2015

A simple PHP library for converting videos to HTML5 Mp4 format

Here is a simple lightweight PHP library for converting any videos into HTML5 standard Mp4 format, so that you can stream them using the HTML5 <video> element.

It uses ffmpeg of avconv.

Checkout github repository https://github.com/anandrmedia/phpmp4

Usage is simple, Install it via composer (package name : phpmp4//phpmp4)


 $video = new \PHPMp4\PHPMp4('test.wmv');

    try{
        $video->convertVideo();
    }catch(Exception $e){
        echo 'error '.$e->getMessage();
    }