Archive for the ‘red5 hosting’ Category

red5 and ffmpeg

Thursday, August 26th, 2010

One of our customers asked if he could stream through the ffmpeg folder.

FFmpeg is a software which converts video files in different formats to video files in flv format this videos are then streamed through a swf player just like the streaming of red5 videos, which are also on flv format. so ffmpeg is not to stream is to convert the file to a a format in which the video can then be streamed.
let me give you an example of the use of ffmpeg, if you go to http://movieback.com/  (login visio passw. 123456) you can upload a video what ever format, for example in wmv which can only be played on windows media player or similar and then this video in wmv is converted to flv and you can then stream it.

but there is also a difference on the stream, with red5 you have the advantage of:

The advantages of a streaming red5 server are:

    1. Users can seek to any place in the video timeline without waiting for the whole video to buffer
    2. No physical data is saved on the users PC cache, so your media files are better protected
    3. It uses less bandwidth than progressive*
    4. Streams can be combined into a single gapless stream

* This is because on average a user will not watch the entire video, but with progressive download they will still download the entire file.

Progressive streaming is the normal one, like on our demo site http://movieback.com/

RTMP and video streaming

Friday, January 15th, 2010

RTMP path is not a link for streaming videos, it is a path to a a folder on red5 which will allow your red5 application to connect to red5 on our servers. Did I make it a bit clear?

for example lets take this application:
http://red5stream.com/videoconference/

for this application to work we uploaded a folder called videowhisper to red5/webapps folder inside the server then on this script http://red5stream.com/videoconference/ there is a file called settings.php and we entered this rtmp path which was:
rtmp://216.67.244.116/videowhisper

now do you see how it works?

red5 hosting or Real Time Messaging Protocol (RTMP) hosting

Friday, January 8th, 2010

Real Time Messaging Protocol (RTMP) is a protocol for streaming audio, video and data over the Internet, between a Flash player and a server. A special software is required to run on server side for accepting and serving the rtmp connections from flash clients. We provide managed RTMP hosting based on RED5.

Red5 is shared on our shared hosting plans that means although you can use red5 to stream your videos you will not have access to the red5 folder. Most scripts based on red5 need to upload a folder inside red5/webapps.

This folder is important because it will be on the RTMP path, ex.

rtmp://your-server-ip/folder-name

Contact us so we can upload your folder to red5/webapps and then give you the rtmp path.

RTMP Hosting

How to stop, start or restart red5

Monday, September 28th, 2009

Important commands for the red5:

Login to ssh and enter the following commands.

#cd  /usr/local/red   (takes you to the red5 folder)

to stop red5:
#service red5 stop
or
#./red5-shutdown.sh

the command to start red5:
#./red5.sh &

When you see this line:
2009-09-27 23:26:32,365 [main] INFO  org.red5.server.Standalone – Startup done i
n: 5464 ms   (it will be easy because the lines will stop running at this point)

Wait 15 seconds
Then you must log off from the terminal screen
Press ctrl+A+D (if you don’t log off, after a while red5 will go down again)

Every time you put some folder on /red5-server folder/webapps/ you will need to restart the red5.

Red5 Hosting

Red5 Tutorial and Red5 Hosting

Tuesday, September 22nd, 2009

Red 5 is a pretty amazing server software written in java. The Red 5 development team has put in tons of effort to make it a open source alternative to Adobe FMS – Flash Media Server.
Red 5 is a perfectly suitable technology for “Video On Demand” applications, streaming, publishing, mealtime collaboration, multi player gaming and more….
Red 5 is on all shared hosting plans of Hosting Marketers. By default the red5 server comes with some sample applications pre installed into it, like oflaDemo, fitcDemo, SoSample etc.

When installing and using red5 you have to keep in mind some configurations and security concerns. Red 5 was created to emulate the RTMP Protocol (realtime messaging).
Even today where many don’t know the capabilities of Red5 or are scared of the complications offered by java coding, i must tell you… once you get to use it you will love it :) .
There are many applications to be made with RTMP and many possibilities to be discussed. Here we will discuss a simple application that can stream from custom directory. This application will be server side and will help you set up your own basic application which does not require you to use the global oflaDemo.

Hosting Marketers offer you Red5 Hosting facility on their servers, which is needless to say … “amazing”.

