Groups | Blog | Home
all groups > macromedia flash flashcom > may 2005 >

macromedia flash flashcom : publish a local flv


TheBimmer
5/19/2005 8:21:49 AM
Hi again,

Well, this is the issue... I cant play a local flv unless I issued the
command: nc.connect(null) ... obviously, I will not be able to publish my
stream in this case.

When my connection is connected to a valid rtmp, e.g.:
nc.connect("rtmp://localhost/myApp"); then I cant play a local flv.

Some people said that this cant be done. But I don't think so! As long as we
can play and publish a live stream through the camera object, then we can pass
any stream! The idea is how to pass a local stream as a camera object stream...

I've searched in a lot of places, but came up with no results till now!!

Below is a sample code:

---------------------------------------------------------------------
cam = Camera.get();

nc = new NetConnection();
nc.connect("rtmp://itg-pc-64/Board/08");
nc2 = new NetConnection();
nc2.connect(null);

ns = new NetStream(nc);
ns2 = new NetStream(nc2);
ns3 = new NetStream(nc);

//This will play the local flv locally, cant publish to clients.
btn1_btn.onRelease = function()
{
v2_video.attachVideo(ns2);
ns2.play("c:/av_stream1.flv");
}

//This will get the camera stream, publish it to all cleints, then play it.
btn2_btn.onRelease = function ()
{
v_video.attachVideo(ns3);
ns.attachVideo(cam);
ns.publish("myCam","live");
ns3.play("myCam");
}

//This is the case!!!
btn3_btn.onRelease = function ()
{
v_video.attachVideo(ns3);
//This line is the Key...
ns2.attachVideo(/*I need to pass a camera object, but contains the local
flv*/ );
ns2.publish("myCam","live");
ns3.play("myCam");
}

//I even cant play my local flv in case of using ns and nc
btn4_btn.onRelease = function()
{
//Does not work!!!
v2_video.attachVideo(ns);
ns.play("c:/av_stream1.flv");
}

Any help or idea is truly appreciated.

TheBimmer
5/19/2005 4:00:54 PM
well,

first, thanx for REPLYING !!!

I believe that you did not even look at the code i've posted with my quesion...

[quoted text, click to view]

-----------------------

It looks like you haven't read the help topic about nc.connect().
Please do it and your questions will go away.

[quoted text, click to view]

You must use null (but not rtmp) to load local files.

-------------------------------

[quoted text, click to view]
the reason why it dosn't work in your last statement!!!

....

this is what i need:

Publish local FLV through a stream, and play this stream at clients...

"You must use null (but not rtmp) to load local files." this statement is
what i want to overcome...

Thank you
Alexander B. Bokovikov
5/19/2005 4:35:44 PM
On Thu, 19 May 2005 08:21:49 +0000 (UTC), "TheBimmer"
[quoted text, click to view]

Yes, of course.

[quoted text, click to view]

How? Using the same nc? Or different nc's -- one for each stream? What
exactly do you wish to get?

[quoted text, click to view]
-^^^-
Who said that? Where it was declared? No words like "any" there!

[quoted text, click to view]

It looks like you haven't read the help topic about nc.connect().
Please do it and your questions will go away.

[quoted text, click to view]

You must use null (but not rtmp) to load local files.
Alexander B. Bokovikov
5/21/2005 12:00:00 AM
On Thu, 19 May 2005 16:00:54 +0000 (UTC), "TheBimmer"
[quoted text, click to view]

Only Camera() and Microphone() objects may be used as the source for
NS. That's declared in the help.

[quoted text, click to view]

Null is a special (exceptional) case for NC. It is appeared in Flash
7. In fact when you use null, as the URL for NC, further, when you'll
use NS.play(), its argument will be considered as a local file
(instead of stream) and NC will not be used at all. Because it is
null. Indeed, such NS can only be used for playback (but not for
recording!) and only attachVideo() and attachAudio() can be used to
play this local file.

I think your main misunderstanding is that you don't distinguish
incoming and outgoing connections. Camera() and Microphone() provide
us with outgoing connections. But local file may be only be used as
incoming connection. Otherwise what we'd need FCS for?
TheBimmer
5/22/2005 12:00:00 AM
Thanks for replying.

All what you have said is really appreciated. But we still have the problem?
what I meant from all of this discussion is to find a way to stream local
FLVs!!!

And as I mentioned before, we can stream local cameras as a net stream by
attachVideo? well, by looking carefully at this statement, and by studying the
way that the camera works, we would reach into a conclusion that the camera
gets us at the end of the day a STREAM of images taken by it.

So, why is it possible to pass this kind of streams, and its not possible to
pass other types of streams (local FLV).

I am just presenting this issue as many of us may come across this problem one
day!

For example, an owner of a web site, wants to allow the clients to play local
files at there machines, and at the same time stream it to others, not only the
camera stream.

" I think your main misunderstanding is that you don't distinguish
incoming and outgoing connections. Camera() and Microphone() provide
us with outgoing connections. But local file may be only be used as
incoming connection. Otherwise what we'd need FCS for? "


What we are discussing here is beyond what is written exactly in flash com
help. We are having a problem which is not handled, and trying to get a
solution for it.

The solution might not be as direct as the one I am talking about, but I am
sure that there is a way!

I believe that we are here to share new ideas, not to repeat what is already
written and known.

Any ideas are appreciated.

Alexander B. Bokovikov
5/23/2005 12:00:00 AM
On Sun, 22 May 2005 09:11:44 +0000 (UTC), "TheBimmer"
[quoted text, click to view]

Because it was made so by MM. Isn't an answer?
In fact your question is from the same series as "Why can I use MP3
for published streams?"

[quoted text, click to view]

OK. Write a driver, emulating Video Input Device and working with
FLV's. What's easier? :))) Perhaps you can find a skeleton in the MS
Win32 DDK.

[quoted text, click to view]

It is handled. Please look to the AS Dictionary and you'll find: "Only
Camera() and Microphone() objects may be used as the sources for
NetStream.publish() function." (I'm citating from the memory, sorry,
but it is something very close to original).

[quoted text, click to view]

You're too optimistic! You're considering the AS , as a blackbox,
which may have some yet covered features. Perhaps it has, but I doubt
local FLV publishing is among them. The easiest way is to call to MM
support center and try to clarify it.

[quoted text, click to view]

If the idea about driver may be considered as idea -- get it!
Also what about to get Camera() object source code?
AddThis Social Bookmark Button