Streaming large file uploads to ASP.NET MVC

It turns out that my initial code was basically correct; the only change required was to change request.ContentLength = clientRequest.InputStream.Length; to request.ContentLength = clientRequest.ContentLength; The former streams in the entire request to determine the content length; the latter merely checks the Content-Length header, which only requires that the headers have been sent in full. This … Read more

Decode JSON as it is still streaming in via net/http

Decoding a JSON stream is possible with the json.Decoder. With Decoder.Decode(), we may read (unmarshal) a single value without consuming and unmarshaling the complete stream. This is cool, but your input is a “single” JSON object, not a series of JSON objects, which means a call to Decoder.Decode() would attempt to unmarshal the complete JSON … Read more

Live Video Streaming with PHP

I am not saying that you have to abandon PHP, but you need different technologies here. Let’s start off simple (without Akamai :-)) and think about the implications here. Video, chat, etc. – it’s all client-side in the beginning. The user has a webcam, you want to grab the signal somehow and send it to … Read more

Chrome hangs after certain amount of data transfered – waiting for available socket

Explanation: This problem occurs because Chrome allows up to 6 open connections by default. So if you’re streaming multiple media files simultaneously from 6 <video> or <audio> tags, the 7th connection (for example, an image) will just hang, until one of the sockets opens up. Usually, an open connection will close after 5 minutes of … Read more

C++ OpenCV image sending through socket

Get Mat.data and directly send to the socket, the data order is BGR BGR BGR…. On the receiving side assumes you know the size of image. After receiving just assign the received buffer(BGR BGR… array) to a Mat. Client:- Mat frame; frame = (frame.reshape(0,1)); // to make it continuous int imgSize = frame.total()*frame.elemSize(); // Send … Read more

MediaPlayer error (1, -1004) aka MEDIA_ERROR_IO trying to stream music on Samsung S3

The answer to this question turned out to be an issue on Android firmware installed on Samsung S III devices running Android 4.1.2. It seemed to have been something relating to the source of the stream, because some sources eventually played on the device, but the one we needed, never played. If you can get … Read more