-   Linux - General (
-   -   converting all kind of videos to flash ( FLV (

zafar466 07-25-2008 03:51 AM

converting all kind of videos to flash ( FLV
I need to setup a way for converting all kind of videos to flash ( FLV ) format on linux . can youe please tell me the best way to do it.


jschiwal 07-25-2008 05:17 AM

You probably could use mencoder. If mplayer can play the file, you probably won't need to have input parameters configured for each file, because mencoder should be able to set them automatically. That means that you need to configure the video and audio output parameters which might be the same since you want to convert the video to flash. So after figuring out the arguments you need to do the conversion, you can write a script that calls mencoder with the same arguments. Then you could simply run your script and the input filename: toflash video.avi

Look in the info bash manual. There are parameter expansions that you can use so set a variable to a default if it isn't supplied as an argument:


jschiwal@hpmedia:~> echo ${bitrate:=$((500))}
jschiwal@hpmedia:~> unset bitrate
jschiwal@hpmedia:~> echo ${bitrate:=$((500))}

Also look at the getopts command. It allows you to write wrapper scripts that take arguments with values. For example, suppose you want to convert the video to one of three sizes. You could have an option -s that takes either "small", "medium" or "large" as arguments, so then you could call the command like:
toflash -s small avideo.mpg

Using defaults and optional arguments you can call a wrapper script with only the filename or you could apply special arguments when you don't want to use your own defaults.

All times are GMT -5. The time now is 07:54 PM.