Skip to main content

Report a bug

Select a community

Choose the Adobe product you’d like to report a bug for. Bug reporting is only available for these communities.

Inspiring
November 6, 2006
Question

Publishing and receiving a webcam broadcast

  • November 6, 2006
  • 3 replies
  • 323 views
I have Flash Media Server 2 installed, and would like to write an application whereby two people can chat one on one.

Now, I don't want to use simpleconnect, as I'd like to integrate this into an existing website with it's own authentication methods.

I've been attempting to get it working, but although I can get the local webcam displaying fine, and can even tweak the quality etc., I can't for the life of me get it published remotely.

If anyone has any pointers, that'd be great.

So far with regard to the video publishing part of it, I've come up with:

quote:


localCam = Camera.get();
localVideo.attachVideo(localCam);

sConn = new NetConnection();
sConn.connect("rtmp://localhost/1", "test");
lStream = new NetStream(rConn);
lStream.publish(localCam);






Also, am I right in thinking that to retrieve a webcam stream from the rtmp source, I would have to use http://host/appinstance/clientid ?

Or would this not be the way?
    This topic has been closed for replies.

    3 replies

    seraerieAuthor
    Inspiring
    November 7, 2006
    Hmmm now I've got a problem with video quality. I've set the broadcast video to be the maximum the webcam supports 1.3mpx. My local preview embedded video though is 160x320, with the remote display being at 320x240. On the receiving end though the video is displayed at the right size (320x240) however it appears to be a 160x120 stream stretched to the proper size...

    Any idea why this is happening?
    seraerieAuthor
    Inspiring
    November 7, 2006
    Thanks a lot mm_patrick. That's pointed me in the right direction. Hopefully I can get at least most of the way there without bothering you again :)
    November 6, 2006
    Have you checked out the samples on devnet? You should find everything you need there.

    Why are you using rConn instead of sConn to establish your netstream?
    sConn = new NetConnection();
    sConn.connect("rtmp://localhost/1", "test");
    lStream = new NetStream( rConn);
    I think this was just a typo.
    When you publish, give it a name:
    Instead of using: lStream.publish(localCam);
    do lStream.publish(username); // where username is a string
    Check out the flashmediaserver_cs_asd.pdf, page 102.

    Also, currently you don't care whether or not the connection has been established. Make sure you wait before you create your Netstream on top of the connection. There is a great article on how to build such an application on Adobe Devnet:
    http://www.adobe.com/devnet/flashcom/articles/broadcast_receiver.html

    To build a 2-way chat you would also have to put both users in the same "room". The easiest way to achieve this is to create new application instances for each new user pair, then connect to with rtmp://host/application/new_instance _name and play the video of the other user.

    There's some information in article http://www.adobe.com/devnet/central/articles/vchat_04.html
    This article is about how to build a 2-way video chat w/ central, but you can possibly strip out that code.

    Instead, I recommend having a look at the docs, i.e. flashmediaserver_cs_asd.pdf to be found in your documentation directory.