Video Recording Applet SDK is designed to record the video from the web site in Mp4 format and upload video file to the web server via HTTP. Also, applet captures the images and saves them on the server in JPEG format ("photo camera" mode).
Recorded video file in Mp4 format contains the video in H.264 and audio in AAC formats. To video and audio encoding the x.264 and FAAC encoders are used correspondingly. Video&audio capture, encoding/decoding, image capture and JPEG encoding are implemented as native methods in the video module which will be installed on the client computer when user uses the applet for the first time. The applet is digitally signed.
Target OS Platform: 2000/ME/XP/2003/Vista/Win7, Mac OS 10.5/10.6
Target browsers:
- on the Windows: Microsoft Internet Explorer 4.0 and up, FireFox, Mozilla, Opera, Safari.
- on the Mac: Safari, FireFox.
Java versions: Java plug-in 1.5 -1.6.
Web Servers: Unix, Microsoft which support PHP.
Video recording applet supports web cameras and DV cameras.
Note! Non-licensed applet works in the Demo mode. In the Demo mode applet records 20 sec video only. Also, in the "Photo camera"/Demo mode captured images are watermarked.
To get applet working in the full functional mode you should buy the license. VIMAS Technologies team will send you registration key ( small txt file). After the registration applet will work in the full functional mode without 20 sec limitation and without watermarking of captured images. More info is here How to register the applet
The retrive_v.php and localization.xml you may put in any folder on the server. Define the URLs of these files in the "ServerScript" and "LocalizationFile" applet parameters correspondingly . overlayImageLarge.png, overlayImageSmall.png you may put also in any folder on the server. Define the URLs of these files in the "OverlayImageURL" applet parameter.
In case if you need to put VideoApplet.jar and web page are in the different folders – path to applet must be defined in the CODEBASE applet parameter.
Note!
always must be in the same folder with VideoApplet.jar.
Fig.1 |
Fig.2 |
---|
The size of video frame on the Fig.1 is 320x240 pixels. You can change the size of video field to 176õ144 pixels, Fig.2
To change the size of video field use "FrameSize" applet parameter.
< PARAM NAME = "FrameSize" VALUE = "small" > - frame size is 176õ144 pixels.
< PARAM NAME = "FrameSize" VALUE = "large" > - frame size is 320 x 240 pixels.
The examples are VideoApplet_large.html and VideoApplet_small.html.
You can hide buttons, indicator of buffer filling, menu and use JavaScript buttons, like on the Fig.3 and Fig.4 below. Use the following applet parameter:
< PARAM NAME = "interface" VALUE = "compact" >
If applet parameter "interface" is absent, the GUI will be like on the Fig.1 or Fig.2.
Fig.3 |
Fig.4 |
"Compact" interface allows to create interaction between your web application and applet via JavaScript functions. Also, you can create your own images of buttons corresponding to your web site style.
To show the menu ( Options, Help ) in Compact mode, add to the applet parameter the following:
< PARAM NAME = "showMenu" VALUE = "true" >
Note! "showMenu" applet parameter works in Compact mode only.
In the VideoApplet_compact.html example you can find all JavaScript functions which invoke the applet methods.
Applet records video and saves it into the temporary file, then uploads it to server by using HTTP POST method. On the server side the retrive_v.php server script receives mp4 file. If the file is too large, applet divides it on parts and uploads each part separately. The size of each part in bytes is defined by BlockSize applet parameter.
Example:<PARAM NAME = "BlockSize" VALUE = "20480">
Applet uploads video file into the folder, defined by VideoServerFolder and UserServerFolder parameters, like http://www.yourdomain.com/videofiles/User1/
Applet uploads images to the server in the same manner as video files.
1. Regular interface, Fig. 1, Fig.2.
You have 2 options to set the name of the video/image file.
a) You can type video/image file name in the pop-up window, which appears when you push "Upload video to server" button (10).
b) You can pass video/image file name from web page to applet. So, user should not type file name in the pop-up window. To pass video/image file name from web page to applet and eliminate pop-up window, you can use setFileName() JavaScript function . You can see it in the VideoApplet_large.html and VideoApplet_small.html examples. To use setFileName(), please, uncomment it. Use file name as argument for setFileName().
2. "Compact" interface, Fig.3, Fig.4.
You can pass video/image file name from web page to applet. Use UPLOAD_VIDEO( String filename ) applet method.
The example of using UPLOAD_VIDEO( String filename ) :
function UPLOAD_RP() {
document.VimasVideoApplet.UPLOAD_VIDEO(String(document.Gui_RP.FileName.value));
}
Also, see it in the VideoApplet_compact.html example.
Applet parameter name | Parameter value | Parameter description |
"ServerScript" | e.g. "http://www.vimas.com/recorder/retrive.php" | Server script URL |
"VideoServerFolder" | e.g. "http://www.vimas.com/videofiles/user1/retrive.php" |
URL of server folder for the video files storing. |
"TimeLimit " | 1...N seconds | N – is maximal recording time in the seconds. It is hardcoded in the license file. |
"Registration" | a) “Demo” b) Name of file with registration key. For example, “RegKey.txt” |
a) Applet works as demo, the maximal recording time is 20
sec. If Registration parameter is absent, applet works as demo, too. b) The registration key file you will receive after licensing. File must be located on the server in the same directory with applet. |
"BlockSize" | E.g. 10240 | Applet uploads audiofile portion by portion. This parameter defines the size of portion in bytes. |
"UserPostVariables" | Variable names. Ex: "name,age,city" | The names of variables to upload to server with voice file. Please, see How to send variables to server with audio file |
"UserServerFolder" |
e.g. "User1" |
Defines the subfolder which is in the VideoServerFolder. |
"FrameSize" | "small" or "large" | Defines the size of frame. "small" - 176õ144 pixels, "large" - 320x240 pixels. |
"LowQuality , "NormalQuality" "HighQuality" |
e.g. "96,24", "160,32" "256,48" correspondingly. These values are recommended for "large" frame size. "32,24", "64, 32", "128,48" - recommended values for "small" frame size. |
Defines the quality of video and audio. First value - video bitrate in kbps, second value - audio bitrate in kbps. |
"PhotoQuality" | 0.0....1.0 | This parameter defines the quality of JPEG image when applet works in "photo camera" mode |
"interface" | "compact" | This parameter makes interface like on the Fig.3 and Fig.4 |
"showMenu" | "true" | It allows to show the Option and Help menu if GUI like on the Fig.3 and Fig.4 . In case if "showMenu" applet parameter is "false" or absent the menu is hidden. "showMenu" applet parameter works only if "interface"applet parameter is "compact". |
"OverlayImageURL" | e.g "http://vimas.com/testVideo/overlayImage.png" | This parameter defines the URL of image for watermarking of video. |
"NoVideo" | "true" | Switch off the video recording. Applet records audio only. If applet parameter is "false" or it is absent, applet records video and audio. |
Applet methods | Applet action |
RECORD_VIDEO() |
Start to record video clip |
PLAY_VIDEO() | Start to play recorded video clip |
PAUSE_VIDEO() | Record/Playback pause |
STOP_VIDEO() | Record/Playback stop |
UPLOAD_VIDEO( String filename ) | Uploads video/image file on the web server. |
jPhoto () | Captures still image |
ERASE_PHOTO () | Erases still image in case if user does not like it |
User can choose the quality of video/audio recording in the menu "Option". In the menu 3 levels of video/audio quality are offered: Low, Normal and High. The video/audio quality levels are defined in the applet parameters "LowQuality" , "NormalQuality" "HighQuality" by using video/audio bitrates. If these applet parameters are absent, default parameters will be used. They are in the table below.
Quality parameter | Large frame size. Video,audio in kbps |
Small frame size. Video,audio in kbps |
LowQuality | 96, 24 | 32, 24 |
NormalQuality | 160, 32 | 64, 32 |
HighQuality | 256, 48 | 128, 48 |
To set the image quality in the "Photo camera" mode use "PhotoQuality" applet parameter. Its value should be in the range 0... 1.0
SENDING
You can send your own POST variables with video file via applet parameters by using:
NOTE! Every parameter, which is declared in UserPostVariables variables, should have it's own parameter with it's value.
NOTE! If video file transmitted to server portion by portion, the variables will be sent with each portion.
PROCESSING ON THE SERVER
You can process video file variables in the retrieve_v.php. For example, this code will print all received variables:
while(list($key,$val)=each($_POST))
{
AddLogs($errfile,"POST variable received >".$key." = ".$val);
}
ADDITIONAL INFORMATION
To make watermarking of video ( e.g. put on the video the logo of your company or advertisement ) you should prepare the picture in the PNG format on the transparent background. The size of picture should be the same as frame size. Put this picture on the server and add to the applet call the following applet parameter:
< PARAM NAME = "OverlayImageURL" VALUE = "http://path_to_folder_with_image/ImageName.png" >
Note! The top-left corner of picture will be superposed with top-left corner of video frame.
The Video Recording Applet can be used on the web site to make a photo ( to capture the image in JPEG format) and save it on the server. To understand how to use Video Recording Applet in the "Photo camera" mode please use the example web page VideoApplet_photo.html.
To pass image file name from the web page to applet, please use UPLOAD_VIDEO( String filename ) method in the same manner as in video recording mode.
To set image quality use "PhotoQuality" applet parameter. Its value should be in the range 0... 1.0
In the "Photo camera" mode applet uses 2 specific buttons: "Photo" and "Erase" . To make photo click on the "Photo" button. If you do not like the photo you did, click on the "Erase" button and make photo again.
In case if applet works in the demo mode, the captured image will be with special watermarking. After licensing of applet this watermarking will be removed automatically.
Video Recording Applet can record audio only, without video. In this case the Mp4 file will contain the audio track only.
Applet can record audio only in a few cases:
1. No camera connected to computer or camera is used by another application.
2. User choosed "No device" in the menu Option->Video device.
3. Web site developer set the following applet parameter:
<PARAM NAME = "NoVideo" value="true">
Note! In case 3 the field for video frame will be hidden.
So, if you want to use Video Recording Applet as Audio Recording Applet, the case 3 is recommended.
Status messages are displayed in the status messages field. Also, a few messages can be passed from applet to special JavaScript function SetStatus(num,s)
. So, web site developer can intercept these status messages to use them as events to synchronize the applet work with other elements of web page.
Message | Code of message |
---|---|
Start upload | 0 |
File uploaded | 1 |
Start record | 2 |
Start play | 3 |
Pause | 4 |
Stopped | 5 |
Ready | 6 |
The video recording applet can be used in the demo or full functional mode. To use applet in demo mode , you should add to applet parameters the following parameter:
<PARAM NAME = "Registration" VALUE = "Demo">
Applet also works in demo mode if "Registration" parameter is absent.
In demo mode the applets will work with limited to 20 sec recording (playback) time. In the "Photo camera" mode the captured images in demo mode are watermarked.It is single difference between demo and full functional applet modes.
To use applet as full functional you must :
All applet text messages are collected in the localization.xml file. You can translate them on the any languagel.
The localization.xml file have to be located on the server. The path to this file have to be defined in the "LocalizationFile" applet parameter. For instanse:
<PARAM NAME = "LocalizationFile" VALUE = "http://vimas.com/recorder/video/localization.xml">
If this applet parameter is absent, english text messages will be used. They are hardcoded in the applet.
The Help is in the help.html file. So, you can create your own help.html file in your national language.
Note! Do not change the file name. Applet always calls help.html file.
Video Recording Applet supports web video cameras and DV cameras.
Applet supports almost all types of web video cameras. If you have problems with some type of web video camera, please inform us.
You can use the DV camera in the following ways:
a) real time passing video from DV camera to computer and recording video by Video Recording Applet ( it is the same as you use web camera).
b) passing prerecorded video from DV camera to computer and recording video by Video Recording Applet .
a) Check if Java plug-in is installed on your computer.
b) Check, if applet using in the browser is permitted.
c) Check if applet file VideoApplet.jar is located on the server in the same folder with web page which calls the applet.
a) Check if jvideoWin.tar and jvideoMac_ppc.tar, jvideoMac_x86.tar and jvideoWin.hash.txt , jvideoMac_ppc.hash.txt , jvideoMac_x86.hash.txt are on the server in the same folder with VideoApplet.jar applet file.
b) Check if it is possible to download jvideoWin.tar or jvideoMac_ppc.tar, jvideoMac_x86.tar from server via browser. Enter to address field of browser the URL of jvideoWin.tar. For instanse:
http://www.vimas.com/recorder/jvideoWin.tar. If browser can not download that file, applet also can not do it. Figure out why jvideoWin.tar can not be downloaded.
a) Check if video camera is connected to your computer.
b) Check video camera with other application. Note! applet will not work if video camera captured by other program.
a) Check if in the "ServerScript" applet parameter the correct path to retrive_v.php is defined.
b) Check ifon the server the file saving is permitted to folder and subfolder which are defined in the "VideoServerFolder" and "UserServerFolder".
c) Server script retrive_v.php is developed in PHP. So, check if server supports the PHP.
For support: info@vimas.com