Archive for the ‘documentation’ Category

How to enable token based authentication in AVChat

Monday, August 9th, 2010

Starting with build 900, AVChat 3 introduces a new security feature called “token based authentication”. When enabled this prevents 3′rd party swf files (hosted on other web sites than your own or by malicious users) to connect to your media server. There are other security measures in place to prevent this however token based authentication is the most secure!

This feature is turned off by default because with it enabled:

  • it takes slightly more time for users to connect to the media server,
  • it might cause some connection attempts to the media server over slow Internet connections to fail
  • we’ve only had a few clients that really needed this feature!

How o turn it on:

  • install AVChat
  • edit the settings file on the media server  (avchat3.properties on Red5 and Wowza, settings.asc on FMIS)
  • set the value of the tokenUrlLocation variable to the absolute url to token_verify.php  (token_verify.php is in the folder where you installed AVChat on your website, good example: http://avchat.net/demos/av30/token_verify.php)
  • restart the media server

How to open AVChat 3 in a pop up in Joomla! 1.5

Friday, July 30th, 2010

There are two ways to open the AVChat Video Chat Component in a pop up in Joomla!:

  1. Using Joomla!’s default method:
    • Log in the administrator area of Joomla!.
    • In the Menus area edit the link to AVChat 3.
    • Set the On Click, Open in option to  New Window without Browser Navigation (screenshot below)
    • Click Save.

    joomla_open_popup

    That’s it! Clicking the link in the menu will now open the video chat in a pop up. Using this method however you will not have control over the pop up dimensions

  2. A way that allows you to control the size of the pop up:
    • For this you’ll need to login to your website with an FTP client (FileZilla is our favourite) and go to /components/com_avchat3/
    • Open avchat3.php for editing.
    • Replace the object & embed html tags (everything from <object… to </object>) with this html code:
      <a href=”javascript:void(0);” onclick=”window.open(’/components/com_avchat3/index.swf’, ‘AVChat’, ‘menubar=0, resizable =0, width=900, height=650′);”>Launch AVChat Video Chat</a>

    • Save the file and make sure you upload it back to the web server.

    You can change the size of the pop up by editing the width and height properties in the code above.

New support forum

Monday, July 19th, 2010

avchat-forum

We used to solve all AVChat issues by email, and it was wrong because all the info we’ve shared by email is now locked in those private email discussions, and believe me there’s a lot of useful info in those emails!

That’s why we’ve now launched a proper, public, forum : http://avchat.net/forum/,  to make all that „problem solving info” available to everyone! The entire AVChat team will be answering questions in there so expect proper deep technical documented answers.

There are special areas for all our products including AVChat, the HD  video recorder and the audio recorder.

The private and personal support by email is still available to our customers, the forum is just an addition!

How to close the pop-up containing AVChat 3 by clicking the [LeaveChat] button

Friday, April 30th, 2010

When AVChat 3 is opened in a pop up window you can use the [Leave Chat] button to close the pop up window:

  1. edit avc_settings.php or avc_settings.asp
  2. set $avconfig['disconnectButtonEnabled']=1;
  3. set $avconfig['disconnectButtonLink'] = ‘javascript:window.close();‘;

By default clicking [Leave Chat] takes you to a new web page instead of closing the window!

leave_button_screenshot

Troubleshooting video quality issues

Thursday, April 29th, 2010

On the publisher side:

Problem: low frame rate

Solution(s):

  1. Increase the light in the room, natural light works best.
  2. Get a better web cam, good web cams capture a lot of frames with little light in the room.
  3. Lower the picture resolution requested by AVChat 3, some web cams just can’t capture 30fps at 400×300.
  4. Increase the movement in the shot, if there’s no movement Flash Player will not capture many frames/second because there’s no movement.

Problem: video stream does not use entire allocated bandwidth

Solution(s):

  1. Increase the light in the room, natural light works best. More light helps the web cam capture more details!
  2. Get a better web cam, good web cams capture a lot of detail with little light in the room. DV cams for example capture huge ammounts of data compared to normal web cams.
  3. Check your connection to the media server. When you’re publishing video you’re  uploading data to the media server. Even tough you might have a 20Mbits/s Internet connection, that’s most probably your download rate, your actual upload rate could be much less. If you’ve configured the video chat to use as much as 768kbits/s per stream, this ammount of video data will not fit in real time trough your 350kbits/s upload pipe!

Problem: dark image or noisy image

Solution(s):

  1. Increase the light in the room, natural light works best.
  2. Get a better webcam.

Problem: no image at all or blank image

Solution(s):

  1. Make sure your web cam is not already used by another app
  2. Make sure the proper web cam is used by Flash Player (Right click -> Settings -> Web Cam tab -> Select the web cam you want to use from the drop down list)

External users list in AVChat 3

Tuesday, April 27th, 2010

Overview

In order to show on your website who is logged in the video chat, AVChat 3 generates 2 external files in the folder where it is installed:

  • users__definst_.txt -> a text file containing the number of unique users connected to the video chat
  • users__definst_.xml -> an xml file containing the list of rooms and users in each room

You will see these files ONLY AFTER THE FIRST USER (NOT ADMIN) LOGS IN THE VIDEO CHAT!

You can use these 2 files to show on your website how many clients are logged in, the room structure or which clients are logged in!

How to actually code/do that is outside the scope of this article but anyone with minumum php or .net experience  should be able to parse the xml/text file and post the contents on the website.

How it works

In detail:

  1. user joins the video chat via index.swf, the path to the writeuserslist.php is automatically detected
  2. user joins a room, the media server sends the new  rooms/users structure to writeuserslist.php via POST (using the path detected at step 1)
  3. writeuserslist.php receives the new info via POST and creates the 2 files on the web server

The media server automatically detects the path to writeuserslist.php WHEN THE FIRST USER (NOT ADMIN) LOGS IN THE VIDEO CHAT.

One some of our integration kits admin.swf and writeuserslist.php are placed in separate folders, that’s why admins logging in do not trigger an attempt to detect the path to writeuserslist.php!

Admins and users are properly listed in the external .xml file as long as at least a user has logged in in the past so that the media server knows where writeuserslist.php is located!

You can also set the path manually (via the settings.asc/avchat3.properties files on the media server) and you should when:

  • you’re using writeuserslist.asp (or any other scripting language) instead of writeuserslist.php
  • you’ve moved writeuserslist.php to a separate folder
  • you have troubles with the external users list not being generated

Troubleshooting

If the 2 files refuse to appear do these tasks in this order:

  1. Log in the video chat trough the user interface (not the admin interface/area)
  2. Make sure the folder containing writeuserslist.php is chmoded to 777 so that writeuserslist.php can write/crate new files
  3. Make sure calls to the new info is POST-ed from the media server to the web server (check Apache logs)
  4. Make sure the folder where writeuserslist.php is located is not password protected!
  5. Hard code the path to writeuserslist.php  in settings.asc ( on FMIS ) or in avchat3.properties ( on Wowza/Red5 ) and restart the media server
  6. contact support: http://avchat.net/support/request-support/

Turning the feature off

On FMIS  edit applications/avchat30/settings asc, set application.writeUsersLists=false and restart FMIS!

On Red5 edit webapps/avchat30/avchat3.properties, set writeUsersLists=false and restart Red5!

On Wowza edit conf/avchat30/avchat3.properties, set writeUsersLists=false and restart Wowza!

This will turn off the feature and stop the media server from making POST calls to the web server!

Changing emote icons in AVChat 3

Wednesday, April 21st, 2010

AVChat 3 supports emote icons and you can add your own emote icons if you want to!

By default AVChat 3 uses the emote icons in the emoticons\standardPack folder. The list of available emote icons in this pack is contained in emoticons\standardPack\emoticons.xml . You can edit this file to add and remove emote icons.

To add an emote icon to the standard pack:

  1. Put the emote icon file (swf, jpg, png, gif) in the emoticons\standardPack folder.
  2. Edit emoticons\standardPack\emoticons.xml and add a new e element before the final </emoticons> tag:
    <e text=”:newemoteicon:” url=”emoticons/standardPack/newemoteicon.swf”></e>
  3. Upload the new emote icon file and the changed emoteicons.xml file to your web site.

In the <e text=”:newemoteicon:” url=”emoticons/standardPack/newemoteicon.swf”></e> XML code:

  • :newemoteicon: is the text that will be replaced in the text chat with the new emote icon
  • emoticons/standardPack/newemoteicon.swf is the path to the emote icon

Some things you should know:

  • AVChat 3 only supports 14×14px .swf, .jpg, .png or .gif files as emote icons.
  • Emote icons larger or smaller than 14×14 will not display properly!
  • Animated GIF’s are not supported (Flash Player limitation).
  • You can also make your own pack with its own emoteicons.xml list file. The path to the emoteicons.xml file used by AVChat 3 can be changed from avc_settings.xxx via the emoticonsurl variable.

On ghost users

Friday, April 9th, 2010

Ghost users are a known issue with all media servers.

What is a ghost user?

A ghost user is a user who’s disconnection from the media server has not been detected by the media server, thus the media server thinks he is still connected.

In a chat you will know there are ghost users when you see 2-3 persons in the users list having the same user name or persons staying for unusual lenghts of time in the chat without activity.possible-ghhost-users

What causes ghost users?

They happen when a user suddenly disconnects from the Internet while connected to a media server (for example by suddenly disconnecting your Ethernet cable or loosing WiFi signal) but in other occasions too like when the user is over a slow connection (mobile connections) or behind some weird combination of network hardware + server software. IE and the way it handles Flash content might also produce ghost users.

How is AVChat 3 dealing with ghost users?

  1. every 3 seconds the client  (swf file) sends a ping to the media server (this value can not be changed)
  2. every 10 seconds the media server (Red5/Wowza/FMIS) check if all clients have sent a ping within the last 10 seconds (already 3 pings should have been sent by every client) and disconnects everyone who has not.

This means that no ghost user will ever stay in the chat for more than 20 seconds.

Starting with build 741 (April) you can contol the above mechanism by changing the value of the checkForGhostConnectionsEveryXSeconds and ghostUsersAreIdleForYSeconds variables in settings.asc (FMIS) or avchat3.properties (Red5 and Wowza). If your users seem to get disconnected for no apparent reason increase the value of ghostUsersAreIdleForYSeconds to for example 20 seconds. Both variables are set by default to 10 seconds.

The IE exception

In some cases when closing a tab in IE, IE will not remove the client side swf (index.swf) from the memory, thus the ping calls will be made  even tough the user has closed the tab containing the chat.  Such ghost users can only be removed by :

  • the user closing all IE tabs and windows
  • an admin kicking him out of the chat

We are working on a  fix for this exception.

HDVR and FLVAR tip: How to save the recorded files in a different folder on FMIS!

Monday, March 15th, 2010

Both the HD Flash Video Recorder and the FLV Audio Recorder grab the audio/video data from the webcam/mic, encode it and send it to the media server where it is saved in a .flv file.

The folder where the .flv files are crated can be changed on FMIS. To do this you need to :

  1. Copy conf\_defaultRoot_\_defaultVHost_\Application.xml to applications/hdfvr or to applications/audiorecorder.
  2. Edit the newly copied Application.xml with a text editor.
  3. Change the value of the <StorageDir></StorageDir> tag (line 191) to the folder where you want the .flv files to be created.
  4. Save Application.xml and restart FMIS or reload the application using the FMIS Management Console.

Ensuring high connection success rate

Tuesday, February 23rd, 2010

Why a connection attempt to a working media server might fail:

Red5, FMIS and Wowza by default only accept  rtmp connections over port 1935. This will work fine for most home Internet connections however when you’re behind a corporate firewall/network you might hit 2 major restrictions:

  1. NO traffic/connections to non standard ports like 1935 (default port for rtmp). Traffic is only allowed to standard ports like 80 (http) and 443 (https) . The solution for this is to configure the media server to accept  rtmp connections over ports 443 and 80 .
  2. NO non-http traffic allowed (or a proxy server is used). The solution for this is to configure the media server to accept  rtmpt connections. Rtmpt is rtmp wrapped as http and its slower. It also adds some overhead/consumes more bandwidth because each rtmp packet needs to be wrapped as http. According to a 2004 Adobe article, only 4% of Internet users are behind such a network.

The automatic connection sequence in Flash Player:

By default, when a Flash Player app (AVChat 3 for example) tries to connect to a media server (Red5, FMIS or Wowza), it automatically tries to establish a connection by using the following sequence of ports and protocols:

  1. rtmp://myserver:1935/avchat30/_definst_
  2. rtmp://myserver:443/avchat30/_definst_
  3. rtmp://myserver:80/avchat30/_definst_
  4. rtmpt://myserver:80/avchat30/_definst_

This connection sequence can enable connections to succeed that otherwise would not. This automatic retry sequence occurs only if the initial connection specifies the RTMP protocol and does not specify a port - for example rtmp://myserver/avchat30/_definst_ . During this connection sequence, users may wait several seconds for multiple connection attempts to time out.

However for the above connection sequence to actually produce more sucessfull connection attempts the media server must also be properly configured to listen for rtmp connections over ports 1935, 443 and 80 and for rtmpt connections over port 80.

Configuring your media server for best connection success rate:

[Before making the below changes make sure there is no other program listening on port 80 or 443 on your media server. These ports are surely already used by Apache. Use the netstat -ant command on linux to see which ports are already used.  FMIS, Red5 and Wowza use port 1935 by default for a reason!].

If you’re using FMIS:

  • solution for restriction 1: move it to a separate server and configure it listen for rtmp connections over ports 1935, 443 and 80. You need to edit conf/fms.ini, set ADAPTOR.HOSTPORT = :1935,443,80 and restart FMIS. Make sure you don’t have other apps (like the Apache web server) started and listening on 80 or 443.
  • solution for restriction 2:  same as above, FMIS can listen for both rtmp and rtmpt connections over the same ports at the same time

Most FMIS hosting services (like influxis.com) are already configured like this  out of the box.

If you’re using  Wowza:

  • solution for restriction 1: move it to a separate server and make it listen for rtmp connections over ports 1935, 443 and 80. You need to edit conf/VHost.xml , set <Port>1935,443,80</Port> and restart Wowza. Make sure you don’t have other apps (like the Apache web server) started and listening on 80 or 443.
  • solution for restriction 2: same as above, Wowza can listen for both rtmp and rtmpt connections over the same ports at the same time

If you’re using Red5:

  • solution for restriction 1: move it to a separate dedicated/vps server and bind rtmp connections to port 443 instead of 1935 (Red5 0.9 can not listen for rtmp connections over several simultaneous ports like Wowza and FMIS can). You need to edit conf/red5.properties, set rtmp.port=443 and restart Red5. Make sure you don’t have other apps (like the Apache web server) started and listening on 443 . You can also use port 80 but we will use that for listening for rtmpt connections as explained below.
  • solution for restriction 2: bind rtmpt connections to port 80. You need to edit conf/red5.properties, set rtmpt.port=80 and restart Red5. Make sure you don’t have other apps (like the Apache web server) started and listening on 80.

How can you check your connection

Here you will find 2 port testers which will attempt to establish rtmp and rtmpt connections (using all ports) to a properly configured media server. Red5 ships with a similar tool and you can download another one from here.

More info

There is a great article (from 2005 I think) on the Adobe website that goes more in depth about these issues. I recommend you read it if you want to understand a little bit more about how the Internet works and why these steps are necessary and why such configurations are not the default: http://www.adobe.com/devnet/flashcom/articles/firewalls_proxy.html .