4

My platform is PHP JOOMLA MYSQL. I want to encode and load uploaded video files of different formats to .flv, .mp4 & .avi

I want this process either done on the upload process or after completing the upload process as a separate process. I do use my ffmpeg code to may best but literally failed to encode some of the video files which says that the bitrate is 1/1000 and so the file cannot be encoded. some shows poor in quality.

If anyone know the best practices which usually used to encode in these situations, please share with me.

Any help would be appreciated and thanks in advance to have a good reply for this

Rahul TS
  • 1,208
  • 7
  • 26
  • 53

2 Answers2

7

you can use http://www.ffmpeg.org/ for online video converting with php on any platform windows or linux

 exec("ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv");

more read here

http://www.ffmpeg.org/ffmpeg-doc.html

  • 3
    Or, for a cleaner way to do the same thing all in PHP without exec, use ffmpeg-php - http://ffmpeg-php.sourceforge.net; no `exec` which means better performance and better security. – El Yobo Dec 12 '10 at 12:59
  • yes you are right about the security it will not effect on performance but security –  Dec 13 '10 at 07:44
  • 1
    It also improves performance; `exec` means creating another process, while using the native version means it runs within the existing process. The performance difference is minor, but important if you're doing a batch of conversions. – El Yobo Dec 14 '10 at 23:28
  • 1
    I would recommend running the encoding process separately after the file has been uploaded. Otherwise your user will be waiting, unnecessarily, quite awhile before getting a response. – John Kramlich Dec 17 '10 at 05:19
  • I would recommend to create thumbnails while encoding videos, that would be easier to list the video thumbnails for users.. eg: exec("ffmpeg -i 'test.flv' -r 1 -ss 00:00:05 -f image2 -s 120x72 test,png"); – Vijay Dec 17 '10 at 13:04
1

You could check out a Joomla component called hwdVideoShare.

The server requirements look like this: FFMPEG, FLVTOOL2, MENCODER, GD, FREETYPE, PHP (installations should support exec, cURL & file_get_contents functions), PERL. So you need to make sure that your server has all these before installing.

dragosplesca
  • 515
  • 6
  • 12
  • I am little bit worried as I am developing a complete component in joomla to do all the functional stuffs, so that I have an upload page to do the video uploading and I wish to make the conversion process simultaneously just after file upload, do you guess the hwdVideoShare component will help me in between – Rahul TS Aug 29 '10 at 07:47