w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
FFMpeg - Merge multiple rtmp stream inputs to a single rtmp output
Copy video stream and merge two mono steams Try the amerge audio filter: ffmpeg -i rtmp://ip:1935/live/micMyStream7 -i rtmp://ip:1935/live/MyStream7 -codec:v copy -filter_complex "[0:a][1:a]amerge" -codec:a aac -strict -2 -f flv rtmp://ip:1935/live/bcove7 ...or simply use -ac 2: ffmpeg -i rtmp://ip:1935/live/micMyStream7 -i rtmp://ip:1935/live/MyStream7 -codec:v copy -ac 2 -codec:a aac -strict -2 -f flv rtmp://ip:1935/live/bcove7 I added -codec:v copy to stream copy the video instead of re-encoding it. I am unable to try the commands right now, so they are untested, and I will probably not be able to reply until Monday.

Categories : Java

How to get the RTMP & stream name from this URL?
Your above stream link is http://fw01.livem3u8.me.totiptv.com/live//7f2989e3f87e4efdb36bac56b64dca62.m3u8?bitrate=800 That is working fine right now in VLC player. But for me it was total hit and trail. What i did for this is I'm going to explain. Download URL Helper from www.urlhelper.com/download.htm (trail version will work fine) Install it and run it. Click Options >> Select and select your network adapter. Click OK. Then click Start at toolbar (It starts watching your network traffic). Run the page where stream is. In a moment URL helper will start showing you some URLs. On the bottom click "All" See here http://s22.postimg.org/9w61m07y9/Untitled.png Copy the URL that is NOT shown as mp3. If you are running only one stream there will be only one address shown multiple times. Copy t

Categories : Javascript

HTML to check if RTMP stream is live
I doubt there's a way of doing this just using HTML. You can use rtmpdump if you want to get a little technical: http://blog.svnlabs.com/how-to-check-rtmp-source-stream-is-live-or-not/ http://www.youtube.com/watch?v=EN-UYi0UVGE

Categories : Misc

RTMP and JW player (offline stream picture)
One thing you can do is use the JW Player's JavaScript API - http://www.longtailvideo.com/support/jw-player/28851/javascript-api-reference You can use the onError() event. You can pretty much put any arbitrary JavaScript you want in there, so one thing you can do, is replace the player with a picture when onError() is fired.

Categories : Nginx

