Getting the system to work Actually this version is not for script-kids - I am sorry ;-) What it is: the streamnik server is an IPTV server, which creates a number of video streams due to definitions from a sql database. Every film has a definit starting point within a day. When the server starts it seeks to the actual file position and starts streaming. What you need for compilation: ------------------------------ Common C++ with devel (available on most distributions) Mysql (mysqlclient) (will also be available with you favorit distribution) To compile, everything works as usual: ./configure make sudo make install What you need to start the server: ---------------------------------- shorties: short films for error handling previews: short preview films (e.g. ads - this stream is presented by ...) videos: videos to show up all videos, shorties and prieviews must match in framerate, keyframe-distance etc. shorties and previews are actually cached with a key name and are compiled in (next version might use a database entry for that) Startup: -------- just start the server: > StreamnikServer -d -u -p and access the server e.g. by mplayer: > mplayer "http://localhost:12000/video.ogg?channel=1" However, befor all of that, you need to set up a number of additional things: DATABASE: --------- You need a sql-database up and running. Statements are shown at the end of this document. The database name and password can be added on the command line. FILES: ------ You need the following file structure (can be changed in serverConfig.h): home > shared > ogg > shorty The ogg directory carries all files, that should be streamed. Every file has a corresponding entry in the sql database ("videos" table). The shorties are small ogg files which are shown on an error. shorty_1.ogg -> no stream available shorty_2.ogg -> unauthorized access shorty_3.ogg -> streaming timeout shorty_4.ogg -> database not available Then you can add previews (short films befor the original stream, e.g. for adds) This file must be placed in the shorty directory as well and are named preview_*.ogg. The system will not be happy if they are not present, but will start up CHANNELS: --------- Channels are opened by an entry in the sql database. This entry must actually be present on startup. For every channel, a StreamCreator object will be created, which will send it's data to a multiplexer. This will then handle all client requests. TcpListener (Port 12000) <--- newClient | | sql Database Access | ^ | --> StreamSend ( Client 1 ) | | / file -> StreamCreator -> Multiplexer ---> StreamSend ( Client 2 ) Stream 1 | \ | --> StreamSend ( Client 3 ) | sql Database Access | ^ | --> StreamSend ( Client 4 ) | | / file -> StreamCreator -> Multiplexer ---> StreamSend ( Client 5 ) Stream 2 | | | sql Database Access | ^ | ---> StreamSend ( Client 6 ) | | / file -> StreamCreator -> Multiplexer ----> StreamSend ( Client 7 ) Stream 3 \ \\--> StreamSend ( Client 8 ) \ --> StreamSend ( Client 9 ) ... SCHEDULE: --------- The schedule is placed into the "schedule" table in the database. ("day_id" and "date" are actually not in use) channel_id and video_id correspond to the entries in the other tables. every film has a position (in a day). A day starts at 4:00. The first entry within one block of films should be marked with status "1". If you have a film, which is not continously connected, you should add the "1" status again. Have fun Yorn ****************************************************** * * SQL database creation * ****************************************************** CREATE TABLE `schedule` ( `day_id` int(11) unsigned NOT NULL default '0', `date` varchar(8) NOT NULL default '', `channel_id` int(11) unsigned NOT NULL default '0', `position` int(10) unsigned NOT NULL default '0', `video_id` int(10) unsigned NOT NULL default '0', `duration` int(10) unsigned NOT NULL default '0', `status` tinyint(3) unsigned NOT NULL default '0' ) CREATE TABLE `videos` ( `id` int(10) unsigned NOT NULL auto_increment, `owner` int(10) unsigned NOT NULL default '0', `title` varchar(80) NOT NULL default '', `subtitle` varchar(80) NOT NULL default '', `author` varchar(80) NOT NULL default '', `copyright` varchar(160) NOT NULL default '', `description` varchar(255) NOT NULL default '', `time_added` int(10) unsigned NOT NULL default '0', `duration` int(10) unsigned NOT NULL default '0', `ready` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`) ) CREATE TABLE `channels` ( `id` int(11) unsigned NOT NULL default '0', `name` varchar(80) NOT NULL default '', `owner` int(11) NOT NULL default '0', `description` varchar(80) NOT NULL default '', `randomplay` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id`) )