GithubHelp home page GithubHelp logo

dong-zeyu / ffmpeg-php-streaming Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 3.0 17 KB

This is an instant-decoding and streaming tool written in PHP based on FFMpeg.

License: MIT License

PHP 76.71% HTML 23.29%

ffmpeg-php-streaming's Introduction

FFMpeg-PHP Real-Time Video Streaming Tool

This is a real-time decoding and streaming tool written in PHP based on FFMpeg. It uses HLS protocol to stream videos.

Features

Pros

  • Decoding for all kinds of video format that FFMpeg supports.
  • For all client devices that support HTML5.
  • Fast and real-time decoding without using cache, thus little loads for disk.
  • Support for multiple audio tracks and subtile tracks.
  • Support for multiple resolutions.

Cons

  • Resources Consuming (since it is real-time decoding and no cache is used)
  • A few videos may not be streamed smoothly. (since the inaccuracy seek for FFMpeg).

Requirement

  • PHP
  • FFMpeg with h264 support

Usage

The following URL will output the m3u8 file for playing.

m3u8.php?src=<path-to-video-file>&quality=<quality>
  1. <path-to-video-file> must be an absolute URL relative to your domain (start with '/') when accessing resources in the same domain.
  2. For <quality> option, please refer to FFMpeg Video Size.

Config

See libs/config.php. You may need to change paths for $ffmpeg and $ffmprob.

Example

Here is an example using video-js with hls plugin:

demo.html?src=/Sample_video.rmvb

where Sample_video.rmvb located in http(s)://<your-domain>/Sample_video.rmvb.

ffmpeg-php-streaming's People

Contributors

dong-zeyu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.