w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to maintain stable frames-per-second while capturing real-time video in C#
Its difficult to tell anything with this lack of information. What's the format? there's compression? How is the camera API sending the frames? Are they timed, so the camera will send the frame rate you asked for? If it is, you are really dealing with I/O speed. If you need high quality, and is writing without compression, you could experiment some lossless compression algorithm to balance between processing and drive I/O. You could get so speed if the bottleneck at the drive I/O is high. For the frames theres some ways to implement that. Normally frames have time-stamp, you should search for that, and discard frames that are so near of the other. Let's say that you want 60 fps, so the space in ms between frames is 1000/60=16ms, if the the frame you get have a time stamp lets say 13ms

Categories : C#

Record video with web cam and get first frame of that and compare it with next frames in matlab
imread is used to read a file from a folder which is already in a particular compressed or uncompressed format. In your case, you have raw data, on which you can perform operations. So, try using: camfrm1 = rgb2gray(camfrm1); This should work. There is a second typo: bt = abs(double(camfrm2)-double(camfrm1));

Categories : Matlab

How do I display real-time information to the user?
It looks like you're wanting to 'push' data to the user in real-time. Previously this might have been done with a bit of a 'hack' solution known as long-polling With long polling, the client requests information from the server in a way similar to a normal polling; however, if the server does not have any information available for the client, then instead of sending an empty response, the server holds the request and waits for information to become available (or for a suitable timeout event), after which a complete response is finally sent to the client. However you might want to look into the HTML5 world of WebSockets. To do this I'd recommend reading up on SignalR and following some tutorials (watch the pluralsight videos). ASP.NET SignalR is a new library for ASP.NET develope

Categories : Ajax

How to get RGB values per frame from real time video on iOS?
I can only assume that you mean to decode h.264 video and then get the RGB(A) pixel values from it. In that case, you need to use the AVAssetReaderOutput class to open and then decode frames from a h.264 asset attached to the Xcode project. If you are new to video processing in software, be careful and make sure you really understand what you are doing before you begin because memory use in video processing is shocking and you will likely crash your iOS app if you do not fully understand how much memory you are allocating at one time. Please have a look at my blog post on this subject at video_and_memory_usage_on_ios_devices. You can find lots of sample code in bits and pieces all over, but you basically just need to create the asset, decode frames from it, and then read the RGBA pixels fr

Categories : Iphone

Plotting in Matlab using Real Time data from Simulink
There should be some kind of notification going when simulink updates the data to be visualized. Maybe this is the linkdata feature. Another, worse, solution is the drawnow command to redraw the graphs continously (the latter could be unnescessary costly for you program).

Categories : Matlab

Database design or architecture suitable for storing logs, real time reporting and utilized as log correlation engine
Lots of questions! Q1: Does NoSQL have aggregation? A1: I know Mongo has aggregation, but the last time I used it, it wasn't particularly fast compared to relational databases. Can't speak to Cassandra. Lots of people use Mongo to store structured logs and report. Q2: What about data warehouses? A2: You're right that a data warehouse can exist in a relational database. It's just a different way of structuring the data and thinking about it. Have you thought about keeping a snapshot of time in a real time relational database and then archiving older logs? For example, maybe at 10 million, you start shipping out the oldest log entries to a data warehouse and this guarantees that you are always only looking at the most recent 10 million log entries, which should be fast.

Categories : Database

How do i separate a video into frames without displaying all the frames in different figures?
Not sure whether it is a full solution, but one improvement in your code would definately be to move the figure() command out of the loop. Maybe this is already sufficient, or maybe you need to assign your image command to a handle as described in this related question , allowing you to remove the last plotted image before you plot a new one.

Categories : Matlab

Capture real-time command window output in Matlab
You can't do that with MATLAB's dos (or the related system and unix), because they (as you have already noted) are synchronous and only return once the application has finished. What you need is to run the external program and your waitbar code asynchronously. This cannot be done in pure MATLAB code, but it's possible to do using Java (which can be used directly from MATLAB): Write a class in Java that runs your program and collects the output asynchronously. See this answer on SO for details. Have your Java class call a MATLAB callback when new output data is read. The MATLAB callback can then update the waitbar. See this post on undocumentedmatlab.com for more information.

