3

So, I'm working with a video source that I'm feeding into my Adobe AIR application via some native extension work, with the goal of ultimately getting it to a Flash Media Server. The video is H.264 encoded and muxed into a FLV container, which aligns me with supported Flash Media Server codecs and NetStream (appendBytes) requirements. I can get the data into AIR just fine.

The mine I stepped onto today, however, is that documentation for NetStream.appendBytes states I must call NetStream.play(null):

Call this method on a NetStream in "Data Generation Mode". To put a NetStream into Data Generation Mode, call NetStream.play(null) on a NetStream created on a NetConnection connected to null. Calling appendBytes() on a NetStream that isn't in Data Generation Mode is an error and raises an exception.

NetStream.play() called with a null parameter yields local FLV playback. I can't publish the stream to FMS in this mode. But my research into Flash seems to indicate NetStream's byte access is my only real hope here when dealing with non-camera or non-web video data.

Q: Can I latch onto the video playback buffer for publish to a FMS? Can I create a sort of pipeline of NetStreams or NetConnections to achieve this? Or is there an alternate approach here for transmitting H.264/FLV data to FMS? (The source of my video cannot communicate with FMS directly.)

Rafael Rivera
  • 871
  • 8
  • 22
  • In light of the answer, I decided to try my hand at convincing management to dump Flash Media Server and go Wowza with RTP as our transport. (No need for the AIR wrapper.) – Rafael Rivera Mar 11 '12 at 09:24

1 Answers1

2

The answer to your question is quite simply no. This is apparently implemented as a security feature, which is probably less of a security based issue and more of a sales issue. Adobe likes to block certain capabilities intentionally in order to create the possibility of, or need of another product aka more revenue.

I tried looking into this for you to see if there was some dirty hack where you could attach a camera or something and override the binary data being sent to the stream like you can with Audio but unfortunately, to my knowledge, no such hack is possible. More nfo here: NetStream.appendBytes

Update

You might be able to do something hackish by using ManyCam which is a virtual webcam driver (from what I understand). This will provide a valid camera you can select from flash and you can also select a video file as the source file for ManyCam. See http://manycam.com/user_guide/#HowtoSelectaVideofileasthePictureSourceforManyCam

Update #2

If you're looking for something open source that will do the same thing as manycam, check out the following:

http://code.google.com/p/webcamstudio/wiki/VideoSourceMovie (GPL Licensed)

Community
  • 1
  • 1
  • Looks like I may have to investigate implementing a fake camera device on Windows. Or perhaps abandon AIR completely and use a third-party FMS client library. Yikes either way. Is there an Adobe product that /does/ do this that I could perhaps "take a look at"? – Rafael Rivera Mar 10 '12 at 05:41
  • Not sure but... your idea about a virtual device on windows might not be such a huge undertaking I hadn't thought of that. It's stuff like this that made me just quit flash and learn C++. I love the flash platform I think it has a ton of potential but after nearly 6 years as a flash developer, I couldn't handle getting my hopes up with great ideas only to find stupid crap like this here holding me back. –  Mar 10 '12 at 05:52
  • Regarding the virtual device option, see http://stackoverflow.com/questions/1627448/virtual-webcam-driver and http://stackoverflow.com/questions/1137540/connecting-windows-driver-to-userland-service –  Mar 10 '12 at 05:55
  • 1
    Yeah I hate ManyCam, it's a piece of junk. Will look at the GPL option although am ultimately trying to go the commercial route. If you don't mind, I'd like to leave this question open for a day or so in hopes of any other solutions. – Rafael Rivera Mar 10 '12 at 07:14
  • No problem. I did some more digging but couldn't find anything else that wasn't GPL. If I come up with anything I'll post back. –  Mar 10 '12 at 07:24
  • I'm curious to see what Adobe's official answer is to this? Is it Flash Media Encoder? Perhaps me asking folks to switch FMS for Wowza is in order... – Rafael Rivera Mar 10 '12 at 07:44