My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Help  
How to install and run the haXeVideo server
Featured
Updated Feb 4, 2010 by ncanna...@gmail.com

Installation

In order to run the haXeVideo server, you need first to download install haXe from http://haxe.org/download.

You can then download the latest haXeVideo release from the Downloads section.

You'll also have to install the format library to compile haxevideo. Run the following command from the commandline :

haxelib install format

Testing

Once you have the source releases, run haxe video.hxml, this will compile a server.n and a video.swf file. You can start the server on localhost by executing :

neko server.n localhost 1935

You can open the video.html file to display the videos/test.flv file in realtime streaming.

Although the haXeVideo FLV server works for all Flash versions, displaying the video.swf requires Flash Player 9, so make sure it is installed.

Usages

Here's some code usages about how to perform various commands from Flash using haxeVideo. Code is given in haXe

Playing a Video

Videos are stored by default in the ./videos/ folder relative to the place the server is running. In order to play a video you need first to connect to the server by using a flash.net.NetConnection and then create a flash.net.NetStream . You can start playing the video by using the ns.play("myvideo.flv") command. You can pause with .pause(), seek with .seek(absoluteTime) and stop with .stop().

Recording a Video

If a webcam and/or a microphone are connected, it's possible to record the audio/video stream sent by the FlashPlayer into a FLV file. First you need to connect to the server and create a stream. Then you can link the NetStream to the camera with ns.attachCamera(flash.media.Camera.getCamera()) and to the microphone with ns.attachAudio(flash.media.Microphone.getMicrophone()).

You can now send audio+video data to the server by calling ns.publish("record.flv") which will create ./videos/record.flv file.

Live Streaming

In order to live stream some published data, you need first to give the stream a shared by calling ns.publish("record.flv","sharedName"). Then, from another client or NetConnection/NetStream pair, you can connect to the live stream by calling ns.play("#sharedName") (the name of the shared stream prefixed with a sharp char in order to tell that it's a livestream).

You can pause/resume a live stream but you can't seek it.

Metadatas

Metadatas present in the FLV file are transmitted to the client reading the stream. In Flash9, they can be intercepted by setting the ns.client field.

Sending live data

Once you have published a live stream, you can send live messages by using the ns.send command. For example ns.send("onMetaData",{ hello : "World" }) will be similar as if some metadata was found in the FLV.

Shared Object

Shared object is a persistent storage that can be used for storing some informations on the server. There is only untested protocol support for it right now, so it's not yet fully implemented.

FLV Indexing

While seeking into a FLV, haXeVideo currently reopen the FLV file an browse through it to find the matching keyframe. This could be done faster by creating and cashing an FLV keyframe index but this will be done in next version.

Troubleshooting

If the player can't connect to the server, try allowing access from the SWF by using the Flash Settings Manager.

By default, the server is running on localhost, which means it's not available for access from other machines. Please change it in both server.bat (or the neko command you're running) and video.html (two times) with your network IP (such as 192.168.0.1) and open the port 1935 of your firewall in order to make the server accessible from the network.

Comment by doria...@gmail.com, Oct 23, 2008

if you are having problems getting your client to stream from the server, with an 'objectEncoding error' returned by your SWF file, make sure you change your NetConnection object to use flash.net.ObjectEncoding.AMF0

eg:

nc = new NetConnection(); 
nc.objectEncoding = flash.net.ObjectEncoding.AMF0; 
nc.connect( 'rtmp://localhost' );
Comment by clemens....@gmail.com, Nov 19, 2008

fwiw my flash install asked for access to 'local' instead of 'localhost'

So I copied the video.html and video.swf to my localhost webserver. And it worked.

Thanks.

Comment by utyf.net@gmail.com, Jan 19, 2009

Can I organize live streaming not from a client web-camrera, but from a local process ( ip-camera+mencoder ) ?

Comment by mnune...@gmail.com, Aug 3, 2009

whats the requirements besides haxe compiler? i want to use it on debian machine, do i only need to instal neko? or do i have to install red5 to? please enligth me...

Comment by IamKe...@gmail.com, Sep 19, 2009

You need neko to run haxevideo.

Comment by devgo...@gmail.com, Nov 18, 2009

...no need for red5.

Comment by angelama...@gmail.com, Nov 23, 2009