Categories : Matlab

Creating a continuous tone in MATLAB whose frequency varies in real-time depending on user input
The solution may not come from multithreading, but from the use of another function to output a tone(audioplayer, play, stop). 'audioplayer/play' has the ability to output sounds that overlap in time. So basically, a pseudo code would be: get the value of the input generate/play a corresponding 5 second tone detect if any change in the input if no change & elapsed time close to 5 seconds generate/play an identical 5 second tone if change generate a new 5 second tone %no overlapping stop old play new %overlapping (few milliseconds) play new stop old The matlab code showing the 'sound'/'play' differences. Fs = 1000; nSeconds = 5; frequency = 100; y1 = 100*sin(linspace(0, nSeconds*frequency*2*pi, round(nSeconds*Fs))); aud1 = audi

Categories : Multithreading

Create a video from another video by taking some frames only but without writing them onto a file
Create a cap = cv2.VideoCapture(file_name). Get the width and height of your movie with h = cap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) w = cap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH) Create a numpy array frames = np.zeros((h, w, 3, number_of_frames), np.uint8) and save the frames you want to keep to this array: error, frame = cap.read() frames[:,:,:,i] = frame If you don't know how many frames you have beforehand, just concatenate them in a Python list. Then, display your frames.

Categories : Python

Are there any free compression utilities that zip in real time like Xceed Real-Time Zip?
What you are looking for is stream compression approach. Good news is you have quite a lot of options. Please also note you have to think about memory because some solutions (dictionary-based) might require a lot of memory, so test and tune. In order to keep my answer short I would suggest to give LZ4 a try. LZ4 - http://code.google.com/p/lz4/ LZ4 is a very fast lossless compression algorithm, providing compression speed at 300 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in GB/s per core, typically reaching RAM speed limits on multi-core systems. Benchmark: Name Ratio C.speed D.speed MB/s MB/s LZ4 (r97) 2.084 410 1810 LZO 2.06 2.106 409 600 QuickLZ 1.5.

Categories : Dotnet

How to get video frames from mp4 video using ffmpeg in android?
compile ffmpeg.c and invoke its main() via jni. For more details see how to Use FFMPEG on Android . Also refer this github project. And this tutorial too will help you. I hope this will help you.

Categories : Android

Getting video frames from a video in Android
You can register a PreviewCallback handler. This interface declares onPreviewCallback() method which is called exactly as you want: once for every distinct video frame. The parameter is the raw camera image.

Categories : Android

