Client.videoSampleAccess False-Negative

In past versions of FMS, developers were barred from accessing raw audio and video data over RTMP and had to resort to a number of hacks and proxies to get around the restriction.  As time went by and new versions of the Flash Player were released, a lot of these loopholes were blocked as well.

With FMS3, there is Client.videoSampleAccess: a property of the Flash Media Server 3 that allows direct access to raw stream data for video use (“audioSampleAccess” for audio).  This can be used for things like producing visual audio spectrums or grabbing a still from a video stream.  It is applied within the onConnect method of the Application server class as demonstrated here:

1
2
appClient.audioSampleAccess = "/";
appClient.videoSampleAccess = "/";

In the above example, the “/” signifies that any streams within the application directory are allowed to be sampled in this way.  You can also specify a semicolon-delimited list of folder names instead if you need to be picky.

Something I came across today and the whole point of this post: even when you have Client.videoSampleAccess set up properly on Flash Media Server, you will still receive a security sandbox violation error #2123 if the stream data is not available.  This can easily happen if you have a timer invoking BitmapData.draw every few milliseconds on loading content.

One way to get around this is using NetStatusEvent.NET_STATUS making sure it reports “NetStream.Buffer.Full” before attempting to access the stream data.  Depending on what you are doing, you can oftentimes check the object recieving the stream data to be sure it is accessible first.  this all seems really obvious now, but threw me for a bit of a loop, initially.

Flash Media Interactive Server 3

We’ve been running Flash Media Interactive Server 3 for over two weeks now on one of our media servers and I couldn’t be happier with the results. I was going to put off the upgrade from FMS2 for a few months while testing and waiting on a point release, but after having so many issues with FMS2 and with the security patch released last week, decided to just push ahead.

I’d recommend anyone having weird issues with FMS2 to upgrade as soon as you possibly can. It only takes about 15 minutes and will preserve all your current applications. I did need to update some of my client SWFs- but only because of how much more accurate this new version is.

While I had to continually monitor FMS2 for various problems, this new server has been nothing but stable, fast, and just a great performer all-around! I am honestly so pleased with the results that I want to give a general ‘thanks’ to the team involved in this latest release. You have taken a load off my shoulders!

Remoting through Flex with Coldfusion

I’m used to setting the ObjectEncoding to AMF0 when working with Flash Media Server 2, but haven’t realized till now that I also am required to do this when communicating with Coldfusion 8 through remoting:

1
2
3
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;

The error “Unknown object type tag (17)” was being generated by CF8 as I attempted to pass an Object in AS3 over remoting to CF8 interpreted as a Structure. Apparently, there is also the need to wrap any such Object within a container Object for it to be properly read by the CFC:

1
2
3
4
var wrapper:Object = new Object();
wrapper.submissionObject = submissionObject;
submissionResponder = new Responder(onSubmissionResult, onSubmissionError);
testConnection.call("some.cfc.Test", submissionResponder, wrapper);

The CFC function expects a Structure named “submissionObject” in this case.

I hope this is helpful for someone- I had a hell of a time digging up this information.

Flash Media Server 3 Announced

I really, really hope that one of the improvements is a better security model when it comes to RTMP security restriction when accessing byte-level data…

PLEASE, Adobe…

Allow developers to access RTMP streams via BitmapData.draw() and SoundMixer.computeSpectrum()… please!

Features important to my projects include:

  • Improved performance
  • H.264 and AAC streaming support
  • New security features
  • Improved live video support
  • Tracking

Read more at the FAQ:
http://www.adobe.com/aboutadobe/pressroom/pdfs/FMS3FAQ.pdf

Red5: Nice Alternative to Flash Media Server

I’ve put off experimenting with Red5 until today as I’m quite happy with Adobe’s solution (Flash Media Server) and Red5 is still deep in beta-land at the time of this writing.

I was able to install the server on Windows Vista and had a custom FLV stream piggybacked in a preconfigured sample application directory running in about 40 minutes. The structure is not entirely different from FMS, but is drastic enough to cause me a bit of confusion. For example, with FMS applications, you have an application directory within which are normally a “main.asc” file to configure the app, and a “streams” folder which contains any media content. With Red5, it seems there is a bit more to it: a variety of different files/filetypes to configure and very little documentation on how to start a simple video stream from scratch. In fact, I could not get anything going myself, and had to resort to a piggyback approach using a preconfigured application directory.

Aside from the initial confusion, I do see Red5 as a great product and attribute most of my difficulties to differences in the FMS framework. I’ll probably continue to experiment with the current release but am hoping for better documentation in the future. When this server reaches 1.0, I would love to give it another shot!