Querying an audio/video file for information

后端 未结 4 1195
暗喜
暗喜 2020-12-17 03:18

I want a PHP function which receives the path to a file and returns an array of information about it. The PHP file can call FFmpeg.

Returned data should be something

4条回答
  •  萌比男神i
    2020-12-17 03:52

    I'd take a look at Mediainfo. If you pass in --Output=XML, it'll give you something like this:

    
    
    
    
    Movie.webm
    Matroska
    215 MiB
    28mn 39s
    1 049 Kbps
    Safari
    Lavf52.78.0
    Lavf52.78.0
    
    
    
    1
    V_VP8
    V_VP8
    28mn 39s
    529 Kbps
    768 pixels
    432 pixels
    16:9
    25.000 fps
    0.064
    108 MiB (50%)
    Norwegian
    
    
    
    2
    Vorbis
    1
    A_VORBIS
    28mn 39s
    Constant
    500 Kbps
    2 channels
    48.0 KHz
    16 bits
    102 MiB (48%)
    libVorbis 20090709 (UTC 2009-07-09)
    Norwegian
    
    
    
    

提交回复
热议问题