stream

How to read Youtube live stream using openCV python?

How to read Youtube live stream using openCV python? Question: I want to read a live stream from youtube to perform some basic CV things, probably we have to somehow strip of the youtube URL to convert it in a format that might be readable by openCV like?: cap = cv2.VideoCapture(‘https://www.youtube.com/watch?v=_9OBhtLA9Ig’) has anyone done it? …

Total answers: 4

Difference between `open` and `io.BytesIO` in binary streams

Difference between `open` and `io.BytesIO` in binary streams Question: I’m learning about working with streams in Python and I noticed that the IO docs say the following: The easiest way to create a binary stream is with open() with ‘b’ in the mode string: f = open("myfile.jpg", "rb") In-memory binary streams are also available as …

Total answers: 2

Python3.4 read content stream web request

Python3.4 read content stream web request Question: How, in Python3.4, can I read the data from a web request which has an event-stream as content type? The stream data is updated every 30 seconds and for each of them I would extract and process data. Example: I performed a request on http://example.com/value121 In the headers, …

Total answers: 2

How to play videos from the web like youtube in kivy

How to play videos from the web like youtube in kivy Question: I really want to create a kivy app that lets me view videos from certain web links. How can I go about doing this, Like having a link to a video then play it in Kivy? I already read the documentation and I …

Total answers: 2

Consuming a kinesis stream in python

Consuming a kinesis stream in python Question: I cant seem to find a decent example that shows how can I consume an AWS Kinesis stream via Python. Can someone please provide me with some examples I could look into? Best Asked By: aliirz || Source Answers: you should use boto.kinesis: from boto import kinesis After …

Total answers: 2

Download large file in python with requests

Download large file in python with requests Question: Requests is a really nice library. I’d like to use it for downloading big files (>1GB). The problem is it’s not possible to keep whole file in memory; I need to read it in chunks. And this is a problem with the following code: import requests def …

Total answers: 8

Can you "stream" images to ffmpeg to construct a video, instead of saving them to disk?

Can you "stream" images to ffmpeg to construct a video, instead of saving them to disk? Question: My work recently involves programmatically making videos. In python, the typical workflow looks something like this: import subprocess, Image, ImageDraw for i in range(frames_per_second * video_duration_seconds): img = createFrame(i) img.save(“%07d.png” % i) subprocess.call([“ffmpeg”,”-y”,”-r”,str(frames_per_second),”-i”, “%07d.png”,”-vcodec”,”mpeg4″, “-qscale”,”5″, “-r”, str(frames_per_second), “video.avi”]) …

Total answers: 3

Read a large zipped text file line by line in python

Read a large zipped text file line by line in python Question: I am trying to use zipfile module to read a file in an archive. the uncompressed file is ~3GB and the compressed file is 200MB. I don’t want them in memory as I process the compressed file line by line. So far I …

Total answers: 2

Python regex parse stream

Python regex parse stream Question: Is there any way to use regex match on a stream in python? like reg = re.compile(r’w+’) reg.match(StringIO.StringIO(‘aa aaa aa’)) And I don’t want to do this by getting the value of the whole string. I want to know if there’s any way to match regex on a srtream(on-the-fly). Asked …

Total answers: 5