PHP Classes

PHP Media File Info Library: Retrieve the details from a video or audio file

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 79 All time: 10,122 This week: 62Up
Version License PHP version Categories
mediainfo 1.0GNU General Publi...5PHP 5, Files and Folders, Audio, Video
Description 

Author

This package can retrieve the details from a video or audio file.

It can take the path of a video or audio file and analyze the file using the getID package written initially by James Heinrich.

The package can retrieve several types of details like the:

- File size, name, and path
- File format
- Audio details like:

* Codec
* Sample rate
* Channels
* Bits per sample
* Lossless compression
* Mono or stereo channel
* Streams

- Video details like:

* Data format
* Rotation
* Resolution
* Frame rate

- Etc.

Picture of Ali YILMAZ
  Performance   Level  
Name: Ali YILMAZ <contact>
Classes: 16 packages by
Country: Turkey Turkey
Age: ???
All time rank: 249042 in Turkey Turkey
Week rank: 206 Up5 in Turkey Turkey Up
Innovation award
Innovation award
Nominee: 8x

Documentation

What is mediaInfo ?

This package uses the getID3() project. For more information, you can visit the project page.

The mediaInfo package contains the current version of the getID3 project. If you think the getID3 project is out of date, you can download and replace the original files of the project in question. When we created the mediaInfo package, we did not make any changes to the getID3 project files.

Out-of-class use:

code:

require_once('Mind.php');
$m = new Mind();
$filePath = '1.mp4';
print_r($m::aliyilmaz('mediaInfo')->mediaInfo($filePath));

When using it in the class:

code:

$filePath = '1.mp4';
print_r(self::aliyilmaz('mediaInfo')->mediaInfo($filePath));

output:

Array
(
    [GETID3_VERSION] => 1.9.21-202202031206
    [filesize] => 29861840
    [filepath] => C:/laragon/www/project
    [filename] => 1.mp4
    [filenamepath] => C:/laragon/www/project/1.mp4
    [avdataoffset] => 39339
    [avdataend] => 29861840
    [fileformat] => mp4
    [audio] => Array
        (
            [dataformat] => mp4
            [codec] => ISO/IEC 14496-3 AAC
            [sample_rate] => 48000
            [channels] => 2
            [bits_per_sample] => 16
            [lossless] => 
            [channelmode] => stereo
            [streams] => Array
                (
                    [0] => Array
                        (
                            [dataformat] => mp4
                            [codec] => ISO/IEC 14496-3 AAC
                            [sample_rate] => 48000
                            [channels] => 2
                            [bits_per_sample] => 16
                            [lossless] => 
                            [channelmode] => stereo
                        )

                )

        )

    [video] => Array
        (
            [dataformat] => quicktime
            [rotate] => 0
            [resolution_x] => 1280
            [resolution_y] => 720
            [fourcc] => avc1
            [fourcc_lookup] => H.264/MPEG-4 AVC
            [frame_rate] => 23.976
        )

    [warning] => Array
        (
            [0] => Unknown QuickTime atom type: "?TIM" (a9 54 49 4d), 23 bytes at offset 33421
            [1] => Unknown QuickTime atom type: "?TSC" (a9 54 53 43), 17 bytes at offset 33444
            [2] => Unknown QuickTime atom type: "?TSZ" (a9 54 53 5a), 16 bytes at offset 33461
        )

    [comments] => Array
        (
            [language] => Array
                (
                    [0] => English
                )

        )

    [encoding] => UTF-8
    [mime_type] => video/mp4
    [quicktime] => Array
        (
            [hinting] => 
            [controller] => standard
            [ftyp] => Array
                (
                    [hierarchy] => ftyp
                    [name] => ftyp
                    [size] => 24
                    [offset] => 0
                    [signature] => mp42
                    [unknown_1] => 0
                    [fourcc] => mp42
                )

            [timestamps_unix] => Array
                (
                    [create] => Array
                        (
                            [moov mvhd] => 1483818871
                            [moov trak tkhd] => 1483818871
                            [moov trak mdia mdhd] => 1483818871
                        )

                    [modify] => Array
                        (
                            [moov mvhd] => 1483818872
                            [moov trak tkhd] => 1483818871
                            [moov trak mdia mdhd] => 1483818871
                        )

                )

            [time_scale] => 48000
            [display_scale] => 1
            [video] => Array
                (
                    [rotate] => 0
                    [resolution_x] => 1280
                    [resolution_y] => 720
                    [frame_rate] => 23.976
                    [frame_count] => 396
                )

            [stts_framecount] => Array
                (
                    [0] => 1646
                    [1] => 3222
                )

            [audio] => Array
                (
                    [codec] => mp4
                    [sample_rate] => 48000
                    [channels] => 2
                    [bit_depth] => 16
                )

            [uuid] => Array
                (
                    [0] => Array
                        (
                            [hierarchy] => uuid
                            [name] => uuid
                            [size] => 5854
                            [offset] => 33477
                            [uuid_field_id] => be7acfcb-97a9-42e8-9c71-999491e3afac
                            [xml] => 
                 
                        )

                )

            [mdat] => Array
                (
                    [hierarchy] => mdat
                    [name] => mdat
                    [size] => 29822509
                    [offset] => 39331
                )

            [encoding] => UTF-8
        )

    [playtime_seconds] => 68.736
    [bitrate] => 3470961.4757914
    [playtime_string] => 1:09
)

