title: Chopping media stream in HTML5 websocket server for webbased chat/video conference application
body: <p>We are currently working on a chat + (file sharing +) video conference application <a href="https://stackoverflow.com/questions/4220672/implementing-webbased-real-time-video-chat-using-html5-websockets">using HTML5 websockets</a>. To make our application more accessible we want to implement Adaptive Streaming, using the following sequence:</p>
  
  <ol>
  <li>Raw audio/video data client goes to server</li>
  <li>Stream is split into 1 second chunks</li>
  <li>Encode stream into varying bandwidths</li>
  <li>Client receives manifest file describing available segments</li>
  <li>Downloads one segment using normal HTTP</li>
  <li>Bandwidth next segment chosen on performance of previous one</li>
  <li>Client may select from a number of different alternate streams at a variety of data rates</li>
  </ol>
  
  <p>So.. How do we split our audio/video data in chunks with Python?</p>
  
  <p>We know Microsoft already build the <a href="http://msdn.microsoft.com/en-us/library/ee341601.aspx" rel="noreferrer">Expression Encoder 2</a> which enables Adaptive Streaming, but it only supports Silverlight and that's not what we want.</p>
  
  <p>Edit:<br>
  There's also an solution called FFmpeg (and for Python a PyFFmpeg wrapper), but it only supports Apple Adaptive streaming.</p>