Integrate Red5 Server in existing Java application - java

In my Java Application, I need to create an RTMP (or RTSP) livestream server and feed raw RGB image data to it.
I'd like to use the Red5 Server project, as it is available via Maven and the Apache 2.0 license fits my needs.
However, I haven't found any introduction tutorials on how to start and feed a livestream server from within a standalone Java Application. I have already added the dependency to my project, and can access all of Red5's classes.
Can you point me to any resources that help me getting started? The task I'm trying to accomplish seems pretty basic to me.

With Red5 you have the control to handle the "input" in any means you want, from a servlet that accepts octet-streams, to pretty much anything else you can think up. So if your input is RGB data, implement something that accepts your byte arrays (like a servlet) and then convert it into one of the Flash supported video codecs, such as h.264; you can use ffmpeg or jcodec to do this. Lastly, you'll want to package the now encoded data into FLV format, that's more difficult, but there are non-red5 examples of how to do this on the net, google for it. Once you have it in the FLV format, create a broadcast stream and dispatch the VideoData to it. Sounds simple right? Its not, but if you are a proficient in Java and / or C/C++, you should be fine.

Related

HTML5 -> Java Server

Unfortunately for this question, I can't really post my "Attempt" at solving this issue, because I'm not sure what the issue is to begin with, here recently I've been developing a small networking wrapper for gaming servers, me and a few friends have been testing it using C#/Java clients and it's been working out great; However I decided that I wanted to try something new and mess with the (Sortof) new HTML5. I've seen examples of games that are written in HTML5 and look absolutely amazing, an example of this would be the Runescape browser based game which has an HTML5 version. More information here.
I'm only interested in working with 2D games, however I thought that instead of using a Java Applet (Like I used to) I could learn how to do things in HTML5 and have a true web-based application. The problem isn't so much learning HTML5 as it is understanding its networking.
Currently for my server I'm using Netty, which is a Java NIO framework, however I've been studying and sources claim that HTML can't connect directly to a standard TCP socket and instead require a WebSocket. I did some searching into netty for a websocket and it seems supported, information located here.
My only question, in which I can't find any information on is sending the data in a manner that the server will be able to read it. I'm using the DataInputStream class to read data on the server side, which requires special encoding to create "Blocks" of networked data, as-well as some customized encoding for primitive data-types, and a custom encoding for UTF data-types. I wrote my own output stream for our C# client API, however with HTML I'm at a complete loss.
I can't find any information about sending data, or customizing the data sent into blocks, or anything. C# made it really simple with the use of it's BinaryWriter class, but with HTML5 I'm just at a complete lack of resources to learn from, or my google-fu really needs to be worked on.

how to use java code from .net desktop application?

I want to Use Some Java Code From the WCF Service. Basically I need to intreact with the java application from the .net so how can I make it out for that? Any guidance for that?
I was just wondering that how can i call java code from my .net desktop application? Do I need to create .exe file of my java poject or jar? How would I invoke that java project from my .net desktop application?
Like some code in .net desktopp application will call
void startprocessing ();
code written in java application
Let me Clear the Things What i want to implement..
I have one desktop appplication of windows and I want to integrate my speech recgnition facility in that application which is in java. What I want is to exchange the audio data as binary and some strings from .net application to my java application so I can process on that binary data to convert wav file and etc and recginze it..that is just completed ..but what I need to know is how to send those strings and some binary data to java application and just invoke that java application ?? Do I need to 'use'(?) wcf or other service ?
Going out on a limb here, sounds like you java app needs to expose the method you want to call via a web-service. That's of course assuming you have control over that in terms of the java app you're interacting with. Not sure though you can access that method simply by compiling your java app to native.
You can take a look at JNBridge, which provides interop possibilities between Java and .NET. However, as another poster has suggested, exposing the functionality through a web service is probably a better solution.
A quick Google search will give you plenty of information on how to create web services in Java, but for starters you can take a look at: http://docs.oracle.com/javaee/6/tutorial/doc/bnayl.html
I have Successfully done that with the axis 2 webservice with tomcat apache server with the following link..its too easy .i really got succeeded
http://blog.sencide.com/2011/06/create-web-service-using-apache-axis2.html

