Get the length of a video file using ffmpeg with php

FFmpeg is complete, cross platform solution to record, convert, stream audio and video. It has the leading libavcodec library. The good part is its an open source software. Here in this post, I am sharing you a php snippet which will use FFmpeg to get the length of a video file. If you have not installed FFmpeg then you can download from http://www.ffmpeg.org/download.html. This script should be easy to understand. It uses
ffmpeg -i file.mp4 
to extract the information of the video file and then uses regex to get the video length from the extracted information. The complete script is as follows:

Comments

Post a Comment

Popular posts from this blog

Automate file upload in Selenium IDE

How To Install and Configure Nextcloud