How to play audio/video files in flex? - apache-flex

I'm using flex 3.
I've successfully played video and audio files by using following libraries:
flash.media.Video
flash.media.Sound
Live docs link.
But the limitations are as follow:
Video class can be used to play only flv file format.
To play mp3 files I must use audio file.
So can I play most of the famous audio/video files by using single method?
Well by checking the file type we can some how achieve it. Then I should create a component for that.
So can any one suggest me such ready-made components? or is there any other alternatives to play audio/video files?

You want to play any video/audio formats in flash? (Almost) impossible. ActionScript libraries will not help you - ActionScript has not enough power to decompress video in realtime. Maybe this is possible with Alchemy, but I haven't seen codecs implemented this way... Usually, people are converting their content to FLV which is played by Flash player natively.

Related

how to achieve audio preloading in qt

I'm trying to use QMediaPlayer and QMediaList to play streaming audio. I want to add an audio preloading feature to my application, but I have no idea how to do it.
I have several questions here.
When does the audio loading happended? Does it happened when calling QMediaPlayer.play or QMediaList.addMedia?
Do QMediaPlayer or QMediaList do preloading in their implementations?
If QMeidaPlayer and QMediaList haven't implemented preloading, what can I do to add this feature? Does Qt support any methods to do audio loading outside qt but do audio playing in it?

Base64 encoder library download assitance

I am referring to Send image from flash to Asp.net for sending image captured by a webcam to an asp.net page. However I need to download base64 encoder to proceed. The link the user provided for downloading it seems to be broken. Can anyone tell me how I can download the base64 encoder?
This is the fastest Base64 implementation in Flash today: http://www.blooddy.by/en/crypto/ it's about order of magnitude faster then Adobe's libraries. It is written using so called Alchemy opcodes.
There was an interesting attempt at improving AS3-only Base64 algorithm here: http://jpauclair.net/2012/01/12/updated-the-optimized-bas64-library/ . It would probably win in the long run because of maintenance. Adobe has decided to change the old "Alchemy opcodes" in the new player versions, and the author of the blooddy library is no longer actively working on it.
I believe Flash has inbuilt an base64 encoder and decoder. See
mx.utils.Base64Encoder
mx.utils.Base64Decoder
Also, the AS3Crypto library has Base64 utilities.
I don't know what is being done in the reference you gave, but between these 3 resources, you should get what you are looking for.

capture video and audio from webcam locally?

I'm writing a flex 4.5 application that's supposed to capture a video from a webcam and audio from microphone and save it in some video format (i don't care which format).
I use VideoDisplay to display the webcam. how can I fetch and play audio in real time ?
Is there a way to save the video locally without using a flash media server?
Flash/Flex does not have video encoding capabilities. You will need to send to a server for the encoding.
Sorry, I know this isn't good news. :\
You can check with the red5Recorder which is a player built using flex builder and configurable to any recorder like Red5 server or Flash FMS. You can check with the open source code to understand that.

How to record Audio and Video at the same time into flv in Adobe air 2.0?

How to record Audio and Video at the same time into flv in Adobe air 2.0 ? So that Video and Audio will be sinchronised?
Open Source libs and
Blog aricales are wellcomed!)
All I can help with are a few links, but I haven't tried this to know how feasible it actually is:
Audio - Recording record microphone to wav devnet article or devnet cookbook article.
Audio - Compression - MP3 Compression with Lame and AIR 2.0 or MP3 encoder in Flash with Alchemy
Video - SimpleFlvWriter.as is a bit outdated and only writes images, not audio, but might be handy to get started. Also have a look at the FLV Specs.
At this point it looks like trouble waiting to happen:
Where do you store the images/sound until you write encode them ? in RAM ?
If you want to cache uncompressed files, will there be audio delays ?
It might be worth trying something different, like C++.
Or at least, write some command line tools for recording/encoding for performance
reasons and use AIR/native process just for the looks/interaction ?
HTH

What are effective options for embedding video in an ASP.NET web site?

A quick glance at the present-day internet would seem to indicate that Adobe Flash is the obvious choice for embedding video in a web page. Is this accurate, or are they other effective choices? Does the choice of ASP.NET as a platform influence this decision?
Flash is certainly the most ubiquitous and portable solution. 98% of browsers have Flash installed. Other alternatives are Quicktime, Windows Media Player, or even Silverlight (Microsoft's Flash competitor, which can be used to embed several video formats).
I would recommend using Flash (and it's FLV video file format) for embedding your video unless you have very specific requirements as far as video quality or DRM.
Flash is usually the product of choice: Everyone has it, and using the JW FLV Player makes it relatively easy on your side.
As for other Video Formats, there are WMV and QuickTime, but the players are rather "heavy", not everyone might have them and they feel so 1990ish...
Real Player... Don't let me even start ranting about that pile of ...
The only other alternative of Flash that I would personally consider is Silverlight, which allows streaming WMV Videos. I found the production of WMV much better and easier than FLV because all Windows FLV Encoders I tried are not really good and stable, whereas pretty much every tool can natively output WMV. The problem with Silverlight is that no one has that Browser Plugin (yet?). There is also a player from JW.
One consideration would be whether video playback is via progressive download or streaming. If it's progressive download, then I would say use Flash because you get a wider audience reach.
For streaming wmv, it is out of the box functionality provided by Windows Media Services
For streaming flash, you will have to install a streaming server on your Windows box. Some options are:
Adobe Flash Media Server (Commercial)
Wowza Media Server (Free/Commercial)
Red5 Flash Server (Open Source)
If you have access to Microsoft Expression Encoder 2, you can use that to encode a video file and generate a Silverlight video player. Then if you have IIS 7, you can use Adaptive or Smooth Streaming also checkout Smooth HD for a really cool example.
You can also do streaming from the free Microsoft Silverlight Streaming Service. It's connected to a Windows Live account.
A consideration is that the client will need to have Silverlight installed, just like Flash, but Flash has been around longer.
<object width="660" height="525"><param name="movie" value="http://www.youtube.com/v/WAQUskZuXhQ&hl=en&fs=1&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WAQUskZuXhQ&hl=en&fs=1&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="660" height="525"></embed></object>
I have worked for a company that developed a system for distributing media content to dedicated "players". It was web based and used ASP.NET technology and have tried almost every possible media format you can think of and your choice really comes down to asking yourself:
does it needs to play directly out of the box, or can I make sure that the components required to play the videos can be installed beforehand?
If your answer is that it needs to play out of the box then really your only option is flash (I know that it is not installed by default, but most will already have it installed)
If it is not a big issue that extra components are needed then you can go with formats that are supported by windows media player
The reason why windows media player falls into the second option is because for some browsers and some formats extra components must be installed.
We had the luxury that the "players" were provided by us, so we could go for the second option, however even we tried to convert as much as possible back to flash because it handles way better than windows media player
"Does the choice of ASP.NET as a platform influence this decision?"
Probably not.

Resources