Get all frames of Video IOS 6
Sounds like you are running into memory issues from 375 images. Try this instead, it may provide better memory management. -(void) getAllImagesFromVideo { imagesArray = [[NSMutableArray alloc] initWithCapacity:375]; times = [[NSMutableArray alloc] initWithCapacity:375]; for (Float64 i = 0; i < 15; i += 0.033) // For 25 fps in 15 sec of Video { [times addObject:[NSValue valueWithCMTime:CMTimeMakeWithSeconds(i, 60)]]; } [imageGenerator generateCGImagesAsynchronouslyForTimes:times completionHandler:^(CMTime requestedTime, CGImageRef image, CMTime actualTime, AVAssetImageGeneratorResult result, NSError *error) { if (result == AVAssetImageGeneratorSucceeded) { [imagesArray addObject:[UIImage imageWithCGImage:image]]; CGImageRe

Categories : IOS

Get Frames from Video in c#
You can use Process.Start on the server side to create thumbnails from the video using FFMPEG, commands here. The command line looks like: ffmpeg -i input.flv -f image2 -vf "select='eq(pict_type,PICT_TYPE_I)'" -vsync vfr thumb%04d.png

Categories : C#

How to manage video frames in memory
You just can't load all of these frames in memory becouse there is a memory limit. To check the limit you can google Android heap size, it's different for each device but it's not that much. You'll have to process it frame by frame and save it on a storage device like the sdcard.

Categories : Java

Compressing frames inside an AVI video
I take this to be a continuation/re-post of your previous question (but with a few more details). As I mentioned in the comments of that post, there is a whole universe of video codecs out there. One reason for the proliferation is that a lot of people like to re-invent wheels. However, a more salient reason is that there are a lot of different use cases for video. You seem to be asking for a lot, yet there are a lot of variables you have not presented: You express a need for a video encoder that will run purely in software on a Windows Phone device, which is necessarily a fairly low-powered machine; do you need it to run in real-time? I.e., do you expect a frame of video to be compressed almost immediately after to send in the uncompressed frame (within a few milliseconds)? Or can you

Categories : C#

How to extract programmaticaly video frames?
I would personally look for libraries that wrap ffmpeg/libavcodec (the understands-most-things library that many encoders and players use). I've not really tried any yet so can't say anything about code quality and ease, but the five-line pyffmpeg example suggests it's an easy option - though it may well be *nix-only.

Categories : Java

change detection on video frames
For effects like zooming in and out, optical flow seems the best choice. Search for research papers on "Shot Detection" for other possible approaches. As for the techniques you mention, did you apply some form of noise reduction before using them?

Categories : Python

how to read video file and split it into frames
Grabbing a video frame in OpenCV is pretty easy. There are lots of examples on OpenCV site. However crucial thing is to set-up opencv on andriod. You can follow this link on getting started with Opencv on andriod. http://opencv.org/android Once you have opencv installed on andriod. You can easily load video file and grab frame in Mat structure and then do some processing on it. Here is the sample one. It will need some modification to run it on andriod. I think you will need to used NDK on andriod for this. int main(int argc, char*argv[]) { char *my_file = "C:\vid_an2\desp_me.avi"; std::cout<<"Video File "<<my_file<<std::endl; cv::VideoCapture input_video; if(input_video.open(my_file)) { std::cout<<"Video file open "<<std::en

Categories : Android

How to play a video and capture the frames from it using java
You should use JMF - Java Media Framework. Take a look on this reference:http://www.oracle.com/technetwork/java/javase/tech/index-jsp-140239.html It contains download links and tutorials.

Categories : Java

OPENCV cannot read 2 video frames simultaneously
The function input_video.read() doesn't create new object every time you call it and returns a pointer of an internal buffer of cv::VideoCapture. For this case if you copy first frame to a cv::Mat object, problem is resolved: while (true) { cv::Mat frame,frame1,frame2,dst,temp; if (!input_video.read(frame)) { fprintf(stderr, "Video has Finished . "); getchar(); return -1; } frame.assignTo(frame1); if (!input_video.read(frame)) { fprintf(stderr, "Video has Finished . "); getchar(); return -1; } frame.assignTo(frame2); cv::cvtColor(frame1,frame1,CV_RGB2GRAY) ; cv::cvtColor(frame2,frame2,CV_RGB2GRAY) ; cv::subtract(frame2,frame1,dst); cv::imshow("F1",frame1); cv::imshow("F2",frame2); c

Categories : Opencv

How to grab video frames from onPreviewFrame in android?
Use a timestamp (System.currentTimeMillis()) to check how long it takes to execute this code. Multiply that by 30 and it should be lower than 1 second. Maybe your Android device is not that fast to convert the raw preview data to jpg and write that to disk. Where do you write it sd-card?

Categories : Android

Which method to use to extract frames from the video in iphone?
You are going to have some legal issues to deal with attempting to use ffmpeg compiled into an iOS application, see compatibility-between-the-iphone-app-store-and-the-lgpl for more on that. I had not heard of AVAssetImageGenerator before, but that copyCGImageAtTime method seems like exactly what you would want for small thumbnails, it should be easy to create a UIImage and pass in the returned CGImageRef and then save the result as a PNG. The requestThumbnailImagesAtTimes API likely just calls AVAssetImageGenerator anyway.

Categories : Iphone

Capturing frames from a video file for further processing?
If you're not required to use JMF, it is probably worthwhile to consider other options at this point. Unfortunately, Xuggle/Xuggler is apparently on hiatus - but if the state of its last release will work for you, they have a Frame Capture Demo that should be a good starting point. If you are sticking with JMF, perhaps Accessing Individual Decoded Video Frames will point you in the right direction with its info on using a pass-through codec. Note that you'll need to search for a copy of FrameAccess.java if you want the demo code for this option (the link seems to be broken on that page).

Categories : Java

Subtract And Merging Images for Making Video Frames
The problem is that the difference filter takes the absolute value. The result is that the mouse pointer is getting added back into the image rather than subtracting from the image since it should be negative in the difference image. I'm not sure how to fix this in AForge.net. In opencv you resolve this by using an image type that supports signed numbers, like CV_16SC3 instead of the default CV_8UC3 for an RGB/BGR image. You shouldn't use CV_8SC3 because one of the 8 bits will be used for a sign, so pixel values outside +/-127 will be clamped. void imageDelta(cv::Mat& A, cv::Mat& B, cv::Mat& deltaOut) { //Calculate B - A, preserving sign A.convertTo(A, CV_16SC3); B.convertTo(B, CV_16SC3); cv::subtract(B, A, deltaOut); //deltaOut is a CV_16SC3 } void reconstr

Categories : C#

Generating smaller video file size from frames
This is completely dependent on what you are trying to hide in the original video. Remember that the original video is using a compression codec that can take advantage of minimal change frame to frame and various other things, but if you go and try to hide something in that video through steganography, you are making it more difficult for the compression algorithm to do that, which will definitely result in a larger file. So you have to be careful what you are attempting to do, and how you are attempting to encode it.

Categories : Matlab

How to divide wav file into frames uding MATLAB
It has been a long time since I last worked on MatLab, but I think the general algo should be: Take the input signal. Multiply point-by-point with a windowing function (say rectangular of 'n' samples). This means you will now have a frame of 'n' samples. Take an FFT of this frame. Move the window by 'm' samples (m = shift, usually about 25% of 'n'). Do steps 2 and 3. If end of signal is reached, take however many samples of the signal you get and fill the rest with zeros. Do steps 2 and 3. You now have a 3D plot - frequency, amplitude and time. Plot to get STFT. On a side note: Are there no STFT functions in MatLab? Have you checked?

Categories : Matlab

Extract time frames from time period
Haven't tested this, but I hope it gets you on the right track: <?php $price = 0; $start_timestamp = 1367449200; $end_timestamp = 1367546400; $start_time_of_day = 1367449200 % (24*60*60); // Number of seconds from start of the day $end_time_of_day = 1367546400 % (24*60*60); // Number of seconds from start of the day // How much time the time period spends in the first day (in seconds) $first_day_time = (24*60*60) - $start_time_of_day; // How much time the time period spends in the last day (in seconds) $last_day_time = (24*60*60) - $end_time_of_day; $full_days_time = $end_timestamp + $last_day_time - ($start_timestamp + $first_day_time); $full_days = round($full_days_time/(24*60*60)); // You can calculate by hand how much one full 24-hour day from 00:00 to 00:00 costs $price += $fu

Categories : PHP

how to get video's real size in html5
it appears the issue is with metadata loading and when you query the size too early you get the default 100x100. if you do a specific check after the durationchange event shows a duration greater than 1s then you will see correct values for the videoWidth and videoHeight (I've found with HTML5 video in Android that relying on anything before the duration shows greater than the initial default of 1s is problematic)

Categories : HTML

Converting date from SQLite manager to real time (mountain standard time)
Try this: SELECT datetime(399082293, 'unixepoch', 'localtime'); the result given for me is: 1982-08-25 01:11:33 There is more information about various date formatting options in SQLite on this page.

Categories : Sqlite

Storing information in value bean
I think this one is better because there is no need to create an array of movie. You can directly get bean and add it to List. You can also set this list to request for accessing on JSP page. while(rs.next()) { movie movies1 = new movie(); movies1.setMovieID(rs.getInt("Movie_ID")); movies1.setMovieTitle(rs.getString("Movie_Title")); movies1.setReleaseDate(rs.getDate("Release_Date")); movies1.setImage(rs.getString("Image")); movies1.setDescription(rs.getString("Description")); movies.add(movies1); }

Categories : Jsp

Change the real time into a given span of time, with jquery, mysql and/or php
Interesting problem. I would think the algorithm would go something like this: Calculate what percentage of an actual day has passed. Use that to calculate how much time has passed in a virtual day (multiply times 32400 to get the number of seconds, probably). Add that number of seconds to a date object that has been set to 20:00PM on today's date.

Categories : Javascript

Getting the real HTML5 video width and height
You should add a loadeddata event listener to the video, and try to read the size then, which is when enough information about the stream has been decoded and the dimensions can be accurately determined. Still, it sometimes takes a bit in some cases to get the dimensions ready, so you might want to try several times (with delay) until it works. That might be why it is not working for you but it's working for Sam. Here's how I check the video size, with several attempts if required, in my gumhelper library: https://github.com/sole/gumhelper/blob/master/gumhelper.js#L38 Notice how we try several times and if it doesn't work we "give up" and default to 640x480.

Categories : Javascript

Keeping video viewing statistics breakdown by video time in a database
Second approach looks tempting at first sight, but it makes queries like "how many views for segment x of video y" unable to use an index on video.heatmap. Not sure if this is a real-life concern for you though. Also, you would have to parse back and forth the entire array every time you need data for one segment only. But first and foremost, your second solution is hackish (but interesting nonetheless). I wouldn't recommend denormalising your database until you face an acutal performance issue. Also, try populating the video_headmap table in advance with wiews = 0 as soon as a video is inserted (a trigger can help). If space is really a concern, remove your surrogate key video_headmap.id and instead make (video_id, position) the primary key (then get rid of the superfluous UNIQUE const

Categories : Mysql

Storing Information in an Address Book
everytime you want to insert a name you are creating a new Object from ArrayList information = new ArrayList<String>(); initizalize this arraylist in your main method and then access it via its variable(information)

Categories : Java

Storing information from ListView Adapter without SharedPreferences?
getSharedPreferences(String, int) needs to have a context. You can always pass in a context in your adapter: class YourAdapter extends BaseAdapter{ private Context context; public YourAdapter(Context context){ this.context=context; } //What ever u need to do in this adapter private doStuff(){ context.getSharedPreferences(String, int);//ok } } When you are creating this adapter in your Activity, just pass in the activity like: YourAdapter mAdapter=new YourAdapter (this); //in your activity .

Categories : Android

Options for storing user information while logged in
You'll want to leverage Session for that. Consider the following code: Session["Profile"] = profileObj; or maybe you just want to store a string: Session["SomeSetting"] = value; What you need to store in Session is unclear, and effectively irrelevant, you can store anything. You can access the Session from any Controller. Then later on you can get the value out like this: var profile = Session["Profile"]; // if the profile variable is null then it doesn't exist in Session yet In response to @AaronLS, Session lasts the duration of the IIS session that's created when the user first accesses the site. Do keep in mind that these sessions are reset if inactive for a period of time (I believe the default IIS timeout is 20 minutes) so you'd want to leverage the null return value to kno

Categories : C#

Hadoop datanode blocks storing information
Since you have only 2 node clsuter all the blocks will be stored there. In general I dont think so that you can find easily which blocks are present on datanode. What is the use case by the way for this

Categories : Hadoop

Storing information from switch statement into a variable?
string white; string black; These two lines just define empty strings with no text in them. I think you meant something like: string white = "white"; string black = "black"; Also I'm not sure what your characterRace() function is really meant to accomplish, at the moment it's a no-op and so could be simplified to: case 1: storePlayerRace = "white"; break; case 2: storePlayerRace = "black"; break;

Categories : C++



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