Visitors

Documentation

Setting up your system


First thing you need to do is make sure that you have GStreamer framework installed.

In Ubuntu:

sudo apt-get install gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse

As JapelServer relies on the GStreamer framework, being able to read movies depends on the plugins you have installed

JapelServer is a Java application and needs OpenJDK or Sun's JRE.  Make sure that you have installed Java on your PC

In Ubuntu:

sudo apt-get install openjdk


There, you're all setup.  JapelServer can be run from any folder, so just unzip the binary package in the folder of you choice.  Then you will have to edit the configuration file.  You can have multiple configuration files so you can launch JapelServer with the configuration of your choice.  The most important item to configure is where to find your movies.  See the "moviesfolder" item in the configuration file.

Once everything is configured as you need, simply open a console in that folder and launch:

java -jar JapelServer japel.propertie


Customizing the webpage

You can create your own webpage, default being index.html in the folder movie.
All webpage must be located in the same folder as the movies

Here is an example to display the movies and the stream

   <H2>Movies</H2>
   <a href="JAPELSOURCELINK">JAPELSOURCE</a> <PROFILES><a href="JAPELPROFILELINK">JAPELPROFILE</a>&nbsp;&nbsp;</PROFILES><BR>
   <H2>Streams</H2>
   <a href="JAPELSTREAMLINK">JAPELSTREAM</a>

HTML code for movies or streams must be on a single line.

  • JAPELSOURCE: The name of the movie file
  • JAPELSOURCELINK: The direct link to be able to download the file without transcoding
  • <PROFILES></PROFILES>:  Define a block where the profiles will be located for the source movie
  • JAPELPROFILE: The name of the profile to use
  • JAPELPROFILELINK: The link used to request the source movie to be transcoded for streaming
  • JAPELSTREAM: The name of the stream
  • JAPELSTREAMLINK: The link used to request a transcoded stream for that source
Note: It is very important that the tags are uppercase, otherwise, JapelServer will not recognize them...

Profiles

Has you may have already seen, you can have multiple profiles for each movie.  A profile is a particular configuration of GStreamer that will output the stream in a particular format.  For more details about GStreamer, read the documentation on the official GStreamer website

Profiles are configured in the japel.properties file.  First thing you have to do is edit the list of available profiles

# The different profile list to be used for movie files
profiles=50k,500k

Profiles will be listed in alphanumerical order in the webpage.  Then, you have to create a line defining the GStreamer configuration to use.  Make sure that the profile name is exactly the same as it is listed in the profles tag.

# Profile for the iPhone
50k=filesrc name=file location=SOURCE ! decodebin name=demux { mpegtsmux name=mux ! tcpserversink port=PORT }     { demux. ! queue ! audioconvert ! faac profile=2 ! queue ! mux. } { demux. ! queue ! videorate ! x264enc bitrate=50 ! mux. }
# Profile for using VLC as a client
500k=filesrc name=file location=SOURCE ! decodebin name=demux { mpegtsmux name=mux ! tcpserversink port=PORT }     { demux. ! queue ! audioconvert ! faac profile=2 ! queue ! mux. } { demux. ! queue ! videorate ! x264enc bitrate=500 ! mux. }

You can test these configuration from the command line to make sure that they work (Of course, you will have to replace manually the "PORT" and "SOURCE" keywords).

  • SOURCE: The name of the movie file will be set at the SOURCE keyword.  Make sure that "SOURCE" is all upper-case
  • PORT: The local port used by GStreamer to start the TCPServersink.  This is the value configured at "gstreamerport"
  • filesrc name=file: This is helping JapelServer find the source where the file will be setup.  Some movies may not play if name=file is not set.
  • tcpserversink is mandatory as JapelServer will connect to that element to retrieve the stream and broadcast it over HTTP protocol.
  • Essentially, filesrc and tcpserversink are mandatory.  Anything between them as for video and audio can be customized for your needs.
By default, JapelServer is configure to be used by an iPhone, but you could create a profile to support any device that can read streams over a network.

Streams

Streams are dedicated profiles that you can configure to stream from a webcam for example.  As for profiles, the PORT keyword must be included as the tcpserversink element.  Anything before the tcpserversink element can be set as you need.

# Streams are direct sources to be streamed like a webcam or a feed on the internet
streams=Webcam
# A profile that will stream the webcam
Webcam=queue v4l2src device=/dev/video0 ! video/x-raw-yuv,width=160,height=120 ! ffmpegcolorspace ! videorate ! video/x-raw-yuv,framerate=5/1 ! x264enc ! mux. { mpegtsmux name=mux ! tcpserversink port=PORT }  { gconfaudiosrc ! queue ! audioconvert ! faac ! queue ! mux. }

With streams, you can broadcast your webcam, an internet stream (audio or video), a specific file on your PC, your DV cam.  It up to you!