You can host you own youtube or clipshare clones at a very nominal cost. However to avoid any problems, as you will be sharing resources on a shared server, its always better to create your own application, that accepts incoming outgoing requests.
This tutorial does not give you the scope to create the application from scratch, rather configure it to use a custom path on the server to stream from / record to . You can then safely use your own account path to handle streams. By default oflaDemo uses “streams” directory on the server to play/record streams.

Though this tutorial gives you a course on setting up the same, many have difficulties getting it done.
So here is the practical way of doing it.

I assume you already have basic Application class ready, which makes your application valid. We will simply use a custom filename generator to change the stream paths.

Setting up a custom Filename Generator: – CustomFilenameGenerator.java

package com.flashvisions;
import org.red5.server.api.IScope;
import org.red5.server.api.ScopeUtils;
import org.red5.server.api.stream.IStreamFilenameGenerator;
public class CustomFilenameGenerator implements IStreamFilenameGenerator {
/** Path that will store recorded videos. */
public static String recordPath;
/** Path that contains VOD streams. */
public static String playbackPath;
private String getStreamDirectory(IScope scope) {
final StringBuilder result = new StringBuilder();
final IScope app = ScopeUtils.findApplication(scope);
while (scope != null && scope != app) {
result.insert(0, “/” + scope.getName());
scope = scope.getParent();
}
return playbackPath + result.toString();
}
public String generateFilename(IScope scope, String name, GenerationType type) {
return generateFilename(scope, name, null, type);
}
public String generateFilename(IScope scope, String name, String extension, GenerationType type) {
String filename;
filename = getStreamDirectory(scope) + name;
if (extension != null)
// Add extension
filename += extension;
return filename;
}
public boolean resolvesToAbsolutePath() {
return true;
}
/* Setters for your path variables */
public void setPlaybackPath(String path) {
playbackPath = path;
}
public void setRecordPath(String path) {
recordPath = path;
}
}

Save this code in a file: CustomFilenameGenerator.java in the same package as your application class.
Now that we have setup the code , we need to make our application aware of the class so that it may
use the path values from this.
So we edit red5-web.xml. This one of the configuration files of red5. Generally the content or red5-
web.xml looks like this:

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN”
“http://www.springframework.org/dtd/spring-beans.dtd”>
<beans>
<bean id=”placeholderConfig”
class=”org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”>
<property name=”location” value=”/WEB-INF/red5-web.properties” />
</bean>
<bean id=”web.context”
autowire=”byType” />
<bean id=”web.scope”
init-method=”register”>
<property name=”server” ref=”red5.server” />
<property name=”parent” ref=”global.scope” />
<property name=”context” ref=”web.context” />
<property name=”handler” ref=”web.handler” />
<property name=”contextPath” value=”${webapp.contextPath}” />
<property name=”virtualHosts” value=”${webapp.virtualHosts}” />
</bean>
<bean id=”web.handler”
class=”com.flashvisions.Application”
singleton=”true” />
</beans>

The last bean instructs Red5 about the main application class. So just before the </beans>
closing tag .. we will add the directive for our CustomFilenameGenerator class.
So our final red5-web.xml will look like this:
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN”
“http://www.springframework.org/dtd/spring-beans.dtd”>
<beans>
<bean id=”placeholderConfig”
class=”org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”>
<property name=”location” value=”/WEB-INF/red5-web.properties” />
</bean>
<bean id=”web.context”
autowire=”byType” />
<bean id=”web.scope”
init-method=”register”>
<property name=”server” ref=”red5.server” />
<property name=”parent” ref=”global.scope” />
<property name=”context” ref=”web.context” />
<property name=”handler” ref=”web.handler” />
<property name=”contextPath” value=”${webapp.contextPath}” />
<property name=”virtualHosts” value=”${webapp.virtualHosts}” />
</bean>
<bean id=”web.handler”
class=”com.flashvisions.Application”
singleton=”true” />
<bean id=”streamFilenameGenerator”>
<property name=”playbackPath”>
<value>C:\</value>
</property>
<property name=”recordPath”>
<value>C:\</value>
</property>
</bean> </beans>
As per the above example …all streams will be recorded to/played from my c: drive. You can set your
account path instead of c:/ to use your own folders for streaming.

This tutorial was writen by Rajdeep Rath from Flash Visions