hi,
i have to play video files like avi,wma and etc.
For that i want to create the application in flex.
i created video player in flex. it support only flv files. but i need to play all the formats. is there anyway to create the application like this.
it may be component or using any api or whatever the things . jus i have to play various format video files in flex application.
already you told that, we can't embed vlc player.
but is there anyother way to develop this appllication.
Hi,
So far I have not seen a avi player in flex.
I think theoretically it would be possible to write a video decoder for different formats but the question is wherher the flash palyer is fast enough to decode it in real time.
I think the only practical solution to this is to transcode the files on the server and then play the transcoded flv.
FFMEG is a nice and simple tool to convert formats... http://ffmpeg.org/
You could of course use any of the streaming server systems such as Red5, Adobe media server, Wowza media... but these are (except Red5) commercial solutions and more targeted at massive live video streaming. I don't know what you need actually. If you need live streaming then you should take a look at one of those commercial solutions. Wowza (http://www.wowzamedia.com/) is perhaps the most simple to use and out of the box solution, the other two require more work to be done.
I'm also not sure but I think only wowza support format transcoding, for the other two I think you'll stil need FFMPEG or similar.
If you just need to play pre-recorded video files, then just convert them by a standard converting program... flash media encoder, Riva FLV encoder (I think there is a Live version which is free).
If you need to play video which user uploads or something like that, then just do a file upload, convert it on the server using ffmpeg and then download it or stream it back to the flex app.
I hope it helps.
Cheers
Well,if this is going to be a web application, then you have to use the flash file upload capability (this is FileReference class), convert it on the server using ffmpeg and then send or stream it back to the browser.
FileRefernce is a mechanism which allows you to select a file using standard OS file dialog, then you can send as http header to the server.
Server receives it and saves it as a file.
Then you can run a shell command and execute ffmpeg which will create a new file somewhere on the server filesystem.
Then you can send back the URL of the new file.. flex/flash app can then either directly stream the video and play it or prompt the user to save the file.
For using FileReference check out the documentation:
http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html
there are also many examples out there, just google it.
Personally I dont have many experience with ffmpeg, but if you google for "converting flash video with ffmpeg" or something like that you'll get many examples. Check also the oficial ffpeg site and read the documentation. Play with it locally from your command line and when you get familiar with it try to automate its running with php and then you are almost there.
FFmpeg is simple as:
ffmpeg -i mymovie.avi mymovie.flv
Its all do-able in one day even with no experience.
North America
Europe, Middle East and Africa
Asia Pacific