Ffmpeg
<?php $movefile = "./4.mp4"; $mov = new ffmpeg_movie($movefile); printf("file name = %s ", $mov->getFileName()); printf("duration = %s seconds ", $mov->getDuration()); printf("frame count = %s ", $mov->getFrameCount()); printf("frame rate = %0.3f fps ", $mov->getFrameRate()); printf("comment = %s ", $mov->getComment()); printf("title = %s ", $mov->getTitle()); printf("author = %s ", $mov->getAuthor()); printf("copyright = %s ", $mov->getCopyright()); printf("get bit rate = %d ", $mov->getBitRate()); printf("has audio = %s ", $mov->hasAudio() == 0 ? 'No' : 'Yes'); if ($mov->hasAudio()) { printf("get audio stream id= %s ", $mov->getAudioStreamId()); printf("get audio codec = %s ", $mov->getAudioCodec()); printf("get audio bit rate = %d ", $mov->getAudioBitRate()); printf("get audio sample rate = %d ", $mov->getAudioSampleRate()); printf("get audio channels = %s ", $mov->getAudioChannels()); } printf("has video = %s ", $mov->hasVideo() == 0 ? 'No' : 'Yes'); if ($mov->hasVideo()) { printf("frame height = %d pixels ", $mov->getFrameHeight()); printf("frame width = %d pixels ", $mov->getFrameWidth()); printf("get video stream id= %s ", $mov->getVideoStreamId()); printf("get video codec = %s ", $mov->getVideoCodec()); printf("get video bit rate = %d ", $mov->getVideoBitRate()); printf("get pixel format = %s ", $mov->getPixelFormat()); printf("get pixel aspect ratio = %s ", $mov->getPixelAspectRatio()); $frame = $mov->getFrame(10); printf("get frame = %s ", is_object($frame) ? 'true' : 'false'); printf(" get frame number = %d ", $mov->getFrameNumber()); printf(" get frame width = %d ", $frame->getWidth()); printf(" get frame height = %d ", $frame->getHeight()); } echo " -------------------- ";