index.sgml
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:25k
源码类别:

mpeg/mp3

开发平台:

C/C++

  1. <!doctype book PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
  2.  ]>
  3. <book>
  4.   <bookinfo>
  5.     <date>$Date: 1999/03/13 03:06:34 $</date>
  6.     <title>Stony Brook Video Server project</title>
  7.     <subtitle>$Id: index.sgml,v 1.21 1999/03/13 03:06:34 andrew Exp $</subtitle>
  8.   </bookinfo>
  9.   <toc></toc>
  10.   <!-- We are done with the preliminaries, now we can start with
  11.   the body of the document -->
  12.   <!-- chapter -->
  13.   <chapter>
  14.     <title>Legal notice</title>
  15.     <para>
  16.       This document and the source code of the program have different 
  17.       copyrights.
  18.     <para>
  19.       The description of Video Server (this document) 
  20.       and any project documentation including the automatically generated code
  21.       description visible from this document
  22.       have the following copyright:
  23.     <para>
  24.       This document is copyrighted by Andrew V. Shuvalov under GPL ( GNU 
  25.       public license ). The copy of the GPL may be obtained from www.gnu.org
  26.     <para>
  27.       <function>Warning.</function> The license terms of 
  28.       the program itself are not 
  29.       strictly compatible with OpenSource and/or GPL. This program is not 
  30.       copyrighted by me so all license terms are beyond my control.
  31.     <para>
  32.       This soft is released with as much open license terms as it is 
  33.       possible.
  34.       So while terms are politically 
  35.       incorrect from the point of view of OpenSource ideology, and that 
  36.       unfortunately prohibit it to be integrated into GPL'd projects, 
  37.       practically it is very open. You can modify sources and you have no
  38.       restriction to redistribute and repackage all changes until the 
  39.       source code is open and license is kept unchanged. 
  40.       You can put this software on any CD-ROM
  41.       that carry useful software and sell it. And what is the most important 
  42.       you can use this software for free unless you do not charge fee for
  43.       using it. That means you cannot use it for profit
  44.       without permission. So it is free like free beer, 
  45.       but not like free speech. If you want to use it for profit, you 
  46.       should contact the copyright holder and reach the agreement.
  47.     <para>
  48.       The video server source code is copyrighted by State University of
  49.       New York at Stony Brook.
  50.     <para>
  51.       Andrew V. Shuvalov 
  52.       <ulink url=
  53.         "http://www.ecsl.cs.sunysb.edu/~andrew">
  54.          http://www.ecsl.cs.sunysb.edu/~andrew</ulink>
  55.   </chapter>
  56.   <chapter>
  57.     <title>Overview</title>
  58.     <para>
  59.       <emphasis>Stony Brook Video Server</emphasis> is the distributed video
  60.       server application that provides indexing, searching and video streaming
  61.       in a convenient way to the clients over the network.
  62.     <para>
  63.       Video information is indexed by title in database accompanied with
  64.       additional information:
  65.       <ITEMIZEDLIST MARK="bullet" SPACING="compact">
  66.         <listitem>
  67.         <para>
  68.           Complete text of each movie, each line has a timestamp for 
  69.           back reference
  70.         <listitem>
  71.         <para>
  72.           Statistical information on each movie
  73.         <listitem>
  74.         <para>
  75.           Location of movie data. Actual movie data may be distributed over
  76.           the network. This allows scalability of the database and
  77.           reduction of the network traffic.
  78.         <listitem>
  79.         <para>
  80.           Additional description of movie
  81.       </ITEMIZEDLIST>
  82.     <para>
  83.       The client provides the easy and convenient access to multimedia data.
  84.       Client may browse the complete list of movies, search the closed 
  85.       captioned text by keywords and 
  86.       boolean expressions and play selected video from the beginning or 
  87.       from the point matching search query. The displayed fragment is 
  88.       synchronized with closed captions text information.
  89.     <para>
  90.       Direct broadcast to client is provided as well. The up-to-date list of 
  91.       channels available for this local network is listed to the client.
  92.       It may select the channel and receive the video and closed captions.
  93.     <para>
  94.       Several data acquisition 
  95.       servers may record data from video source ( acquisition server ), 
  96.       broadcast the live video over network and store data for playback on
  97.       demand.
  98.     <para>
  99.       At the same time push video servers may provide each client 
  100.       with individual data stream from
  101.       storage. Client may choose the nearest push server to receive data.
  102.     <para>
  103.       Administration of all components is performed from client after 
  104.       successful "superuser" authorization. All configuration is edited 
  105.       with convenient dialog-based representation.
  106.   </chapter>
  107.   <!--         chapter             -->
  108.   <chapter>
  109.     <title>Snapshot</title>
  110.     <para>
  111.         <graphic fileref="../images/snapshot01.jpeg"></graphic>
  112.     <para>
  113.       Snapshot shows the client application that displays the list of 
  114.       available movies, shows closed-captioned text of two of them and plays a
  115.       movie.
  116.   </chapter>
  117.   <!-- chapter -->
  118.   <chapter>
  119.     <title>Take me to the software</title>
  120.     <sect1>
  121.       <title>Download</title>
  122.       <para>
  123.       Download the package from URL: 
  124.       <ulink url=
  125.         "ftp://sequoia.ecsl.cs.sunysb.edu/pub/distributed_video_server/">
  126.          ftp://sequoia.ecsl.cs.sunysb.edu/pub/distributed_video_server/</ulink>
  127.     </sect1>
  128.     <sect1>
  129.       <title>Install</title>
  130.       <para>
  131.         To build any component, the whole package source code must be unpacked,
  132.         because many headers are shared among components. The best way to build
  133.         NT acquisition server is to export source directory via Samba.
  134.       <para>
  135.         <TABLE FRAME="none">
  136.           <title>System requirements</title>
  137.           <tgroup cols="2" colsep="16" rowsep="4">
  138.           <tbody>
  139.             <row>
  140.               <entry morerows="3"><function>Acquisition server
  141.                 </function></entry>
  142.               <entry>Windows NT</entry>
  143.             </row>
  144.             <row><entry>Visual C++ 5.0 (4.2 is buggy for that)</entry></row>
  145.             <row><entry>"Mpegator" video board SDK</entry></row>
  146.             <row><entry>"Text grabber" to read closed captions - 
  147.               it should be connected to the serial port</entry></row>
  148.             <row>
  149.               <entry morerows="1"><function>Database server</function></entry>
  150.               <entry>Java</entry>
  151.             </row>
  152.             <row><entry>JDBC and any database (I use freeware PostgreSql)
  153.               </entry></row>
  154.             <row>
  155.               <entry morerows="1"><function>Push server</function></entry>
  156.               <entry>Unix</entry>
  157.             </row>
  158.             <row><entry>C++</entry></row>
  159.             <row>
  160.               <entry morerows="4"><function>Client</function></entry>
  161.               <entry>Unix</entry>
  162.             </row>
  163.             <row><entry>C++</entry></row>
  164.             <row><entry>GTK+ GUI toolkit (see release notes for version
  165.               requirements)</entry></row>
  166.             <row><entry>Gtk-- C++ front-end to GTK+</entry></row>
  167.             <row><entry>MpegTV SDK</entry></row>
  168.           </tbody>
  169.           </tgroup>
  170.         </table>
  171.       <para>
  172.       <function>Build</function>
  173.       <para>
  174.         <emphasis>Configure</emphasis> scripts, <emphasis>configure.in,
  175.         Makefile.am</emphasis> files for <emphasis>autoconf/automake</emphasis>
  176.         tool are provided. This should help to auto detect the system.
  177.     </sect1>
  178.     <sect1>
  179.       <title>Release notes</title>
  180.       <para>
  181.       <function>version 0.6.2</function> 12 Mar
  182.         <itemizedlist MARK="bullet" SPACING="compact">
  183.           <listitem><para>
  184.             Snapshot release with numerous bug fixes. Migrated to GTK+ 1.2
  185.             ( i need help with pixmaps in gtk_main.cc ).
  186.         </itemizedlist>
  187.       <para>
  188.       <function>version 0.6.1</function> 1 Mar
  189.         <itemizedlist MARK="bullet" SPACING="compact">
  190.           <listitem><para>
  191.             Snapshot release with numerous bug fixes.
  192.         </itemizedlist>
  193.       <para>
  194.       <function>version 0.6.0</function> 28 Feb
  195.         <itemizedlist MARK="bullet" SPACING="compact">
  196.           <listitem><para>
  197.             After selecting the final design of network topology of the video 
  198.             server everything related to the control flow, data storage and
  199.             obtaining configuration was re-engineered. The database format 
  200.             was changed as well. It seems that now all those issues take
  201.             the shape that will be used for setup the software at my
  202.             department. But this is still very alpha release.
  203.           <listitem><para>
  204.             License clarifications are put into documentation.
  205.         </itemizedlist>
  206.       <para>
  207.       <function>version 0.5.4</function> 14 Feb
  208.         <itemizedlist MARK="bullet" SPACING="compact">
  209.           <listitem><para>
  210.             Finally broadcast is working. But there are some problems with SIH
  211.             plug-in to debug. A lot of bug fixes. All components handshake
  212.             correctly, most connections reconnect after timeout when fail
  213.             happens.
  214.         </itemizedlist>
  215.       <para>
  216.       <function>version 0.5.3</function> 10 Feb
  217.         <itemizedlist MARK="bullet" SPACING="compact">
  218.           <listitem><para>
  219.             The snapshot release to provide a better starting point for 
  220.             occasional examiner. The broadcasting topology, handshake,
  221.             setup, protocols completely reorganized :-) Documentation 
  222.             partially explains that.
  223.         </itemizedlist>
  224.       <para>
  225.       <function>version 0.5.2</function> 20 Jan
  226.         <itemizedlist MARK="bullet" SPACING="compact">
  227.           <listitem><para>
  228.           Mostly a snapshot release to produce better hacker's starting point.
  229.           <listitem><para>
  230.           Still working on broadcast mode: many improvements in acquisition 
  231.           server and push server. Full broadcast mode is expected soon.
  232.         </itemizedlist>
  233.       <para>
  234.       <function>version 0.5.1</function> 18 Jan
  235.         <itemizedlist MARK="bullet" SPACING="compact">
  236.           <listitem><para>
  237.           Documentation updated. Everything compiles. Off-line mode works.
  238.           Broadcast mode not finished yet - but most code is here.
  239.         </itemizedlist>
  240.       <para>
  241.       <function>version 0.5.0</function> 13 Jan
  242.         <itemizedlist MARK="bullet" SPACING="compact">
  243.           <listitem><para>
  244.           That's the alpha-release, do not download.
  245.         </itemizedlist>
  246.     </sect1>
  247.     <sect1>
  248.       <title>Feedback</title>
  249.       <para>
  250.       That project is not very old - I started it at January of '98.
  251.       Please contact me for any build, install and hack assistance.
  252.       <para>
  253.       My e-mail: 
  254.       <ulink url="mailto:andrew@ecsl.cs.sunysb.edu">andrew@ecsl.cs.sunysb.edu
  255.         </ulink>
  256.       <para>
  257.       Don't forget to check the project's main page:
  258.       <ulink url="http://www.ecsl.cs.sunysb.edu/~andrew/VideoServer/videoserver/index/book1.html">http://www.ecsl.cs.sunysb.edu/~andrew/VideoServer/videoserver/index/book1.html</ulink>
  259.     </sect1>
  260.   </chapter>
  261.   <!-- chapter -->
  262.   <chapter>
  263.     <title>Architecture</title>
  264.     <sect1>
  265.       <title>Components</title>
  266.       <para>
  267. Video server consists from several components: master server, slave 
  268. servers and clients.
  269.       <para>
  270. <emphasis>Database server</emphasis> (master server), 
  271. which stores different kind
  272. of information and manage the video data network configuration.
  273. It receives incoming connections from clients and acquisition servers,
  274. answer to informational queries, performs actions requested by
  275. super-user authorized clients and sends commands to slave acquisition
  276. and push servers.
  277.       <para>
  278. <emphasis>Acquisition server </emphasis> is one of two slave servers.
  279. This is NT-based program that captures <emphasis>Mpeg</emphasis>
  280. data using the <emphasis>Mpegator</emphasis> board and reads
  281. closed captions with <emphasis>Text grabber</emphasis> device.
  282.         This server does not store any data locally, instead, it transmit the
  283.         mpeg video stream to several push servers and closed captioned 
  284.         text stream to both database server as well as push servers.
  285.    Video (mpeg) data are stored by push servers at local discs 
  286. and all text data is stored at database server.
  287.       <para>
  288. <emphasis>Push server </emphasis> is the second slave server.
  289.         It performs two types of activities at the same time. Firstly, it
  290.         receive live broadcasting video/text stream, store it on local storage 
  291.         for later playback and push that data to various broadcast destinations
  292.         as specified. Secondly, it pumps locally stored mpeg data to
  293. the specific client by request.
  294.         Same data may be, but not necessary, duplicated in
  295. various locations to optimize the access speed. Push server may
  296. transmit live broadcast data as well as the stored data at the same
  297. time. Various clients may request different movies from the same
  298. push server.
  299.       <para>
  300. <emphasis>Client </emphasis> is the Linux/Unix application, which
  301. uses a convenient user interface to show data and perform actions.
  302. Mpeg video is displayed by MpegTV library, which is available for
  303. all major Unix platforms. User interface is written with GTK+ 
  304. toolkit and the Gtk-- front-end for it.
  305. Windows client is not planned due the lack 
  306. of requests from end-users.
  307.     </sect1>
  308.     <sect1>
  309.       <title>Services provided by the Client to the end user</title>
  310.       <sect2>
  311. <title>Broadcast service</title>
  312. <para>
  313.           
  314.       </sect2>
  315.       <sect2>
  316. <title>Playback service</title>
  317. <para>
  318.           
  319.       </sect2>
  320.       
  321.     </sect1>
  322.     <sect1>
  323.     <title>The network topology, data flow and protocols</title>
  324.       <sect2>
  325. <title>The network topology for the broadcast service</title>
  326. <para>
  327.           The broadcast service provides the availability of live data to
  328.           several destinations. Usually, each destination should be the 
  329.           specific LAN broadcast address. The description of the video content
  330.           and the port number to view the broadcast together are named as 
  331.           <emphasis>channel</emphasis>.
  332.           Each client located on this 
  333.           particular local network may display the video and closed captioned
  334.           text on the screen. But each client is free to switch to another
  335.           channel or playback the old video selected from the database.
  336.           The client may play only single video at the time.
  337. <para>
  338.         <function>The problem: consuming network resources.</function>
  339.           Transmitting the live video data over the network means sending
  340.           approximately 100 UDP packets per second to this LAN broadcast 
  341.           address with typical data rate 150 K/s. That consume resources of
  342.           network and routers. This immediately imply that the Video Server
  343.           must provide the mechanism to transmit data only to those 
  344.           destinations where it finds at least one interested client.
  345.           
  346. <para>
  347.         <function>Dynamic vs. static topology.</function> The dynamic topology
  348.           means that the explicit command from the user interested to
  349.           view the channel selected from the list activates the selection
  350.           of push server which may or already is the transmitter for this 
  351.           channel. The activation of the previously inactive transmitting push
  352.           server means that the topology have been changed. 
  353.           In fact, acquisition 
  354.           server must add another push server to the list of data recipients, 
  355.           database server which manage all the topology must add this LAN as
  356.           active recipient of the channel.
  357.         <para>
  358.         <function>Design decision.</function> As opposite to the dynamic 
  359.           topology the static one was selected as the design decision. Let
  360.           describe it and let show that this simplification does not decrease
  361.           the set-up and use flexibility.
  362.         <para>
  363.         <function>The static topology.</function> 
  364.           Database server loads the network topology from properties as the 
  365.           static graph. The initial source of broadcast video stream is the 
  366.           acquisition server. That data availability should appear to the 
  367.           final destination, client, as the description and the port number
  368.           to listen for UDP data packets: we define this as the 
  369.           <emphasis>channel</emphasis>.
  370.           Thus, the particular acquisition server is the only one source of
  371.           the particular channel. At the same time, the particular channel 
  372.           is coming only from this acquisition server and have no way to
  373.           be sourced from anything else. This does not restrict that 
  374.           different acquisition servers may receive the same TV program - 
  375.           at that case two absolutely different channels may have the same 
  376.           description and the same content while been defined as different
  377.           channels and have no way to appear to the client 
  378.           on the same UDP port. Thus, the unique <emphasis> channel ID
  379.           </emphasis> is assigned to each 
  380.           channel and may appear in any program logic to specify it.
  381.           The acquisition server does not knows the final destinations of 
  382.           the broadcasting and never loads this information. Instead, at the 
  383.           boot time it receives from the database server the list of 
  384.           push servers that will (may) work as transmitters and will (may)
  385.           store the data locally. 
  386.         <para>
  387.           The push server should be located on the computer that have 
  388.           a convenient access to all local networks where it should 
  389.           broadcast. In case if the broadcast destination is the multicast 
  390.           address this computer should support multicasting.
  391.           The push server may have only one connection with acquisition
  392.           server to receive data, but it may have several broadcast
  393.           destinations. This does not restrict the flexibility to have
  394.           multiple channels to be broadcasted by this computer because 
  395.           several push servers may coexist at the the same computer.
  396.           The database server loads from properties the list of all push
  397.           servers with the channel ID assigned to the each one. For
  398.           each push server it loads also the list of all broadcast 
  399.           destinations. So given the client network address we may get
  400.           the unique list of all channels that are (or may be) broadcasted
  401.           to this user. In current implementation the simple algorithm is
  402.           used and it will not work properly with multicast addresses.
  403.         <para>
  404.           The static topology should not imply that all data are broadcasted
  405.           permanently in all possible destinations. This problem is resolved
  406.           requiring clients to acknowledge the interest of the channel to
  407.           transmitter, i.e. the push server. If given some fixed timeout
  408.           the push server had not received any acknowledge of interest from
  409.           the specific destination, this channel should be suspended. 
  410.           We should not confuse the <emphasis>suspended transmission
  411.           </emphasis> of channel with <emphasis>inactive channel</emphasis>.
  412.           While the channel is suspended the network topology is not affected.
  413.           The database server that controls the graph of the network is 
  414.           not interested about the details of transmit-ion. From the other side
  415.           the client distinguish only active and inactive channels, but
  416.           don't know if the transmission is suspended. When the client 
  417.           wants to receive the channel, it starts the periodical posting of
  418.           packets of interest to the push server. Its the push server business
  419.           to change the status of transmission to not suspended.
  420.         <para>
  421.           What is active and inactive channel? The static network topology
  422.           does not imply that all components are required to operate, been
  423.           located in permanently accessible networks on computers that never 
  424.           crash or reboot. Instead, we define the status of the channel 
  425.           relatively to the particular destination. The status may be active
  426.           or inactive. If the acquisition server does not operates or is 
  427.           unreachable, its channel ID may not be used by another source, so
  428.           this channel is defined to be inactive relatively to all 
  429.           destinations. If the particular local network is not listed as the 
  430.           destination in any push server destinations list, this channel is 
  431.           not listed by request of any client from that network and its
  432.           status is undefined. If the acquisition server successfully 
  433.           transmit data to some push servers while some others are not
  434.           operating, the status of this channel will be different relatively 
  435.           different clients. If several push servers may transmit the same 
  436.           channel to the same destination, this is not the error, but that 
  437.           means that user may not distinguish which push server it wants 
  438.           to listen because by definition this channel have only one ID.
  439.           So one of push servers will be selected. If one push server is 
  440.           operating while another does not work by some reason, the program
  441.           must ensure that only the operating one is selected. 
  442.       </sect2>
  443.       <sect2>
  444. <title>Start-up order of components</title>
  445. <para>
  446.   All components in Video server talk to each other by various 
  447.           protocols using TCP and UDP sockets. The destination for any
  448.           particular service may be unavailable at the present time. 
  449.           But all connections in the system are subject to reconnect after
  450.           the timeout. At the same time, if the service accept connections 
  451.           and this particular connection is lost by any reason, the service
  452.           is returned back into waiting state.
  453. <para>
  454.           <emphasis>
  455.           So the start-up order of components in fact is not important to 
  456.           get the system functional. </emphasis>
  457.           But this topic describes the order in with connections are 
  458.           established - the way to eliminate all reconnects.
  459. <para>
  460.   First, start-up all <emphasis>push server</emphasis>. When started,
  461.   push server quietly waits for incoming commands.
  462. <para>
  463.   The real squid of program is the <emphasis>database server
  464.           </emphasis>,
  465.   which holds all the metadata, system setup and manage the data flow 
  466.   of all the system. <emphasis>database server</emphasis> should 
  467.   start-up the second. Then, <emphasis>acquisition server</emphasis>
  468.   starts and try to setup the connection to database server. On
  469.   success, it receives the address and the port number of 
  470.           <emphasis>push 
  471.   server</emphasis>, which will be responsible to broadcast data among
  472.   specified networks. If the connection fails, acquisition server will 
  473.   repeat the connection after the timeout.
  474. <para>
  475.   When database server starts, it should post the command to 
  476.   <emphasis>push server</emphasis> to configure the list of networks 
  477.   and the port number to broadcast.
  478. <para>
  479.   If no <emphasis>acquisition servers</emphasis> are registered,
  480.   the <emphasis>database server</emphasis> will assume that we
  481.   work in off-line mode and broadcast is not available. When the first
  482.   acquisition server registers itself, the live broadcasting is
  483.   available to any client.
  484. <para>
  485.   When on-line mode is (re)established, <emphasis>Database server
  486.   </emphasis> posts to <emphasis>Acquisition server</emphasis> 
  487.   (with protocol 5 - look next section) the 
  488.   address of push server to which it must post all data (protocol 6). 
  489.   If <emphasis>acquisition server</emphasis> cannot connect to it, 
  490.   it must post the error notification back and drop the connection.
  491.       </sect2>
  492.       <sect2>
  493. <title>Data stream</title>
  494. <para>
  495.   Picture: all protocols and default port numbers
  496.   <graphic fileref="../images/data_stream"></graphic>
  497. <para>
  498.   <function>1. Acquisition server - database server TCP protocol. 
  499.     </function>
  500.   Initiated by the acquisition server. It registers itself, request
  501.   address for immediate broadcasting and periodically checks for 
  502.   new commands.
  503. <para>
  504.   <function>2. Client - database server TCP protocol. </function>
  505.   Initiated
  506.   by the client. First, lets the client to acquire all 
  507.           sort of data from
  508.   Database server. Second, if client passed the authorization and 
  509.           is operated in superuser mode, lets it
  510.   to configure all servers and
  511.   lets the client to post some commands to a acquisition server.
  512. <para>
  513.   <function>3. Acquisition server to push( broadcast ) server TCP
  514.   protocol.</function> It uses the same data format as 
  515.           broadcast protocol
  516.   #x, except it is TCP and there are only one destination.
  517. <para>
  518.   <function>4. Push server UDP control protocol. </function>
  519.   All other components use this UDP connection to post 
  520.   commands to push server.
  521. <para>
  522.   <function>5. Individually requested UDP data stream. </function>
  523. <para>
  524.   <function>6. Permanently broadcasted UDP data stream. </function>
  525.       </para>
  526.       </sect2>
  527.     </sect1>
  528.   </chapter>
  529.   <!-- chapter -->
  530.   <chapter>
  531.     <title>Links to software components documentation</title>
  532.     <para>
  533.       <ulink url="../videoserver/Package-edu.sunysb.cs.ecsl.videoserver.html">
  534.       Database Video server </ulink>
  535.     <para>
  536.       <ulink url="../videoclient/index.html">
  537.       Video client </ulink>
  538.     <para>
  539.       <ulink url="../pusher/index.html">
  540.       Push server </ulink>
  541.     <para>
  542.       <ulink url="../acquisition/index.html">
  543.       Acquisition server </ulink>
  544.       
  545.   </chapter>
  546.   
  547. </book>