media conversion library
I am building a mo开发者_StackOverflow中文版bile website were users can upload/download videos, and I need a library that can convert the media files from mpeg, 3gp, mov depending on what the user wants to download.
Do you happen to know a a library that can do this?
You should not only search for Library to do this, if you are using linux you can find an application that do this for you with CLI support,then using that application cli you can change your format;
$result=shell_exec('application_name [parameters] input-file output-file')
for example you can use ffmpeg
$result=shell_exec('ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg')
ffdshow is a great lib for that.
libavcodec to be more precise.
Use FFmpeg gem in Ruby, it's really cool and easy to use.
Or if you want something to use directly from Java, try Xuggler, a Java-based interface to FFmpeg.
Take a look at FFmpeg. You could use as a command line tool.
In the past, I ran VLC from the command-line and used it to do my conversions (it's free, supports nearly all audio and video formats, and works on many different platforms). If you have VLC installed on the server, you can access it this way using any language that has a system()
command or equivalent.
精彩评论