Download the PHP package wapmorgan/media-file without Composer

On this page you can find all versions of the php package wapmorgan/media-file. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package media-file

MediaFile

Allows you easily get meta information about any media file with unified interface. The library has no requirements of external libs or system unitilies.

Latest Stable Version License Latest Unstable Version Tests

Supported formats

Audio Video
aac, amr, flac, mp3, ogg, wav, wma avi, mkv, mp4, wmv
- length - length
- bitRate - width
- sampleRate - height
- channels - frameRate

Table of contents:

  1. Usage
  2. API
  3. Why not using getID3?
  4. Technical details

Usage

API

MediaFile

wapmorgan\wapmorgan\MediaFile

Method Description Notes
static open($filename): MediaFile Detects file type and format and calls constructor with these parameters. Throws an \Exception if file is not a media or is not accessible.
isAudio(): boolean Returns true if media is just audio.
isVideo(): boolean Returns true if media is a video with audio.
isContainer(): boolean Returns true if media is also a container (can store multiple audios and videos).
getFormat(): string Returns media file format.
getAudio(): AudioAdapter Returns an AudioAdapter interface for audio.
getVideo(): VideoAdapter Returns an VideoAdapter interface for video.

AudioAdapter

wapmorgan\MediaFile\AudioAdapter

Method Description
getLength(): float Returns audio length in seconds and microseconds as float.
getBitRate(): int Returns audio bit rate as int.
getSampleRate(): int Returns audio sampling rate as int.
getChannels(): int Returns number of channels used in audio as int.
isVariableBitRate(): boolean Returns whether format support VBR and file has VBR as boolean.
isLossless(): boolean Returns whether format has compression lossless as boolean.

VideoAdapter

wapmorgan\MediaFile\VideoAdapter

Method Description
getLength(): int Returns video length in seconds and microseconds as float.
getWidth(): int Returns width of video as int.
getHeight(): int Returns height of video as int.
getFramerate(): int Returns video frame rate of video as int.

ContainerAdapter

wapmorgan\MediaFile\ContainerAdapter

Method Description
countStreams(): int Returns number of streams in container as int.
countVideoStreams(): int Returns number of video streams as int.
countAudioStreams(): int Returns number of audio streams as int.
getStreams(): array Returns streams information as array.

Why not using getID3?

getID3 library is very popular and has a lot of features, but it's old and too slow.

Following table shows comparation of analyzing speed of fixtures, distributed with first release of MediaFile:

File getID3 MediaFile Speed gain
video.avi 0.215 0.126 1.71x
video.mp4 3.055 0.429 7.12x
video.wmv 0.354 0.372 0.95x
audio.aac 0.560 0.262 2.13x
audio.amr 8.241 12.248 0.67x
audio.flac 1.880 0.071 26.41x
audio.m4a 13.372 0.169 79.14x
audio.mp3 10.931 0.077 141.54x
audio.ogg 0.170 0.096 1.78x
audio.wav 0.114 0.070 1.64x
audio.wma 0.195 0.158 1.23x

Technical information

Format Full format name Specifications Notes
aac MPEG 4 Part 12 container with audio only http://l.web.umkc.edu/lizhu/teaching/2016sp.video-communication/ref/mp4.pdf Does not provide support of MPEG2-AAC
amr AMR-NB http://hackipedia.org/File%20formats/Containers/AMR,%20Adaptive%20MultiRate/AMR%20format.pdf Does not provide support of AMR-WB
avi - http://www.alexander-noe.com/video/documentation/avi.pdf
flac - - Support based on third-party library
mkv Matroska container https://www.matroska.org/technical/specs/index.html
mp3 MPEG 1/2 Layer 1/2/3 https://github.com/wapmorgan/mp3info#technical-information
mp4 MPEG 4 Part 12/14 container with few audio and video streams Part 12 specification: http://l.web.umkc.edu/lizhu/teaching/2016sp.video-communication/ref/mp4.pdf Part 14 extension: https://www.cmlab.csie.ntu.edu.tw/~cathyp/eBooks/14496_MPEG4/ISO_IEC_14496-14_2003-11-15.pdf
ogg Ogg container with Vorbis audio https://xiph.org/vorbis/doc/Vorbis_I_spec.html
wav - - Support based on third-party library
wma ASF container with only one audio stream http://go.microsoft.com/fwlink/p/?linkid=31334
wmv ASF container with few audio and video streams http://go.microsoft.com/fwlink/p/?linkid=31334

All versions of media-file with dependencies

PHP Build Version
Package Version
Requires bluemoehre/flac-php Version 1.0.2
wapmorgan/mp3info Version ~0.0
wapmorgan/binary-stream Version ~0.4.0
wapmorgan/file-type-detector Version ^1.0.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wapmorgan/media-file contains the following files

Loading the files please wait ....