Alembik server is an enterprise J2EE application that is built (into EAR archive) from the following set of modules:
Each module is provided with its own Ant build script along with configuration files for Eclipse environment.
Application server platform
The build scripts depend on two configuration files from /alembik-build/etc directory:
Initially both have to be created and filled according to the content of their counterparts: sample.properties and %servertype%.sample.properties respectively. The actual server type is determined at runtime by the use.server property (the example setting below selects Glassfish).
After choosing a particular application server, say Glassfish, the glassfish.local.properties file has to be filled with appropriate parameter values. In majority they constitute the set of Configurator's initial values and can be modified after deployment at the server's runtime.
First the folder paths to server libraries need to be specified (see Alembik installation chapter).
Then a disk location must be provided for the Storage component to place downloaded media sources along with all transcoded results. The Storage directory (transcoding.storage.root.dir) has to be chosen carefully, since it is directly related with a URL path to transcoded files (transcoding.storage.url.path), which is sent back to clients. At present, the root directory of Storage has to be equal to the real path, into which the appointed URL gets resolved by Alembik's web server.
The next configuration step involves choosing the desired media processors from the 'alembik-core' module. Currently there are two options for image processing: ImageMagickMediaProcessor and GAIAMediaProcessor, while there is only one for audio and videos: FFMpegMediaProcessor. The actual selection is to be made with transcoding.%mediatype%.mediaprocessor parameters, where the %mediatype% token may be image, audio and video, while the value has be set to a full processor's Java classname.
Choosing ImageMagick and/or FFmpeg as transcoding tools for Alembik requires further customization. Then the full path command line has to be specified for each selected tool. Besides, in the case of FFmpeg, the version of the codec library and (optionally) the the path to imlib2 library are required too. See installation guidelines for in-depth details.
Definition files directory
And last but not least, there has to be determined the directory where WURFL configuration files are placed (they are used by the Alembik's default User-Agent resolver). That is also the place where one may put custom definition files, like predefined profile definitions, FFmpeg codec dictionary and supported video/audio codecs.
HTTP server parameters
In addition to the configuration steps described above there are four more parameters related to the HTTP service domain. The most important is transcoding.servlets.url, which stands for the URL of Alembik web application; the URL is used by the web rendering processor for constructing links to Alembik servlets in transcoded HTML content.
Further on there are transcoding.admin.login and transcoding.admin.password - the credentials for accessing the server's administration console.
Finally there is a set of parameters associated with error handling and status checking via HTTP protocol. Since all of them are optional, they should be specified ONLY when one wants to provide his own implementations outside Alembik environment.
Actually there are four properties to be customized in the local.properties file (if necessary):
Alembik passes the processing data to the custom JSP pages through a set of request parameters, whose names are defined in the Constants class.
Enabling streaming requires additional software installation. Once installed there ought to be transcoding.mp4box.command property set, which describes a full-path MP4Box command line. MP4Box is a utility marking media files with appropriate time signatures.
Moreover, the URL path to Darwin streaming server must be assigned to transcoding.streaming.storage.url.path parameter.
NOTE: MP4Box does not work correctly with file paths with a length over 16 characters. Hence if the value of the transcoding.storage.root.dir parameter is longer one must create a shorter soft (virtual) link replacing the real path. For example:
Next the configuration of Darwin server (defined in streamingserver.xml file) has to be adjusted to the aforementioned Alembik settings.
The path to media content (movie_folder property) has to be set accordingly to the Storage directory setting (refer to transcoding.storage.root.dir). Then a new port number (the one from the streaming URL path passed to Storage - see transcoding.streaming.storage.url.path just above) must be appended to the Darwin's port numbers list (rtsp_port list).
Having all the above parameters supplied, one can launch a complete build process using the assemble_dependencies Ant task from /alembik-build/build.xml script. If the build is successful it should produce alembik.ear or alembik.war archive inside /alembik-build/assemble folder, ready for deployment in a selected J2EE/Web application server.
The actual type of the file depends on the chosen server; in case of Glassfish and JBoss the EAR archive will be produced, while Tomcat-oriented build will yield the WAR file.
Once the server archive is built and deployed, an EJB or SOAP client archive (alembik-client.jar at /alembik-client/assemble) can be built. The EJB client script (/alembik-client/build-ejb.xml) requires EJB connection parameters to be set (all are prefixed by transcoding.ejb.).
Its SOAP counterpart (/alembik-client/build-soap.xml) needs only the URL of a WSDL file, which can be specified by transcoding.soap.wsdl property. Since the WSDL file is produced automatically during Alembik start-up, the server has to be running to make possible its SOAP client library build.
Example web application
Another module that can be constructed from the sources is the exemplary web application (alembik-web.war), which one may put together with /alembik-webapp/build.xml file. In this case we have to determine, which client (EJB or SOAP) is going to be used to get connected to Alembik server; assign either ejb or soap values to use.client flag in local.properties in order to choose a desired communication option.
For everyone, who is not satisfied with pure Ant development there is a ready-to-use option of using Eclipse tool. Though there are certain prerequisites in order to achieve a fully operative Eclipse environment. Since Glassfish AS has been chosen for a primary platform of Alembik development, all Eclipse modules are configured to use some environment properties provided by the IDE Glassfish plug-in (available here).
The plug-in itself requires its own prerequisite software, hence the fastest way to achieve a complete IDE is to plug it into an enhanced Eclipse distribution called Easy Eclipse Server. Easy Eclipse version 188.8.131.52 combined with Glassfish plug-in v. 0.4 make a safe and proven bet.