Difference between revisions of "GenReS"

From ElphelWiki
Jump to: navigation, search
(Configuration: new section)
(options in genres.conf)
Line 10: Line 10:
The files can contain shell-like comments.
The files can contain shell-like comments.
=== options in genres.conf ===
=== options in genres.conf ===
;mozillastreams={1|0} :- use or not mozilla streams (and cache) for http, https and ftp;
;mozillastreams {1|0} :- use or not mozilla streams (and cache) for http, https and ftp;
;debuglevel={1|0} :- enable or disable the debug output.
;debuglevel {1|0} :- enable or disable the debug output.
=== options in mplayer.conf ===
=== options in mplayer.conf ===
;out_file_once=template :- template for filename;
;out_file_once=template :- template for filename;

Revision as of 11:41, 30 April 2006

in English | [[{{{de}}}|deutsch]] | [[{{{fr}}}|français]] | по-русски | автоперевод | 中文版 | 机械翻译

Project Pages


The plugin uses "~/.mozilla/genres/genres.conf" or "/etc/genres.conf" as main config file. Options for mplayer, mencoder and ElphelOgm are stored in the config file "~/.mozilla/genres/mplayer.conf", which is used by mplayer.pl control script. The files can contain shell-like comments.

options in genres.conf

mozillastreams {1|0} 
- use or not mozilla streams (and cache) for http, https and ftp;
debuglevel {1|0} 
- enable or disable the debug output.

options in mplayer.conf

- template for filename;
- template for filename for tags with parameter save=auto;
- Video output driver (see man mplayer about -vo option);
- Audio output driver (see man mplayer about -ao option);
- not show file save dialog for tags with save=auto parameter;
- Frames per file limit for recording (output will be splitted).

Usage in Javascript

Static tag parameters

decimation for accelerated DCT (0-3);
width of the object window;
number of iterations of the playback (0 or nothing is infinite);
frame frequency;
skip n frames after one saved;

Dynamic variables (can also be used as the parameters of tags)

url of the file or stream;
as yet simply another name for href.
pause=1 or play=0
to pause player;
pause=0 or play=1
to continue playback;
go to time or percent specifed, maybe not works if mplayer is not support seeking for the current file;
show next frame and pause (for step-by-step view);
to start player again if it was terminated (by error or end of file);
to terminate player;
to run mencoder or ElphelOgm as recorder instead of mplayer;
to always ask the file name for recording;
not to ask if user sets it in dialog

Status variables

This the output from mplayer or mencoder. Now strings simply are split into two parts on the first of the symbols '=' or ':'. The left part becomes a name of the variable (gaps and nonlatin letters are removed) and the right part is a value.

the message from mplayer/mencoder about the last frame;
last error message;
fatal error message from mplayer;

Other variables are possible but they are not used as yet.

special variable, the state of player process: 0 - not running, 1 - running;
pause, play
it is analogous - the pause state.

Callback functions

On the arrival of data from a player it is transferred to the object variables and it becomes accessible from javascript. In this case if it is assigned the function with the corresponding name "on<variable_name>" will be called.

will be called on starting and stopping of playing or recording processes;
on error message;
on each frame playing.
onmousedown and other standard callbacks
are given already by the browser and do not need extra code inside the plugin.

Back-end programs

Currently used:

  • mplayer (compiled with live555)
  • mencoder from mplayer package
  • ElphelOgm - for receiving pure multicast or unicast rtp with mjpeg video.

For ElphelOgm to be used, the mime-type must be application/x-elphel-ogm or begin with video/m and the URL must be specifed as: rtp://ip:port/ , where:

ip -
the stream multicast ip
port -
the stream multicast port

For a unicast the destination i.e. client ip:port must be specifed and a stream server must be programmed to continuously send the stream to this address and port. Dynamic changing of the URL is not yet supported for RTP. Instead use the sequence: obj.run=0; obj.src=...; obj.run=1;

Trouble shooting

Run the script mplayer.pl from a command line. It is located in /usr/lib/genres. If all necessary perl modules are installed, it must print several strings in the form: "variable=value" and wait input. If you see message "Can't locate Gtk2.pm in @INC" this mean that need to install this module from your distro or from CPAN. Other links: gtk2-perl home page, gtk2-perl on CPAN, gtk2-perl on freshmeat.

Enter parameters as they presented in the html tag, but by one in line and add run=1 at the end. For example:


If MPlayer is running then this part works, try to see example html page in the browser (mozilla or firefox). If you don't see video in the browser, but instead see a gray rectangle, maybe the page has wrong url.

See the list of installed plugins with url: about:plugins and if there is no GenReS, maybe genres.so is in a wrong place.

The plugin produce debug output. Start mozilla or firefox with redirection to a file:

mozilla -debug >& moz.log

For firefox -debug is not need. Gzip and send this file to me to research.

--Sergey Khlutchin 01:55, 8 February 2006 (CST)