first I have to say GOOD JOB guys but... sorry I try running HaxeVideo? under linux (ubuntu Karmic Koala 9.10) but nothing happenned :(. I'm pretty sure i made a mistake. I've followed instructions : - I've installed Haxe and neko and they work (I tried the haxe tutorial and it works).

- I've called "haxelib install format" - I've caled "haxe video.hxml" in the install directory of haxevideo - I've run neko server.n localhost 1935 - I've ran firefox whith url 'http://locahost:1935/video.html' - And nothing happened. Firefox just say 'waiting for localhost' and nothing.
What's going wrong... If somebody can help me. So thanks you very much guys and again good job and sorry for my bad english ( I'm French ;) ). Sincerlly

Comment by mic...@gmail.com, Nov 24, 2009

Hey, I just installed it and it worked. angelamalice, you need to copy video.{html|swf} to you regular server, e.g. ~/public_html, and access it there (starting apache or other httpd server) using regular port 80 (or whatever you have configured). The 1935 is only for rtmp protocol.

Btw, I am using latest svn version - the older 1.1 version did not work for me for flash 10 - it is a known bug (look for "Overflow error in haXe Video Server"). Everything works for me - except "View Cam", but maybe I don't know how to use it... I get "Connection succeeded", then "code: NetConnection?.Connect.Close"

Comment by dark6.me...@gmail.com, Nov 28, 2009

I run neko server.n localhost 1935, then I get:

Starting haXe Video Server on localhost:1935

I have my video.swf stored in a localhost site made with apache (xampp by the way), try to play the test video and only get: "NetConnection?.Connect.Failed", and in the cmd window I get:

Called from haxe/io/Input.hx line 230 Called from format/Rtmp.hx line 126 Called from hxvid/Client.hx line 604 Called from hxvid/Server.hx line 36 Called from hxvid/RealtimeServer?.hx line 283 Called from hxvid/RealtimeServer?.hx line 142

Does someone know what I'm doing wrong? I had followed every step we have here.

Comment by julien.b...@gmail.com, Feb 12, 2010

Guy, you made a crazy piece of code, thanx sooo much.

Comment by Aup...@gmail.com, Mar 2, 2010

Same issue as dark6.metal here.

Comment by dfkimera...@gmail.com, Mar 26, 2010

Extremely simple and extremely powerful. Sure teaches the Red5 guys how good software is done.

Comment by aluq...@gmail.com, Mar 27, 2010

Hello, sorry my english, Can you give me some idea about a way to stream from a Android stmartphone to the haXeVideo server?

Comment by osgili...@o2.pl, Mar 27, 2010

I testet 5 or 6 flash streaming servers and haxevideo is just fantastic. It works as promised and here one can find helpful configuration details.

I would like to ask though, whether anyone has a working example of using flowplayer with haxevideo, google says nough about it.

I tried to fix it myself tweaking the examples from flowplayer site but I only succeded in connecting to server (I see connect msg) but I cannot start playback as it waits for data that does not come.

I tried the video.html and it works.

Anyone any hints (maybe I need other flash player ?)

Best,

wAnt

Comment by jesus.me...@gmail.com, Apr 21, 2010

@dark6.metal @Aupajo I had the same issue. Looking around the issues section in this google code page I found that it was becasuse of the format install. I used "haxelib install format 1.13" and recompiled the aplication and everything went fine.

Comment by irresist...@gmail.com, May 13, 2010

Is it possible Video Conference (with Webcam) between 2 clients connected to the server, but the server only manage the IP to able to connect the 2 people? The video streaming don't pass throw the server, so no a lot of bandwidth required on the server.

Red5 do it?

Thant you.

Comment by kelvin.w...@gmail.com, May 13, 2010

same issue as dark6.metal and Aupajo, too

Comment by kelvin.w...@gmail.com, May 13, 2010

yeah I found, changed to flash player 9 and did work.

Comment by yitw...@gmail.com, May 31, 2010

Same here, only works with flash player 9. With 10, you get Overflow. Hope this can be fixed. I'm something of a programmer, I wouldn't mind taking a shot at it, if I had some clue how to get started.

Comment by anso...@gmail.com, Dec 13, 2010

A tutorial how to create a rtmp server from scratch would be awesome. After that we would be able to understand and expand the server !!!


Sign in to add a comment
Powered by Google Project Hosting