Skip to content
Advertisement

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.

Advertisement

Answer

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/

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement