LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   video encoding from uploaded files (http://www.linuxquestions.org/questions/linux-software-2/video-encoding-from-uploaded-files-313001/)

dtra 04-13-2005 09:11 PM

video encoding from uploaded files
 
hi all

we need to set up a system where users can upload movies in some format (avi, wmv, mpeg, mov, etc or can be limited i guess)
which we would need to be converted server side to mp4 video files (not streaming atm)
the movies will be 2MB or less (so really short videos taken on phones or digital cameras)
now i have a lot of questions about this cos i have no idea what i need to do

is this a reasonable situation, would the video conversion take up too many system resources
our site is pretty busy and it already gets a bit slow at times, would video encoding of uploaded video files slow it down even more?

we are using apache 2 with php 4.3.9
red hat 9, dual xeon cpu, 2GB ram

72GB HDD
is there an application we can use where we just call exec(/usr/local/videoencoder $filein $fileout $encoding);?

does anyone know of a tutorial or resource site where i can find this information?

also, is there a way to get a frame, or series of frames so that we can create a thumbnail for the movie?

thanks a lot
any help is greatly appreciated
dave

macemoneta 04-13-2005 11:39 PM

Video encoding is extremely CPU intensive, but for your situation you can run it as a lowest priority process (so it only uses idle CPU time).

There are multiple utilities that can do the job for you on Linux (choice is good :) ). For example:

ffmpeg
transcode
mencoder (part of the mplayer package).

Documentation and tutorials are on each respective site.

dtra 04-14-2005 12:06 AM

hey thanks mate
i'll see what i can make of each
and which will suit us best, or whatever we can get going

dtra 04-14-2005 01:18 AM

ok, i got ffmpeg installed and sorta working
i just installed it default everything
./configure, make, make install

i tried to just convert a simple .mov to mp4 with
ffmpeg -i /export/downloads/sc01.mov -b 150 /export/downloads/sc01.mp4
but it said unsupported codec for output stream

and to wmv
ffmpeg -i /export/downloads/sc01.mov -b 150 /export/downloads/sc01.wmv
that worked but when i try to play it in windows media player it says unkown video codec

what am i missing here, do i need to rebuild ffmpeg with some extra codecs configured?
i was able to convert simply from .mov to .mpg, not sure which codec it used (default i guess)

any help
dave

macemoneta 04-14-2005 01:42 AM

Try specifying the output format, instead of letting it default based on extension:

ffmpeg -i /export/downloads/sc01.mov -b 150 -f mp4 /export/downloads/sc01.avi

For a list of supported formats:

ffmpeg -formats | less

I usually use pre-built binaries, so I haven't had to check the build options. For an old release like RH9, that's not really an option, since the prebuilt binaries are very old. There's usually a help option to list the build options:

./configure --help

dtra 04-14-2005 02:05 AM

thanks for the tip

i tried -f mp4 output to mpg, avi, mp4
but it said unsupported codec for output stream
don't all the codecs come with the source
if not, where can i download them from?

also, i tried this from the ffmpeg site
try '-f image -img jpeg test%d.jpg'
but it says unkown image format: 'jpeg'?

does anyone know of a good resource site for this, eg. tutorials, forums?

dave


All times are GMT -5. The time now is 11:50 AM.