Sevenzip extractFile(String file, Stream stream) method stream parameter. c#
Setup a FileStream that SevenZip can write out to: DirectoryInfo directoryInfo = new DirectoryInfo(ApplicationPath); FileInfo[] zipFile = directoryInfo.GetFiles("*.7z"); using (SevenZip.SevenZipExtractor zipExtractor = new SevenZip.SevenZipExtractor(zipFile[0].FullName)) { using (FileStream fs = new FileStream("", FileMode.Create)) //replace empty string with desired destination { zipExtractor.ExtractFile("ConfigurationStore.xml", fs); } }

Categories : C#

CsvParser Stream Closed Error
The CsvParser is lazy, so reads rows as they are requested (rather than loading them all into memory. The withReader call closes the Reader once the Closure is finished. So when you try to do csvFile.each, the stream is closed. This should work: new File("file.csv").withReader { def csvFile = CsvParser.parseCsv( it ) csvFile.each { println it } }

Categories : Csv

DotNetZip - Cannot access a closed Stream
It seems that calling Save is the point when the source streams are read. This means you have to keep them undisposed until after the save. Abandon using statement in this case as it is impossible to extend its scope beyond the loop. Instead, collect your IDisposables and dispose of them once the save is completed. result = new MemoryStream(); using (ZipFile zipFile = new ZipFile()) { List<IDisposable> memStreams = new List<IDisposable>(); try { for (int i = 0; i < files.Count(); i++) { System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); Byte[] bytes = encoding.GetBytes(files[i]); MemoryStream fs = new MemoryStream(bytes); zipFile.AddEntry(fileNames[i], fs); memStreams

Categories : C#

Stream Closed error in twitter4j how to solve
Twitter gives the following reasons why you may be disconnected: A client establishes too many connections with the same credentials. When this occurs, the oldest connection will be terminated. This means you have to be careful not to run two reconnecting clients in parallel with the same credentials, or else they will take turns disconnecting each other. A client stops reading data suddenly. If the rate of Tweets being read off of the stream drops suddenly, the connection will be closed. A client reads data too slowly. Every streaming connection is backed by a queue of messages to be sent to the client. If this queue grows too large over time, the connection will be closed. A streaming server is restarted. This is usually related to a code deploy and is not very fre

Categories : Java

Stream closed showing up in play framework 1.2.5
i found the answer. in my application i found like this public static Response upload(File file){ System.out.println("Appliaction.upload"); response = ResumableUpload.post(); return response; // render(response); } the parameter file, it must be delete, then it work!

Categories : Java

java.io.IOException: Attempted read from closed stream
What does EntityUtils.toString(postResponse.getEntity()) do with the response entity? I would suspect, that it is consuming the entity's content stream. The HttpClient javadoc states, that only entities, which are repeatable can be consumed more than once. Therefore if the entity is not repeatable you cannot feed the content stream to the mapper again. To avoid this you should only let the mapper consume the stream - if logging of content is required, log the parsed Response object.

Categories : Java

How to stop SimpleCV camera stream?
I couldn't replicate your issue, but if the webcam is still running even after your program terminates/you close IDLE, you can end the camera by going into task manager and killing all running Python processes. After some experimenting, I found that if you want to accomplish the same thing directly inside the code, you could try simply deleting the reference altogether: >>> import SimpleCV as scv >>> cam = scv.Camera() >>> del cam Calling del cam caused the webcam indicator light on my laptop to turn off. Granted, this appears to be an undocumented (??) solution, so I'm not sure how robust it is. I would probably try testing this on several different laptops/webcams first, to make sure it works reliably and consistently.

Categories : Python

Set activity audio stream to android home audio stream
If you mean which volume it is that gets adjusted when you press the volume keys while at the home screen, then it's most likely the ring volume (i.e. STREAM_RING).

Categories : Java

Stream Closed error on Tomcat 7 with Clojure Compojure Application
I often encounter such situations, where something works in development and fails in production, when a call to the DB is returning a lazy sequence of records, which is being printed to the repl or logger in development and not being realized on the production system. It could be that something in the call to get-productivity is missing a call to doall around the returned rows. Another case is where the exception handler is wrapping around a call to with-connection so when the exception happens the db connection is not longer available, though this seems less likely than a missing doall based on my guess of what could be in get-productivity if you include get-productivity and log an example of it's return value during the failure we will be able to make better guesses.

Categories : Tomcat

How to avoid java.io.IOException: Attempted read on closed stream
Because you are calling releaseConnection() in your finally block, the input stream will no longer be available. If you do not expect the content to be large, you could read the data from the input stream into a buffer and return the buffer instead of the input stream. Otherwise, you will need to change your code to allow the called to process the data from the input stream before releasing the connection.

Categories : Http

Out of Memory error during stream capture from camera
you are calling CvInvoke.cvCreateImage the created data is sitting on the native heap so it wont be collected by the GC. you must call cvReleaseImage(IntPtr) to release the data there are alot of memory profilers which can help understanding the issue try using ANTS Memory Profiler 7

Categories : C#

How can we get H.264 encoded video stream from iPhone Camera?
Short: You can't, the sample buffer you receive is uncompressed. Methods to get hardware accelerated h264 compression: AVAssetWriter AVCaptureMovieFileOutput As you can see both write to a file, writing to a pipe does not work as the encoder updates header information after a frame or GOP has been fully written. So you better don't touch the file while the encoder writes to it as it does randomly rewrite header information. Without this header information the video file will not be playable (it updates the size field, so the first header written says the file is 0 bytes). Directly writing to a memory area is not supported currently. But you can open the encoded video-file and demux the stream to get to the h264 data (after the encoder has closed the file of course)

Categories : Iphone

How to update an XML document by stream reading a file and simultaneously stream writing output
Use SAX parser instead of DOM. You can also use the StAX APIs (part of JDK package javax.xml.stream ). Further reading- http://docs.oracle.com/javase/tutorial/jaxp/sax/parsing.html http://download-llnw.oracle.com/javase/6/docs/api/index.html?javax/xml/stream/package-summary.html

Categories : Java

Dart is there any way to invoke onDone callback from stream.listen() where the stream is from StreamController
You need to call StreamController.close() new Stream.fromIterable(data) basically creates a StreamController, adds the elements of the iterable one at a time, and closes the controller when the iteration is complete. In your second code block you're doing this manually, but just not closing the controller. Here's the relevant docs: http://api.dartlang.org/docs/releases/latest/dart_async/StreamController.html#close

Categories : Dart

"Merging" a stream of streams to produce a stream of the latest values of each
This solution will work for one-item streams but unfortunately accumulates every item in an inner stream until it finishes. public static IObservable<IEnumerable<T>> MergeLatest<T>(this IObservable<IObservable<T>> source) { return Observable.Create<IEnumerable<T>>(obs => { var collection = new PerishableCollection<T>(); return source.Subscribe(duration => { var lifetime = new DisposableLifetime(); // essentially a CancellationToken duration .Subscribe( x => // on initial item { collection.Add(x, lifetime.Lifetime); obs.OnNext(collection.CurrentItems().Select(p => p.Value))

Categories : C#

Stream video from iPhone to web server - compress and stream step
Take a look at http://www.gdcl.co.uk/2013/02/20/iOS-Video-Encoding.html. This sample uses an AVAssetWriter to encode the video from the camera to H264 and then uses RTSP/RTP to stream the data to a player.

Categories : Iphone

How to chain write stream, immediately with a read stream in Node.js 0.10?
request(url).pipe(fs.createWriteStream(filename)).pipe(writestream); is the same as this: var fileStream = fs.createWriteStream(filename); request(url).pipe(fileStream); fileStream.pipe(writestream); So the issue is that you are attempting to .pipe one WriteStream into another WriteStream.

Categories : Node Js

Recording live stream from IP camera (MJPEG Compression)
According to the Wikipedia page about MJPEG (http://en.wikipedia.org/wiki/Motion_JPEG#M-JPEG_over_HTTP), the MJPEG stream over HTTP is basically a sequence of JPEG frames, accompanied by a special mime-type. In order to capture these and save them to a video file, I am not sure you can simply write the incoming data to an .mpg file and have a working video. To be honest, I am not quite sure why your script does not write anything at all, but I came across the following page, which, although it is written for specific software, provides examples on how to capture an MJPEG stream and pass it on to a browser: http://www.lavrsen.dk/foswiki/bin/view/Motion/MjpegFrameGrabPHP You could try one of their examples, and instead of passing it to the browser, save it to a file. You can see they read

Categories : PHP

scala iterator and stream example. stream fails on reuse
It fails because the sentences Iterator has been expended. One is not suppose to call an Iterator after a method on it has been called except for the next and hasNext methods. A simple example shows this: scala> val it = Iterator(1,2,3) it: Iterator[Int] = non-empty iterator scala> it.foreach(println(_)) 1 2 3 scala> it.foreach(println(_)) scala> In your case sentences has been expended on the first call and is empty on the second one giving a size of 0. Calling toStream on it does not change this. You get back an empty Stream. If you want to reuse sentences assign it to a list with val l = sentences.toList before calling count.

Categories : Scala

Stream processing errors with stream with embedded nulls
What you pass a C style string (char pointer) to the std::istringstream constructor it actually instantiates a std::string and passes that instead. This happens due to an implicit conversion. The conversion constructor of std::string interprets a null byte character in C style strings as an end of string terminator causing all characters after it to be ignored. To avoid this you can explicitly construct a std::string specifying the size of the data and pass it to std::istringstream char bin[] = {0x30, 0xb, 0x0, 0x6, 0x6, 0x2b, 0xc, 0x89, 0x36, 0x84, 0x13, 0xa, 0x1}; std::istringstream strm(std::string(bin, sizeof(bin) / sizeof(bin[0]))); Note: I don't know exactly what you are trying to accomplish but I recommend using std::vector instead of a raw character buffer if possible.

Categories : C++

Balancing slow I/O in a fast stream read stream
I just ran into this problem last night, and in my hackathon induced sleep deprived state, here is how I solved it: I would increment a counter whenever I sent a job out to be processed, and decremented the counter when the operation completed. To keep the outbound traffic from overwhelming the other service, I would pause the stream when there was a certain number of pending outbound requests. The code is very similar to the following. var instream = fs.createReadStream('./combined.csv'); var outstream = new stream; var inProcess = 0; var paused = false; var rl = readline.createInterface(instream, outstream); rl.on('line', function(line) { inProcess++; if(inProcess > 100) { console.log('pausing input to clear queue'); rl.pause(); paused = true; }

Categories : Node Js

NodeJS: What's the difference between a Duplex stream and a Transform stream?
The difference is just syntactic sugar. Transform streams are full duplex streams but rather than implementing _write and _read methods, you are asked to implement just the _transform method. You can read more about streams on the excellent substack's streams guide or from Isaacs's readable-stream repo.

Categories : Node Js

Can a writeable stream be piped to either a readable or wirtable stream
Ad 1: Yes, a must be a readable stream, and b must be a writable one. But, streams are not neccessarily either / or, they also can be both: Readable and writeable at the same time. So, b and c are both, hence you can pipe into them, but also pipe from them. Technically they are so-called duplex streams. Ad 2: Should be answered by now ;-). Ad 3: Yes, you should definitely check out the stream-handbook by @substack (aka James Halliday). For buffers, see How to use buffers in Node.js by NodeJitsu.

Categories : Node Js

Copy all but the last 16 bytes of a stream? Early detection of end-of-stream?
Read between 1 and n bytes from the input stream.1 Append the bytes to a circular buffer.2 Write the first max(0, b - 16) bytes from the circular buffer to the output stream, where b is the number of bytes in the circular buffer. Remove the bytes that you just have written from the circular buffer. Go to step 1. 1This is what the Read method does – if you call int n = Read(buffer, 0, 500); it will read between 1 and 500 bytes into buffer and return the number of bytes read. If Read returns 0, you have reached the end of the stream. 2For maximum performance, you can read the bytes directly from the input stream into the circular buffer. This is a bit tricky, because you have to deal with the wraparound within the array underlying the buffer.

Categories : C#

Is there a generator that will turn a stream of text into a stream of lines?
After reading your edit, maybe you could modify the stream object which returns arbitrary amounts of text? For example, in the stream.next() method, there is some way the stream generates a string and yields it when .next() is called. Could you do something like: def next(self): if ' ' in self.remaining: terms = self.remaining.split(' ') to_yield, self.remaining = terms[0], ''.join(terms[1:]) yield to_yield else: to_yield = self.remaining + self.generate_arbitrary_string() while ' ' not in to_yield: to_yield += self.generate_arbitrary_string() to_yield, self.remaining = terms[0], ''.join(terms[1:]) yield to_yield This pseudocode assumes that the stream object generates some arbitrary string with generate

Categories : Python

RX: How to concat a Snapshot stream and an Update stream?
Whether you use a ReplaySubject or the Replay function really makes no difference. Replay uses a ReplaySubject under the hood. I'll also note that you are leaking subscriptions like mad, which can cause a resource leak. Also, you put no limit on the size of the replay buffer. If you watch the observable all day long, then that replay buffer will keep growing and growing. You should put a limit on it to prevent that. Here is an updated version of GetStream. In this version I take the simplistic approach of just limitting the Replay to the most recent 1 minute of data. This assumes that GetData will always complete and the observer will observe the results within that 1 minute. Your mileage may vary and you can probably improve upon this scheme. But at least this way when you have

Categories : C#

I want to stream video from my webserver, but I only want it to stream when there is a viewer
Try Page Visibility API. Supported Browsers : http://caniuse.com/#feat=pagevisibility

Categories : Javascript

Weird issue with TcpClient.Connected=true when tcpclient and relative stream have been closed C#
I don't know if this may interest anyone, but I'll tell you how I solved this issue. Since TcpClient.Connected doesn't seem to be reliable, (under certain conditions it will still be true even after a failed read attempt on the underlying stream) instead of checking the connection status from TcpClient.Connected, I use a bool "disconnected". Such bool value is managed by the thread which was listening from such TcpClient (through a BinaryReader): when a read fails -> it means that the connection has been closed -> an exception is generated and it's gracefully handled by a try/catch, where: try { reader.Read(); } catch { disconnect = true; }

Categories : C#

Cannot read XLSX file - Exception with Stream "Cannot access Closed File
The difference is probably in the method: excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); Can you show us that code and verify that you're not accidentally prematurely closing the stream?

Categories : C#

Network stream stuck on stream.Read(byte[] byte, int offset, int size)
Because it's a stream, and can be partial received. Are you sure you are always receiving packages with te size of 2048 bytes? int i = 0; int bytesNeeded = 200; int bytesReceived = 0; do { //read byte from client int bytesRead = stream.Read(receivedBytesRaw, bytesReceived, bytesNeeded-bytesReceived); bytesReceived += bytesRead; // merge byte array to another byte array } while (bytesReceived < bytesNeeded); I think you need a frame protocol, try create a protocol like, writing the size of the data that follows. example: (psuedo) void SendData(byte[] data) { // get the 4 bytes of a int value. byte[] dataLength = BitConverter.GetBytes(data.Lenght); // write the length to the stream. stream.Write(dataLengt

Categories : C#

Odd behaviour: copying more bufferSize with .NET Stream.CopyTo(Stream destination, int bufferSize)
I misunderstood the meaning of bufferSize in Stream.CopyTo(Stream destination, int bufferSize). I thought it was the total amount of bytes to be copied, not simply the buffer to be used while copying. There is no feature in the Stream object to copy only a specific number of bytes. I fixed the problem by replacing this.captureStream.CopyTo(captureSession.captureStream, chunkLength); with writer.Write(reader.ReadBytes(chunkLength));

Categories : C#

Gstreamer in Android. UDP stream
Well, I've been able to resolve the issue. The caps should be like this: udpsrc port=5000 caps="application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, sprop-parameter-sets=\"J2QAFKwrQLj/LwDxImo\\=\\,KO4fLA\\=\\=\"", payload=96" ! ... The video is shown with almost no delay

Categories : Android

Android Stream Video from url
Have you tried with Intent intent = new Intent(Intent.ACTION_VIEW); instead Intent intent = new Intent(Intent.ACTION_MAIN); I think it can helps you: Play youtube video from URL in android

Categories : Android

Best way to stream Ogg Vorbis on Android
My suggestion would be to use the NDK to get a vorbis decoder running natively (perhaps Tremor), and then utilize that MUCH FASTER native decoder from your app instead of using the much slower jogg/jorbis java decoder. (It will probably be at least an order of magnitude faster than the java decoder) You can then use the AudioTrack class to take the native decoded PCM and write it out to the audio device. I would be surprised if someone hasn't already done this, so google around first!

Categories : Android

Android - MediaPlayer's on Prepare Called even before the stream is prepared on Android 4.0+
I don't have much experience with media player. But couple of suggestions/queries from my side No call to prepare. If you are doing it, did you try prepareAsync ? You are not using the mediaplayer instance which is passed to the onPrepared callback. There can be a chance that you are trying to start the wrong mediaplayer.

Categories : Java

Android MP4 stream - Video cannot be played
Try this, it played the video for me <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <VideoView android:id="@+id/videoViewa" android:layout_width="match_parent" android:layout_gravity="center" android:layout_height="match_parent" /> VideoView videoView; videoView = (VideoView) findViewById(R.id.videoViewa); MediaController mediaController = new MediaController(this); mediaController.setAnchorView(videoView); //URI either from net Uri video = Uri.parse("http://www.fieldandrurallife.tv/videos/Benltey%20Mulsanne.mp4"); videoView.setMediaController(mediaController); vid

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.