Adobe Flex Streaming Capabilities

I am evaluating Adobe Flex Builder 3 as a solution for our video streaming interface. I am using Flash Media Server to do the actual streaming. Our goal is to be able to streaming videos in .flv, and .mp4 .m4v, etc formats. Through preliminary test we were able to streaming the .flv files over RTMP without any issues using the VideoDisplay component packaged with Flex . However the .mp4 and .m4v files are not streaming.

These are the formats that have worked with the .flv files
rtmp://(streaming server)/vod/AdobeBand_640.flv
rtmp://(streaming server)/vod/AdobeBand_640

These are the formats we have tried and failed with the .mp4 files:
rtmp://(streaming server)/vod/AdobeBand_1500K_H264.mp4
rtmp://(streaming server)/vod/mp4:AdobeBand_1500K_H264.mp4
rtmp://(streaming server)/vod/mp4:AdobeBand_1500K_H264

Since we had success streaming all the aforementioned formats using the FLVPlayBack component in Flash CS3 Professional, we have also tried installing this component in Flex. We again were able to stream the .flv files but not any other formats. It is essential for this project to be able to stream the H264 files. Is Adobe Flex capable of streaming H.264 files by any means? If so, please provide a small example or link to a viable solution. Any information is appreciated.
will110Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
asaivanConnect With a Mentor Commented:
Well, I guarantee you that you CAN indeed stream h264 files from Flex.  Totally.  I'm doing it myself.  My guess is that you have set up something incorrectly in FMS regarding the h264 streaming content.  I noticed you are using the default vod app folder, I've never used this, so I don't know if it's the problem, but my suggestion would be to set up your own virtual directory in FMS, and add a different application to the applications folder.  e.g:

First, take that file main.txt, rename it to main.asc (they wouldn't let me upload it otherwise), put it in a new folder under the applications folder called "video".

Go to your FMS conf/_defaultRoot_/_defaultVhost_/Vhost.xml file.

Then go to the <VirtualDirectory> tag.  Add this line inside:

 <Streams>general;SOME ABSOLUTE PATH TO YOUR VIDEO FILES</Streams>

Then restart FMS.  The above path should something like C:\Videos\streams if on Windows, if your on Linux, then something like /var/streams (make sure permissions are set on Linux). Put those MP4s your trying to stream in that folder.

Then in your RTMP string you would have:

rtmp://192.168.168.10/video/mp4:general/AdobeBand_1500K_H264.mp4

Give it a shot.
main.txt
0
 
asaivanCommented:
Only Flash Media Server 3 can do h264.  Are you using FMS3?

Flex is capable of doing video, of course. Using the VideoDisplay component, you simply supply the source URI (like you have above) to the source property of a VideoDisplay component (but there are other alternatives)

http://livedocs.adobe.com/flex/3/html/help.html?content=controls_17.html

0
 
will110Author Commented:
I am using Flash Media Server 3. I am able to stream the H264 files using Flash CS3 Professional, but not Flex Builder 2 or 3.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
asaivanCommented:
Can you fill me in on what your set up is in Flex?  Can you post your code?
0
 
will110Author Commented:
Here is a sample of the code we are using. The hint I'm getting that Flex only streams .flv files is that the error message I get when clicking my pause and play controls states that it cannot find the "flv" on the server. Which kind of indicates to me that it is only looking for .flv files. Have you successfully streamed H264 files using Flex and FMS?
<mx:VideoDisplay x="10" y="10" width="346" height="257" id="vdeo" source="rtmp://192.168.168.10/vod/mp4:topic644(s_b_vid).mp4"  autoPlay="false" cuePointManagerClass="mx.controls.videoClasses.CuePointManager"/>

Open in new window

0
 
asaivanCommented:
Yes, but I've not done it using the VideoDisplay component.  Do you know how to export a Flash CS3 MovieClip as a SWC?

You would create an empty MovieClip, call it VidPlayer.  Drag a FLVPlayback component to it, call the instance name "vid", or whatever.  Then in the Flash Library, right click it and export it as a SWC file.  Take the exported SWC file and put it in the Flex 'libs' folder, this will automatically import it into your Flex project.

Then you can access the SWC via MXML.  If your MovieClip was called VidPlayer, then in MXML you would be able to do something like:

<local:VidPlayer width="500" height="500">
        <local:vid>
		<video:FLVPlayback source="rtmp://blablabla" />
	</local:vid>
</local:VidPlayer>
 
//Make sure you have you skin SWF in the same directory as the output directory

Open in new window

0
 
will110Author Commented:
I have tried using the FLVPlayback by adding it as a component in Flex. The results I received were the same as using the VideoPlayback in that the MP4 files did not stream. Only the FLVs. Have you had success streaming any H264 file using VideoPlayback in Flex?
0
 
asaivanCommented:
Yes.  Perhaps this code will help:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" xmlns:video="fl.video.*"
 creationComplete="init()">
 
		
	<mx:UIComponent id = 'foo'/>
	<mx:Script>
		<![CDATA[
			private var vidPlayer:VidPlayer = new VidPlayer();
			
			private function init():void
			{
				foo.addChild(vid);
				
				vidPlayer.vid.source = "rtmp://blablabla";
			}
		]]>
	</mx:Script>
 
</mx:Application>

Open in new window

0
 
will110Author Commented:
I tested the code below and received this error:

VideoError: 1000: Unable to make connection to server or to find FLV on server
      at fl.video::VideoPlayer/play()
      at fl.video::FLVPlayback/play()
      at PlayerTest/__btnPlay_click()[C:\Documents and Settings\tester\My Documents\Flex Builder 3\VideoPresentationProject\src\PlayerTest.mxml:17]
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" creationComplete="init();">
	<mx:Script>
		<![CDATA[
			
			private var player:FLVpb = new FLVpb();
			private function init():void{
				foo.addChild(player);
				player.pb.source = "rtmp://192.168.168.10/vod/mp4:AdobeBand_1500K_H264.mp4";
				
			}
		]]>
	</mx:Script>
	<mx:UIComponent id="foo"/>
	<mx:HBox>
		<mx:Button id="btnPlay" label="Play" click="player.pb.play();"/>
		<mx:Button id="btnPause" label="Pause" click="player.pb.pause();"/>
	</mx:HBox>
	
</mx:Application>

Open in new window

0
 
asaivanCommented:
Are you sure you have your rtmp string correct?  It makes no difference whether you compile in Flash or Flex with the FLVPlayback component.  
0
 
will110Author Commented:
I have redone all steps in adding flvplayback. Again it seems the flvs play fine but not the mp4. I'm worried I might be entering the rtmp string incorrectly also. Do you know of a live rtmp address that links with an h264 file that I can test? I really need to know for sure if I can stream the h264s from flex.

0
 
will110Author Commented:
Thank you for your help. I tried all the steps you listed, and though it still did not resolve the issue it did show me an alternative way of setting up my FMS. In the end I was able to get it to work by using rtmpe:// instead of rtmp://. Im not sure the reason for one worked over the other, but I'm relieved. Thanks!
0
 
asaivanCommented:
Great, I'm glad you got it working. :)
0
All Courses

From novice to tech pro — start learning today.