streaming

fails when using hadoop streaming with python combiner

雨燕双飞 提交于 2019-12-23 19:37:33
问题 I try to use hadoop streaming by python to compute average values of of input keys. Here are the codes of mapper, combiner and reducer: #mapper: import sys def map(argv): line = sys.stdin.readline() try: while line: word, num = line.split() num = int(num) print word+'\t'+str(num) line = sys.stdin.readline() except Exception, ex: print 'mapper ex:'+str(ex) return None if __name__ == "__main__": map(sys.argv) #combiner import sys def combine(argv): line = sys.stdin.readline() cur_word = '' cur

Streaming video (C# using FFmpeg AutoGen) sends multiple data requests

六眼飞鱼酱① 提交于 2019-12-23 18:53:27
问题 I've written a video generator that rights a video in h264 format (mp4). When I stream the video from my azure service, i'm seeing the following network traffic: The AVCodecContext layout I'm using is as follows: AVCodec* videoCodec = ffmpeg.avcodec_find_encoder(AVCodecID.AV_CODEC_ID_H264) AVCodecContext* videoCodecContext = ffmpeg.avcodec_alloc_context3(videoCodec); videoCodecContext->bit_rate = 400000; videoCodecContext->width = 1280; videoCodecContext->height = 720; videoCodecContext->gop

Why does the iPhone request an .m3u8 playlist file 4 times?

≡放荡痞女 提交于 2019-12-23 15:28:13
问题 Why does the iPhone request an .m3u8 playlist file 4 times? And, is it possible to get it to request it only once? The requests are performed as follows: The first one is a full request. The second one is a byte range request with a range of 0-1. The third is another byte range request for the complete file. The final request is again a complete request. Note: that the iPhone kills the connection on these requests so not all of them complete to the end. However, there is a lot of unnecessary

Error in starting Spark streaming context

空扰寡人 提交于 2019-12-23 12:42:13
问题 I am new to Spark Streaming and writing a code for twitter connector. when i run this code more than one time, it gives the following exception. I have to create a new hdfs directory for checkpointing each time to make it run successfully and moreover it doesn't get stopped. ERROR StreamingContext: Error starting the context, marking it as stopped org.apache.spark.SparkException: org.apache.spark.streaming.dstream.WindowedDStream@532d0784 has not been initialized at org.apache.spark.streaming

Streaming output with commons-exec?

谁都会走 提交于 2019-12-23 12:26:05
问题 Can anyone give me an example of how to stream the output of an external program executed with DefaultExecutor ? I'm not finding any documentation describing how to do this. My external process will run for several hours, so just grabbing all output data isn't feasible; it must be streamed. 回答1: Note: this solution is synchronous, so it won't stream. You'll need to read is in a separate thread, or use the asynchronous version of the execute command. private InputStream getStream() { String

How to view an RTSP stream using HTML5 or JavaScript, without using plugins like VLC plugin on Real Player plugin?

こ雲淡風輕ζ 提交于 2019-12-23 10:44:31
问题 The idea is to develop a cross-platform, standalone application that could play a video, streamed over RTSP, using HTML5 or JavaScript or any other web technology. 回答1: RTSP is a protocol on the same level as HTTP. Its impossible to do RTSP via HTTP. The HTML5 video tag could support RTSP but no browser implements it. It may be possible to create an RTSP proxy using websockets but that wouldn't be true rtsp any more. And it would mean, all the demuxing and protocol stuff had to be implemented

How to view an RTSP stream using HTML5 or JavaScript, without using plugins like VLC plugin on Real Player plugin?

南笙酒味 提交于 2019-12-23 10:44:10
问题 The idea is to develop a cross-platform, standalone application that could play a video, streamed over RTSP, using HTML5 or JavaScript or any other web technology. 回答1: RTSP is a protocol on the same level as HTTP. Its impossible to do RTSP via HTTP. The HTML5 video tag could support RTSP but no browser implements it. It may be possible to create an RTSP proxy using websockets but that wouldn't be true rtsp any more. And it would mean, all the demuxing and protocol stuff had to be implemented

Ideal Chunk Size for Writing Streamed Content to Disk on iPhone

纵然是瞬间 提交于 2019-12-23 10:11:54
问题 I am writing an app that caches streaming content from the web on the iPhone. Right now, I'm saving data to disk as it arrives (in chunk sizes ranging from 1KB to about 60KB), but application response is somewhat sluggish (better than I was expecting, but still pretty bad). My question is: does anyone have a rule of thumb for how frequent and large writes to the device memory should be to maximize performance? I realize this seems application-specific, and I intend to do performance tuning

Spark streaming is not working in Standalone cluster deployed in VM

南笙酒味 提交于 2019-12-23 09:25:47
问题 I have written Kafka stream program using Scala and executing in Spark standalone cluster. Code works fine in my local. I have done Kafka , Cassandra and Spark setup in Azure VM. I have opened all inbound and outbound ports to avoid port blocking. started Master sbin>./start-master.sh Started Slave sbin# ./start-slave.sh spark://vm-hostname:7077 I have verified this status in Master WEB UI. Submit Job bin#./spark-submit --class x.y.StreamJob --master spark://vm-hostname:7077 /home/user/appl

Sinatra 1.3 Streaming w/ Ruby stdout redirection

蹲街弑〆低调 提交于 2019-12-23 06:04:20
问题 I would like to use Sinatra's Streaming capability introduced in 1.3 coupled with some stdout redirection. It would basically be a live streaming output of a long running job. I looked into this question and the Sinatra streaming sample in the README. Running 1.8.7 on OSX: require 'stringio' require 'sinatra' $stdout.sync = true module Kernel def capture_stdout out = StringIO.new $stdout = out yield out ensure $stdout = STDOUT end end get '/' do stream do |out| out << "Part one of a three