Wowza Community

Java RTMP client?

@jussiniinikoski

hello,

did you get the red5 RTMP client working with wowza. i’m getting a “ERROR server comment - handleResult: can’t find resultObj: 0” Error message just by using a simple RTMP connect command.

regards

robroy

i just want a proof that the red5 java RTMP client works with wowza. for that reason i try to make the simple serverside wowza application “MyFirstModule” running with the java RTMP client but in vain.

i even can’t connect to the wowza application, getting the message:

INFO session connect 127.0.0.1 -

ERROR server comment - HandleResult: can#t fine resultObject: 0

but i do not know if it is a problem of incompatibility or because of my poor java skills.

import org.red5.server.net.rtmp.RTMPClient;
...
MyCallback callback = new MyCallback();
RTMPClient client = new RTMPClient();
client.connect("localhost", 1935, "mymodules", callback);
//client.invoke("doSomething",callback);
...

robroy

really no idea?

i get the following response from wowza:

{clientid=1070450058, level=error, description=Connection failed: Application folder ([install-location]/applications/) is missing., code=NetConnection.Connect.Rejected}

robroy

this folder definitely exists otherwise i think wowza would claim:

Application folder ([install-location]/applications/mymodules) is missing

i guess it’s more a matter of the parameter transmission from the red5 RTMP client to wowza which is not recognitzed correctly. i read on the red5 email list that several people have the same prob and that they got the red5 RTMP client with FMS running…

robroy

Yes Charlie, It was the same question, but now I know how to do it with WebServices. Thanks a lot.

Red5 has RMTP client support in Java - can I perhaps use their clientside connection methods or are your protocols incompatible? I’m reluctant to give up on using Wowza on my project…

Jussi

Thanks Charlie, I’ll give it a try!

Jussi

This blogpost should be useful. It describes a RTMP client which saves the streaming video to the disk.

http://swik.net/Peter-Thomas/Incremental+Operations/How+to+record+RTMP+flash+video+streams+using+Red5/b4fey

Hello amirguterman85,

I feel that you should be able to get one of your Java rtmp clients working with Wowza. Maybe that’s something you should try troubleshooting.

The flourinefx website even mentions Wowza in its features: http://www.fluorinefx.com/features.htm

Another way to do it? Use Chrome and the HTML 5 filewriter API to write to a file. Then use Java to poll that file for changes, or better yet, make the file a named pipe and monitor it. Then write to your serial port from Java. But that seems weird. People usually don’t use web browsers to watch videos to write values to serial ports.

Why do you need to play the RTMP stream to get the shared object?

If you just want to interact with Wowza you can use HTTPProvider or a web service.

I don’t know exactly what you’re trying to do or why it needs to be real time. Web services, the Wowza HTTPprovider, and the Shared Object method are the usual ways to do client-server communication with Wowza. Web Services use HTTP, XML. But, if you need low latency you could just open a tcp socket from a Wowza module.

I can’t really recommend anything better than a google search. I searched for “Java tcp socket” and saw several easy tutorials. If you need help with custom programming there are several Wowza consultants available.

Amir, you’ve posted in the Wowza 1.7.x forum. Are you not using the lastest version of Wowza? If so, upgrading might help with your RTMP issues.

Hi, I am trying to create a rtmp client in java.

I want to create a java application which connects to a wowza server, reading a shared object’s values and transfers them to the com port.

is there any java example of shared object? is it only possible to write clients in flex/actionscript like in the examples provided with the server?

in order to write to the com port, values received from wowza server, i’ve been trying the following way:

use a .net rtmp client(BroccoliProducts, FluorineFX or WebORB) and from .net it’s pretty easy to access the serial port - I’ve failed to establish a connection to wowza with all of those rtmp clients (handshake problems i think, server rejects the connection to those clients).

*web services is not a good solution either to me because of latency problems and my demand in this project is fast response, definitely not a technology based on text parsing over http

then I am now going for the second scenario, which is to access the com port from a java windows application, establish a rtmp connection to a wowza server, reading a shared object’s values, then sending them to the com port.

unfortunately other flex/flash/actionscript/SL based clients don’t have access the com port.

what should I do, if I want to use wowza to communicate with an electronic device. is there any way to do this?

wowza should support java environment - I don’t see why not providing a java api and make wowza truly a cross platform system.

please help! thanks,

amir

about FluorineFX, i got the same result as in this thread:

NetConnection with C# : FluorineFX ?

HTTPProvider is not fast enough for my purpose, I also did not find a working sample of remote shared objects in C# (using web services), again I’m not sure about latency.

when using web services - does it really opens a tcp connection like NetConnection, directly to the shared object? or it’s just passing the parameters as text (slow)?

I’m trying to make 2 different client side application, one is a remote pc administration panel application that receives the remote pc’s desktop as a live video feed right into the mobile phone - so that kind of thing I can cover with flash/flex client.

the second client which is the reason i’m writing here, should be a .net client, written in C#, and it’s purpose is to execute the command that the first client(on mobile phone) requests, and also .net client have to captore the desktop and stream it to the phone, so basically it’s like remote desktop streamed on wowza server , controlled and being viewed on a mobile phone using flex/flash client. all parameters should be syncronized with a shared object (for all the remote commands)

flash and actionscript don’t have permission to access to the serial port which is really important in my project.

I must find a way to make a client in .net that can publish desktop and sync data using rso.

about the tcp socket

could you kindly give me an example of opening a tcp socket from a wowza module and maybe code sample for the server side module (java) and the client side module (C#)

Thank You!

amir

Yes I am using the latest version,

Ok I will try tcp socket in java

thanks!

can you please tell me if this class: ‘C:\Program Files\Wowza Media Systems\Wowza Media Server 2.2.4\examples\TextChat\src\ModuleTextChat.java’

is a class for client side, or a server side application?

is it possible to use the same classes like ISharedObject and use them from the java client?

This applet code can be useful for your task: http://livertmpjavapublisher.blogspot.com/

Yes I am using the latest version,

Ok I will try tcp socket in java

thanks!

It is better you try in C# , because client server program is very easy to understand . Try this basics http://csharp.net-informations.com/communications/csharp-socket-programming.htm it will help you to learn basics, then you can move next level.

yang.