[Red5] Flash - NetStream - onImageData Problem
Mondain
mondain at gmail.com
Mon May 11 10:09:55 PDT 2009
Walter,Yes its possible, i've sent slides to FP from an AIR app while
broadcasting Audio and Video.
Paul
On Mon, May 11, 2009 at 9:27 AM, Walter Tak <walter at waltertak.com> wrote:
> Paul that was exact my idea ; ddprasad probably wants to extract
> snapshots from a stream using the onImageData but afaik that is not
> possible.
>
> Would it be possible to inject images/bytearrays more often than just at
> the start of a stream ?
>
> I was thinking about injecting high-resolution images from presentations
> (like powerpoint etc) while a relative low-resolution stream
> is playing contiously , showing the head of a speaker at a convention, for
> example.
>
> Walter
>
>
> Red5 can do onImageData, there is an example here:
> http://red5.googlecode.com/svn/flash/trunk/player4/src/functions.as
>
> With the onImageData event originating from the MP3 reader here:
>
> http://red5.googlecode.com/svn/java/server/trunk/src/org/red5/io/mp3/impl/MP3Reader.java
>
> However, I think the original poster does have a misconception about what
> this feature actually does.
>
> Paul
>
> On Mon, May 11, 2009 at 4:30 AM, Walter Tak <walter at waltertak.com> wrote:
>
>> "The onImageData event object contains the image data as a byte array sent
>> through an AMF0 data channel."
>>
>> Afaik you need to inject image-data on the server into the stream
>> "manually". It's not meant to grab frames from a normal stream.
>>
>> Possible it could be done (with FMS2/3) like on this example page that
>> shows how to send custom metadata to your clients:
>>
>>
>> http://www.adobe.com/livedocs/flashmediaserver/3.0/hpdocs/help.html?content=00000190.html
>>
>> e.g:
>> ns.send("@setDataFrame", "onMetaData",
>> metaData);orns.send("@setDataFrame", "onImageData",
>> your_byte_array_containing_an_image);on the server (!).
>>
>> Afaik Red5 can't inject data in the stream. See also this discussion from
>> dec 2008:
>>
>>
>> http://www.nabble.com/IVideoStreamCodec-addData()-can-I-send-it-a-bytearray--td20864818.html
>>
>>
>>
>> You are correct onImageData,onCuePoint etc is not there. Only onMetaData
>>> is
>>> there.
>>>
>>>
>>> Gavriloaie Eugen-Andrei-2 wrote:
>>>
>>>>
>>>> One last idea... Open the flv with a hex editor and look around for
>>>> the onMetaData, onCuePoint, onImageData and onTextData. As far as I
>>>> know, onMetaData should be in the flv itself. I'm not sure about the
>>>> rest, especially onCuePoint.
>>>>
>>>>
>>>> On May 11, 2009, at 12:10 PM, ddprasad wrote:
>>>>
>>>>
>>>>> I rectified the variable initialization. But it is still not
>>>>> working. Please
>>>>> check the code. Only OnMetaData1() is working.
>>>>>
>>>>> --
>>>>>
>>>>> package {
>>>>> import flash.display.*;
>>>>> import flash.net.*;
>>>>> import flash.media.*;
>>>>> import flash.system.*;
>>>>> import flash.events.*;
>>>>>
>>>>> public class OnTextDataExample extends Sprite {
>>>>> var my_nc:NetConnection;
>>>>> var my_ns:NetStream;
>>>>> var client:Object = new Object();
>>>>> public function OnTextDataExample():void {
>>>>> client.onMetaData = onMetaData1;
>>>>> client.onCuePoint = onCuePoint1;
>>>>> client.onImageData = onImageData1;
>>>>> client.onTextData = onTextData1;
>>>>> my_nc = new NetConnection();
>>>>> my_nc.connect(null);
>>>>> my_ns = new NetStream(my_nc);
>>>>> my_ns.play("Clocks.flv");
>>>>> my_ns.client = client;
>>>>> var my_video:Video = new Video();
>>>>> my_video.width = 400;
>>>>> my_video.height = 300;
>>>>> my_video.attachNetStream(my_ns);
>>>>> addChild(my_video);
>>>>> }
>>>>>
>>>>>
>>>>> public function onMetaData1(info:Object):void {
>>>>> trace("onMetaData");
>>>>> }
>>>>> public function onCuePoint1(info:Object):void {
>>>>> trace("onCuePoint");
>>>>> }
>>>>> public function onImageData1(info:Object):void {
>>>>> trace("onImageData");
>>>>> }
>>>>> public function onTextData1(info:Object):void {
>>>>> trace("onTextData");
>>>>> }
>>>>> }
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>> Gavriloaie Eugen-Andrei-2 wrote:
>>>>>
>>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I think I've miss-leaded you. I think your var my_nc:NetConnection =
>>>>>> new NetConnection(); will be destroyed upon function exit. Is a local
>>>>>> variable
>>>>>>
>>>>>>
>>>>>> On May 11, 2009, at 11:38 AM, ddprasad wrote:
>>>>>>
>>>>>>
>>>>>>> Sorry boss, It didnot work for me. Can you please elaborate. I stuck
>>>>>>> with
>>>>>>> this issue for more than 5 days.
>>>>>>>
>>>>>>>
>>>>>>> Gavriloaie Eugen-Andrei-2 wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Try
>>>>>>>>
>>>>>>>> my_ns.client = this;
>>>>>>>>
>>>>>>>> On May 11, 2009, at 8:06 AM, ddprasad wrote:
>>>>>>>>
>>>>>>>> my_ns.client = customClient;
>>>>>>>>>
>>>>>>>>
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>
>
>
> --
> http://gregoire.org/
> http://osflash.org/red5
>
> ------------------------------
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
> ------------------------------
>
> Internal Virus Database is out-of-date.
> Checked by AVG.
> Version: 7.5.557 / Virus Database: 270.12.11/2089 - Release Date: 4/30/2009
> 5:53 PM
>
>
> ------------------------------
> I am using the Free version of SPAMfighter<http://www.spamfighter.com/len>
> .
> We are a community of 6 million users fighting spam.
> SPAMfighter has removed 624 of my spam emails to date.
> The Professional version does not have this message.
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
--
http://gregoire.org/
http://osflash.org/red5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090511/65734c3a/attachment-0001.html>
More information about the Red5
mailing list