Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert video to mp4,webM,ogv while uploading ?

i am using videojs to play video on my website(it's a HTML5 website) so for a better support i need to make 3 formats of each video mp4,webM,ogv.

But in my website user can upload video also.

So please tell me how can i automatically convert videos after/while uploading to these formats.

I am using PHP5+JS for development.

like image 235
Peeyush Avatar asked Feb 23 '23 06:02

Peeyush


1 Answers

As the conversion will need to happen on the server side, you will only be able to do this once the upload has been completed. HTML5 is great but is does not support video transcoding.

I would suggest to have a look at ffmpeg, it's an extremely powerful command line utility that allow you transcode your video's with the finest precision, in fact youtube uses this to convert their video's as well.

It is a free tool and there is more than enough documentation to get you started at http://ffmpeg.org/

like image 50
Stephan Avatar answered Feb 26 '23 08:02

Stephan