How integrate RapidMiner in a PHP web application?

I've got an implementation in RapidMiner that classifies questions according to Bloom's taxonomy. I need to consume the data produced by a web application developed in PHP and show the results in the interface of the web application.
So I'm wondering if it is possible that the application in PHP communicates with RapidMiner to process the data and show the results provided by RapidMiner in the interface.
I know RapidMiner is implemented in Java, and there is the option of using Java bridge to comunicate PHP and JAVA, but I'm not sure if that is a solution to this.
Why not try to communicate with xml, for example, PHP app sends a list of questions via xml to rm, it then processes it and returns an xml feed. I think this'll likely be the easiest solution.. As far as performance, I can't say one way or the other if it's the best solution

In-browser video (de)coding and processing

For our web app we need some (preferably) client side video processing.
I think of the following workflow:
ask a user for a video file
decode it
do some processing on selected frames
combine these frames to the new video
encode it
upload it to the server
play it to our users
Reasons to do this client side:
output video is much smaller, so we have to upload less
video processing is too costly for the server, we prefer to use client's CPU
It is OK to install something once but then everything should work as an ordinary web app.
I've spent few days googling, but it is just too much to digest. So I ask for help.
Here are my findings/assumptions/questions.
Is there a simple way to do it with Flash?
1.1. Can access user-selected file from local file system
1.2. Has some decoders built-in, but these are rather specific and do NOT cover common video formats
1.3. Can NOT use locally installed codecs
1.4. It is impractical to implement codecs in ActionScript, so there are no such libraries
1.5. Can process frames
1.6. Has built-in coder(s)
Is there a simple way to do it with Silverlight?
2.1. Can access user-selected file from local file system
2.2. Has some decoders built-in, but these are rather specific and do NOT cover common video formats
2.3. Can NOT use locally installed codecs from in-browser sandbox
2.4. Can bring external executable (ffmpeg) to the in-browser sandbox but can NOT run it
2.5. Can only use DLLs specifically built for Silverlight runtime inside in-browser sandbox, so ffmpeg proxy (COM?) and alikes are of NO use
2.6. Can be right-click-installed from web page and maybe #2.3, #2.4 or #2.5 will work, but this will NOT make on-page app work, user will need to run it separately outside browser
2.7. It is OK to implement codecs natively (port ffmpeg?), but I was not able to find such a pack
2.8. Can process frames
2.9. Has built-in coder(s)
Is there a simple way to do it with Java?
3.1. Can access user-selected file from local file system
3.2. JMF has basic codecs built-in
3.3. Jffmpeg could add more codecs
3.4. Can process frames
Is there something else that could do the job?
Looks like due to #1.2, #1.3 and #1.4 Flash is not an option.
Looks like Silverlight could do the trick if only there exists natively implemented codecs pack.
Java looks most promising.
Before diving into it I still want an answer about Flash (due to install base) and Silverlight (.NET already used in the project).
Please advice if my findings/assumptions/reasonings are correct.
Thank you.

Java or Dot Net for server side Flash support

We are building a Flash application for client use but will need to do server side processing of images. All our expertise and application code is in Java, but I've been told Dot Net has better Flash support. This is general but we will be modifying large (up to 50MB) image files. The idea is that what we could do in Flash should be duplicated, automated and extended on the server side.
I've never heard before that .Net server technology has better Flash support than Java. In fact, RED5 (an open source Media server for Flash) is implemented in Java.
As for capabilities, Both .Net and Java will be more than capable of duplicate and extend the same image processing done in Flash, and both have libraries and services that support AMF in case you require it.
Flash is pretty much server-agnostic anyways, so unless you get more specific reasons I think you should go with whichever language you are more comfortable with (which seems to be Java)

Categories