Purple pattern background

What FFMPEG-PHP Can Do & How To Use The Most Out Of It

Mohammed NaserMohammed Naser

You have probably heard of ffmpeg-php and it's wide usability mostly in sites that involve with videos such as YouTube or any other similar site. Here is a bit of an introduction to it and how to use it.

First thing, you have to check that your web hosting provider actually has ffmpeg & ffmpeg-php extension installed on your account. Then, you could get started with ffmpeg. You can check if it is installed by creating a PHP script and executing the following code:

php `

If you get ffmpeg extension not loaded then your web hosting provider does not have ffmpeg installed, if you get nothing, then you are on the good track!

ffmpeg-php is very simple to learn. It is an interface that works with the ffmpeg software to make it easier for PHP developers to access. Like any object in PHP, you will have to start with creating a new instance of it. You can do that by using the following line:

Now that you have that, you can use that instance to use the many features of ffmpeg-php which are from knowing the duration of the movie/audio in seconds to retrieving the bitrate of the movie/audio file.

Once here, it is pretty much like object-oriented programming, ex:

This can be very helpful when coding anything that has to do with uploading videos because you can know a lot of information about it.

A little bit about us, VEXXHOST is a high-performance cloud solution that is a secure & reliable OpenStack based solutions for Developers & Enterprises. Solutions to support your demanding requirements and workloads used by active customers in over 150+ countries.

VEXXHOST was created in 2006 and opened its virtual doors as a web hosting provider. VEXXHOST now offers Public, Private and Hybrid cloud all powered by OpenStack.

If you are interested in reading more blog posts, you can always check out the VEXXHOST blog located on our website which includes many more interesting blogs and tutorials! If you have any questions concerning this blog or in general, feel free to communicate with us through our Contact Us page. One of our support team members will be more than happy to assist you and answer all your questions.

Don't forget to follow us on Twitter for announcements, updates and news regarding VEXXHOST and cloud computing in general – @vexxhost.

Share on social media

Virtual machines, Kubernetes & Bare Metal Infrastructure

Choose from Atmosphere Cloud, Hosted, or On-Premise.
Simplify your cloud operations with our intuitive dashboard.
Run it yourself, tap our expert support, or opt for full remote operations.
Leverage Terraform, Ansible or APIs directly powered by OpenStack & Kubernetes