views:

267

answers:

1

I am developing a web-application in grails.In that I have implemented video's playing option.For playing video I used the flashplayer plugin .It is working.Now I am planning to implement the feature that user's also can upload their video's.After uploading the video files how to convert those video files to .flv format?

or

Does flash player plays all the video formats?I tried with .wmv file .It is not working.

Can anyone provide help on this?

Thanks

+6  A: 

Flash can only play FLVs, and h.264 encoded videos (e.g. mp4, f4v). You can convert video into any of these formats using FFmpeg. If you're using Windows, you can get some pre-built binaries here.

Sample command-line that should convert inputfile.avi to an flv with an audio bitrate of 48kbps, and a video bitrate of 224kbps (might need to substitute libmp3lame for mp3 depending on version of ffmpeg):

ffmpeg -i inputfile.avi -s 640x480 -y -f flv -acodec mp3 -ac 1 -ab 48k -b 224k -ar 22050 outputfile.flv

Sample for h.264 / aac:

ffmpeg -i inputfile.avi -s 640x480 -y -f mp4 -vcodec libx264 -acodec libfaac -ab 48k -b 224k -ar 22050 outputfile.mp4
Rhys Causey
Great! Do you also have an example to convert to h264?
Luke
Awesome. Thanks a lot!
Luke