Project

General

Profile

DesignVideo » History » Revision 9

Revision 8 (Saúl Ibarra Corretgé, 09/03/2009 11:34 PM) → Revision 9/18 (Saúl Ibarra Corretgé, 09/04/2009 03:41 PM)

[[TOC(Design*, depth=1)]] 

 = Video blueprint = 

 Design and implement Ticket [ticket:18] 

 == Goals == 

 Te goal is to implement videostream.py, an H.264 video handler for encoding/decoding video frames comming to/from the media layer. It must compy with the IMediaStream interface, the same way audiostream does. 


 == Roadmap == 

 In order to achive the goal, the following subtasks need to be done: 
   * Implement a wrapper class around the VLC Python bindings. http://wiki.videolan.org/Python_bindings 
   * Create videostream.py implementing IMediaStream interface. 
     * Use the VLC wrapper class to encode/decode the stream. 
   * Bundle the VLC Python wrapper together with SIPSIMPLE so that it get's compiled and installed when installing SIPSIMPLE. 
   * Create sip_video_session.py script (or modify sip_audio_session_script) so that it uses video capabilities. 


 At the time of mangling the SDPs, two approaches can be taken in order to add video support: 
   * Modify PJSIP's PJMEDIA component to encode/decode video streams and handle them the same as audio streams from the upper layers. 
   * Just use PJMEDIA to do the SDP negotiation and audio part. Video would be external to the PJMEDIA layer. 

 For this case the second approach seems to be a better one. When receiving an incoming call or making a call, the SDPs will be mangled so that they include H.264 stream information i.e. 
 {{{ 
 ... 
 m=video 6001 RTP/AVP 98 
 a=rtpmap:98 H264/90000 
 ... 
 }}} 

 So in the case of an incoming call, an VLC player instance will be opened for playing the stream at the IP and port specified by the SDP. For an outgoing call, an VLC will stream H.264 video taken from a selected video source (webcam, still picture, ...) from the sipsimpleclient listen IP and will randomly select a port (in a given range) which doesn't interfere with the audio ports. 

 This way audio and video components are sepparate, but it's not necesary to modify the underlying media handling component: pjmedia. 


 == Components == 

 [[Image(videostream-components.png)]] 


 == Classes ==  

 [[Image(videostream-classes.png)]] 


 == Code mockup ==  

 There are 3 files attached containing a simple code mockup: 
   * videostream.py: Class representing the actual video stream. Contains necessary functions to initialize/stop the stream using VLC as the engine. 
   * vlcw.py: Wrapper class around the VLC python bindings. Provide some higher level functions to be used by the VideoStream class. 
   * sip_video_session.py: Script to test videostream from a console interface. ToDo