29

We are currently working on a chat + (file sharing +) video conference application using HTML5 websockets. To make our application more accessible we want to implement Adaptive Streaming, using the following sequence:

  1. Raw audio/video data client goes to server
  2. Stream is split into 1 second chunks
  3. Encode stream into varying bandwidths
  4. Client receives manifest file describing available segments
  5. Downloads one segment using normal HTTP
  6. Bandwidth next segment chosen on performance of previous one
  7. Client may select from a number of different alternate streams at a variety of data rates

So.. How do we split our audio/video data in chunks with Python?

We know Microsoft already build the Expression Encoder 2 which enables Adaptive Streaming, but it only supports Silverlight and that's not what we want.

Edit:
There's also an solution called FFmpeg (and for Python a PyFFmpeg wrapper), but it only supports Apple Adaptive streaming.

Community
  • 1
  • 1
Wouter Dorgelo
  • 11,770
  • 11
  • 62
  • 80
  • Hey Enrico (Leslie Nielsen?) what ever came of this project? I have found myself hitting the same wall, just much after you ;) Please keep me posted with any further details you have. Thank you! – Mussser Sep 02 '14 at 04:56

2 Answers2

5

I think ffmpeg is the main tool you'll want to look at. It's become most well supported open source media manipulator. There is a python wrapper for it. Though it is also possible to access the command line through the subprocess module.

Community
  • 1
  • 1
mjhm
  • 16,497
  • 10
  • 44
  • 55
2

I've found some nice articles about how other people build a stream segmenter for other platforms, so now we know how to build one in Python.

Wouter Dorgelo
  • 11,770
  • 11
  • 62
  • 80
  • 1
    it been decade :) can u put some sauce on it how to do it , i was wondering if there is way to get video stream to server through websocket from html5 media api . currently am taking base64 image data from canva and send it to server and from where its send to viewer its done quickly creating video effect but its base64 image s – user889030 Jul 17 '20 at 11:26