Dependencies

The self::$path variable in the Mind project is used.

License

Instructions and files in this directory are shared under the GPL3 license.


  Files folder image Files (115)  
File Role Description
Files folder imagegetID3 (6 files, 4 directories)
Files folder imagesrc (1 file)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (115)  /  getID3  
File Role Description
Files folder imagedemos (16 files)
Files folder imagegetid3 (83 files)
Files folder imagehelperapps (1 file)
Files folder imagelicenses (6 files)
  Accessible without login Plain text file changelog.txt Doc. Documentation
  Accessible without login Plain text file dependencies.txt Doc. Documentation
  Accessible without login Plain text file license.txt Doc. Documentation
  Accessible without login Plain text file README.md Example Example script
  Accessible without login Plain text file readme.txt Doc. Documentation
  Accessible without login Plain text file structure.txt Doc. Documentation

  Files folder image Files (115)  /  getID3  /  demos  
File Role Description
  Plain text file demo.audioinfo.class.php Class Class source
  Accessible without login Plain text file demo.basic.php Example Example script
  Accessible without login Plain text file demo.browse.php Example Example script
  Accessible without login Plain text file demo.cache.dbm.php Example Example script
  Accessible without login Plain text file demo.cache.mysql.php Example Example script
  Plain text file demo.dirscan.php Class Class source
  Accessible without login Plain text file demo.joinmp3.php Example Example script
  Accessible without login Plain text file demo.mimeonly.php Example Example script
  Accessible without login Plain text file demo.mp3header.php Aux. Auxiliary script
  Accessible without login Plain text file demo.mysqli.php Example Example script
  Accessible without login Plain text file demo.simple.php Example Example script
  Accessible without login Plain text file demo.simple.write.php Example Example script
  Accessible without login Plain text file demo.write.php Example Example script
  Accessible without login Plain text file demo.zip.php Example Example script
  Accessible without login Plain text file getid3.css Data Auxiliary data
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files (115)  /  getID3  /  getid3  
File Role Description
  Plain text file extension.cache.dbm.php Class Class source
  Plain text file extension.cache.mysql.php Class Class source
  Plain text file extension.cache.mysqli.php Class Class source
  Plain text file extension.cache.sqlite3.php Class Class source
  Plain text file getid3.lib.php Class Class source
  Plain text file getid3.php Class Class source
  Plain text file module.archive.gzip.php Class Class source
  Plain text file module.archive.hpk.php Class Class source
  Plain text file module.archive.rar.php Class Class source
  Plain text file module.archive.szip.php Class Class source
  Plain text file module.archive.tar.php Class Class source
  Plain text file module.archive.xz.php Class Class source
  Plain text file module.archive.zip.php Class Class source
  Plain text file module.audio-video.asf.php Class Class source
  Plain text file module.audio-video.bink.php Class Class source
  Plain text file module.audio-video.flv.php Class Class source
  Plain text file module.audio-video.ivf.php Class Class source
  Plain text file module.audio-video.matroska.php Class Class source
  Plain text file module.audio-video.mpeg.php Class Class source
  Plain text file module.audio-video.nsv.php Class Class source
  Plain text file module.audio-video.quicktime.php Class Class source
  Plain text file module.audio-video.real.php Class Class source
  Plain text file module.audio-video.riff.php Class Class source
  Plain text file module.audio-video.swf.php Class Class source
  Plain text file module.audio-video.ts.php Class Class source
  Plain text file module.audio-video.wtv.php Class Class source
  Plain text file module.audio.aa.php Class Class source
  Plain text file module.audio.aac.php Class Class source
  Plain text file module.audio.ac3.php Class Class source
  Plain text file module.audio.amr.php Class Class source
  Plain text file module.audio.au.php Class Class source
  Plain text file module.audio.avr.php Class Class source
  Plain text file module.audio.bonk.php Class Class source
  Plain text file module.audio.dsdiff.php Class Class source
  Plain text file module.audio.dsf.php Class Class source
  Plain text file module.audio.dss.php Class Class source
  Plain text file module.audio.dts.php Class Class source
  Plain text file module.audio.flac.php Class Class source
  Plain text file module.audio.la.php Class Class source
  Plain text file module.audio.lpac.php Class Class source
  Plain text file module.audio.midi.php Class Class source
  Plain text file module.audio.mod.php Class Class source
  Plain text file module.audio.monkey.php Class Class source
  Plain text file module.audio.mp3.php Class Class source
  Plain text file module.audio.mpc.php Class Class source
  Plain text file module.audio.ogg.php Class Class source
  Plain text file module.audio.optimfrog.php Class Class source
  Plain text file module.audio.rkau.php Class Class source
  Plain text file module.audio.shorten.php Class Class source
  Plain text file module.audio.tak.php Class Class source
  Plain text file module.audio.tta.php Class Class source
  Plain text file module.audio.voc.php Class Class source
  Plain text file module.audio.vqf.php Class Class source
  Plain text file module.audio.wavpack.php Class Class source
  Plain text file module.graphic.bmp.php Class Class source
  Plain text file module.graphic.efax.php Class Class source
  Plain text file module.graphic.gif.php Class Class source
  Plain text file module.graphic.jpg.php Class Class source
  Plain text file module.graphic.pcd.php Class Class source
  Plain text file module.graphic.png.php Class Class source
  Plain text file module.graphic.svg.php Class Class source
  Plain text file module.graphic.tiff.php Class Class source
  Plain text file module.misc.cue.php Class Class source
  Plain text file module.misc.exe.php Class Class source
  Plain text file module.misc.iso.php Class Class source
  Plain text file module.misc.msoffice.php Class Class source
  Plain text file module.misc.par2.php Class Class source
  Plain text file module.misc.pdf.php Class Class source
  Plain text file module.misc.torrent.php Class Class source
  Plain text file module.tag.apetag.php Class Class source
  Plain text file module.tag.id3v1.php Class Class source
  Plain text file module.tag.id3v2.php Class Class source
  Plain text file module.tag.lyrics3.php Class Class source
  Plain text file module.tag.nikon-nctg.php Class Class source
  Plain text file module.tag.xmp.php Class Class source
  Plain text file write.apetag.php Class Class source
  Plain text file write.id3v1.php Class Class source
  Plain text file write.id3v2.php Class Class source
  Plain text file write.lyrics3.php Class Class source
  Plain text file write.metaflac.php Class Class source
  Plain text file write.php Class Class source
  Plain text file write.real.php Class Class source
  Plain text file write.vorbiscomment.php Class Class source

  Files folder image Files (115)  /  getID3  /  helperapps  
File Role Description
  Accessible without login Plain text file readme.helperapps.txt Doc. Documentation

  Files folder image Files (115)  /  getID3  /  licenses  
File Role Description
  Accessible without login Plain text file license.commercial.txt Doc. Documentation
  Accessible without login Plain text file license.gpl-10.txt Doc. Documentation
  Accessible without login Plain text file license.gpl-20.txt Doc. Documentation
  Accessible without login Plain text file license.gpl-30.txt Doc. Documentation
  Accessible without login Plain text file license.lgpl-30.txt Doc. Documentation
  Accessible without login Plain text file license.mpl-20.txt Doc. Documentation

  Files folder image Files (115)  /  src  
File Role Description
  Plain text file mediaInfo.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:79
This week:0
All time:10,122
This week:62Up