video_console.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. --- VIDEO CONSOLE SUPPORT IN ASTERISK ---
  2. Some console drivers (at the moment chan_oss.so) can be built with
  3. support for sending and receiving video. In order to have this
  4. working you need to perform the following steps:
  5. +++ Enable building the video_console support +++
  6. The simplest way to do it is add this one line to channels/Makefile:
  7. chan_oss.so: _ASTCFLAGS+=-DHAVE_VIDEO_CONSOLE
  8. +++ Install prerequisite packages +++
  9. The video_console support relies on the presence of SDL, SDL_image
  10. and ffmpeg libraries, and of course on the availability of X11
  11. On Linux, these are supplied by
  12. libncurses-dev,
  13. libsdl1.2-dev, libsdl-image1.2-dev
  14. libavcodec-dev, libswcale-dev
  15. On FreeBSD, you need the following ports:
  16. multimedia/ffmpeg (2007.10.04)
  17. devel/sdl12 graphics/sdl_image
  18. +++ Build and install asterisk with all the above +++
  19. Make sure you do a 'make clean' and run configure again after you
  20. have installed the required packages, to make sure that the required
  21. pieces are found.
  22. Check that chan_oss.so is generated and correctly installed.
  23. +++ Update configuration files +++
  24. Video support requires explicit configuration as described below:
  25. == oss.conf ==
  26. You need to set various parameters for video console, the easiest
  27. way is to uncomment the following line in oss.conf by removing the
  28. leading ';'
  29. ;[general](+,my_video,skin2)
  30. You also need to manually copy the two files
  31. images/kpad2.jpg images/font.png
  32. into the places specified in oss.conf, which in the sample are set to
  33. keypad = /tmp/kpad2.jpg
  34. keypad_font = /tmp/font.png
  35. other configuration parameters are described in oss.conf.sample
  36. == sip.conf ==
  37. To actually run a call using SIP (the same probably applies to iax.conf)
  38. you need to enable video support as following
  39. [general](+)
  40. videosupport=yes
  41. allow=h263 ; this or other video formats
  42. allow=h263p ; this or other video formats
  43. you can add other video formats e.g. h261, h264, mpeg if they are
  44. supported by your version of libavcodec.
  45. +++ RUN THE PROGRAM +++
  46. run asterisk in console mode e.g. asterisk -vdc
  47. If video console support has been successfully compiled in, then
  48. you will see the "console startgui" command available on the CLI`
  49. interface. Run the command, and you should see a window like this:
  50. http://info.iet.unipi.it/~luigi/asterisk_video_console.jpg
  51. To exit from this window, in the console run "console stopgui".
  52. If you want to start a video call, you need to configure your dialplan
  53. so that you can reach (or be reachable) by a peer who can support video.
  54. Once done, a video call is the same as an ordinary call:
  55. "console dial ...", "console answer", "console hangup" all work the same.
  56. To use the GUI, and also configure video sources, see the next section.
  57. +++ VIDEO SOURCES +++
  58. Video sources are declared with the "videodevice=..." lines in oss.conf
  59. where the ... is the name of a device (e.g. /dev/video0 ...) or a
  60. string starting with X11 which identifies one instance of an X11 grabber.
  61. You can have up to 9 sources, displayed in thumbnails in the gui, and
  62. select which one to transmit, possibly using Picture-in-Picture.
  63. For webcams, the only control you have is the image size and frame
  64. rate (which at the moment is the same for all video sources).
  65. X11 grabbers capture a region of the X11 screen (it can contain
  66. anything, even a live video) and use it as the source.
  67. The position of the grab region can be configured using the GUI below
  68. independently for each video source.
  69. The actual video sent to the remote side is the device selected as
  70. "primary" (with the mouse, see below), possibly with a small
  71. 'Picture-in-Picture' of the "secondary" device (all selectable
  72. with the mouse).
  73. +++ GUI COMMANDS AND VIDEO SOURCES +++
  74. (most of the text below is taken from channels/console_gui.c)
  75. The GUI is made of 4 areas: remote video on the left, local video
  76. on the right, keypad with all controls and text windows in the
  77. center, and source device thumbnails on the top. The top row is
  78. not displayed if no devices are specified in the config file.
  79. ________________________________________________________________
  80. | ______ ______ ______ ______ ______ ______ ______ |
  81. | | tn.1 | | tn.2 | | tn.3 | | tn.4 | | tn.5 | | tn.6 | | tn.7 | |
  82. | |______| |______| |______| |______| |______| |______| |______| |
  83. | ______ ______ ______ ______ ______ ______ ______ |
  84. | |______| |______| |______| |______| |______| |______| |______| |
  85. | _________________ __________________ _________________ |
  86. | | | | | | | |
  87. | | | | | | | |
  88. | | | | | | | |
  89. | | remote video | | | | local video | |
  90. | | | | | | ______ | |
  91. | | | | keypad | | | PIP || |
  92. | | | | | | |______|| |
  93. | |_________________| | | |_________________| |
  94. | | | |
  95. | | | |
  96. | |__________________| |
  97. |________________________________________________________________|
  98. The central section is built using an image (jpg, png, maybe gif too)
  99. for the skin and other GUI elements. Comments embedded in the image
  100. indicate to what function each area is mapped to.
  101. Another image (png with transparency) is used for the font.
  102. Mouse and keyboard events are detected on the whole surface, and
  103. handled differently according to their location:
  104. - center/right click on the local/remote window are used to resize
  105. the corresponding window;
  106. - clicks on the thumbnail start/stop sources and select them as
  107. primary or secondary video sources;
  108. - drag on the local video window are used to move the captured
  109. area (in the case of X11 grabber) or the picture-in-picture position;
  110. - keystrokes on the keypad are mapped to the corresponding key;
  111. keystrokes are used as keypad functions, or as text input
  112. if we are in text-input mode.
  113. - drag on some keypad areas (sliders etc.) are mapped to the
  114. corresponding functions (mute/unmute audio and video,
  115. enable/disable Picture-in-Picture, freeze the incoming video,
  116. dial numbers, pick up or hang up a call, ...)
  117. ------------------------------------------------------------------------
  118. --- $Id $---