[Tutor] Reading video streams from Internet
Steven D'Aprano
steve at pearwood.info
Sat Apr 23 02:33:58 CEST 2011
Ryan J wrote:
> Hello Python gurus!
> I am trying to
> 1) Read and decode video streams from internet.
> 2) Store them in a buffer.
> 3) Eventually convert them into data that can be used in Cycling '74's
> Jitter.
>
> If anyone has any idea how to start with this, that would be great! I have
> limited experience with Python, but I have a bit of exposure to the urllib
> and urllib2.
Do you have a URL for the video stream? Is it a http or https URL that
points directly to a .mov or other video file? Then you just use urllib
and/or urllib2 to connect to that URL and read data. You can write that
data into either memory or directly to a file on disk.
I have no idea what Cycling '74's Jitter is, or what formats it expects.
I suggest you use existing tools like mencoder to convert the video into
whatever format is appropriate. Re-writing a video converter tool in
Python will be a huge job, and it likely too slow to be usable.
If the URL is a secret, proprietary protocol like MMS or RTSP, you will
need to find some library to handle the protocol, or possibly reverse
engineer it yourself. Good luck with that.
--
Steven
More information about the Tutor
mailing list