Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I want to make a video transcoder as a holiday project in Java. I was looking into the basics of video files and came across terms like containers, bit rate, bit depth and so on.
I have questions regarding bitrate.
I know bitrate is the amount of data that is contained in the video per second. Sound also has a bit rate but is considerably lower than that of video, obviously.
So, say there is a video that is of 8 Mbps (YouTube HD 720p) and the user wants to transcode it to a lower bitrate of 4 Mbps.
Will this cause the sound to go out of sync?
I am not doing the transcoding myself, I am using Xuggler for it which contains a lot of codecs like H264 and others.
Also, if, by an accident the user decides to convert a 4 Mbps video to a 8 Mbps video, what will happen ?
This situation is possible if the user gives a video captured from a phone camera and decides to store it in DVD quality.
Also, there are other things to take into consideration like frame rate right ? Because a low capacity device can not handle a higher frame rate. is frame rate related to bit rate?
There are several possibilities of what will happen, depending on the decoder and so on. I'm not familiar with Xuggler, but:
The sound should not go out of sync if you drop video bitrate with a proper software. It will not shorten the video or anything like that. Depending on what you do to it, either the frame-rate will drop ( it will discard every 2nd frame) or each frame will be more compressed.
The audio and video are generally independent, so changing the bitrate of one will not affect the other. In the case of changing to a higher bitrate, the transcoder will either throw an error, or produce a larger file at the same quality as the original.
The frame rate is not directly related. The bit rate is just a measure of how many bits are being used to encode one second of audio or video.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Need an algorithm (or a set of good ones to compare for various input data) that will reduce the noise level of a voice audio signal without distorting the signal appreciably using Java.
Input is an audio signal that includes a voice along with some background noises. The noise varies over the course of the recording. There definitely exists ways to remove noise like this, developed for voice recognition and movie making.
The desired output is a minimally distorted voice signal with the background distractions minimally audible to the human ear. The quantitative criteria are minimized
Signal to noise ratio and
Total harmonic distortion.
You are looking for adaptive noise removal and possibly a variety that adapts to changing noise conditions over time within the same stream or file.
Older approaches include:
Remove frequencies containing the majority of noise using bandpass and/or notch filters (which only works well if the desired signal and the noise band do not intersect)
Drop the noise level at points between words, notes, or other audio events (in the dead space) as does the Dolby noise reduction system scheme
Drop the noise floor across an entire file using a Hamming window or other window in conjunction with an FFT library
Hand edit sections of an audio track in programs like Cakewalk or its
competitors
These methods have been found less than desirable when trying to clean up a larger file or multiple files or in real time applications such as real time voice recognition or telephony.
One of the Java programs that I have not personally tried his here. Even though it has some level of automation, it is an LSE (least squares estimator) which works across a block of data but is not suitable for continuous operation or an audio file with changing unwanted noise conditions. (It's not as adaptive as one might hope.)
The solution that I found after much investigation and now use all the time is not written in Java. It is a MATLAB program that can also run in open source Octave with minimal modification. I started porting it to C++ but ran out of time to finish that.
The class of algorithm it implements is called MMSE (Noise Reduction Using Minimum Mean Square Estimators). The MATLAB version has been refined several times by Dr. Hendricks, concluding with the the 2010 version.
I've compared it with its competitors for both dialog and music and it equals or excels beyond the others in all cases I've tried. (I have no affiliation with Dr. Hendricks or MATLAB other than I like the results I've been getting from his implementation on that platform.)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have been experimenting with ways to use the processing power of two computers together as one (not by physically connecting them, but by splitting the task in half and each computer does a half, then the result from the "helper" computer is sent back to be combined with the result from the "main" computer via internet)
I've been using this method to compute fractal images and it works great. The left half and the right half of the image are computed on separate computers, then combined into one. The process of sending one half of the image to the other computer and combining them takes maybe a second, so the efficiency is great and cuts time down by about half.
The problem comes when you want to do this "multi computer processing" with something that needs data exchanged very frequently.
For example, I'd like to use this for something like an n-body simulation. You need the data exchange to happen multiple times per second, so if the exchange takes about a second it actually takes much longer to try and use two computers then it would with one.
So how do online video games do it? The players around you, what they are doing, what they are wearing, everything going on has to be exchanged between everyone playing many times per second.
I'm just looking for general ideas on how to send larger amounts of data and at fast speeds.
The way I have been doing it is with PHP on a free hosting site. The helper computer will compute its half of the data then sends it to the PHP file which saves that data somewhere. Then the main computer reads this and combines it with the data it computed already.
I have a feeling PHP isn't the way to go, but I don't know much about this sort of thing.
Your first step will be to move from using HTTP Requests to using Sockets directly - this will give you much more control over the communication, and give you improved performance by reducing the overhead of the HTTP protocol (this is potentially pretty significant). Plus, with sockets you can more easily have your programs communicate to each other directly, rather than through the PHP-based software.
There are a ton of guides online as to how you would do this sort of system, and I would recommend Googling things like "game networking" and "distributed computing".
Here is one series of articles that I have found useful in the past, that covers the sort of things that you will want to read about: http://gafferongames.com/networking-for-game-programmers/
(He doesn't use Java, but the ideas are universal)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have to record whatever user listening through headphones. Say for example, user listening song, talking to someone (in call) etc. Without headphones I was able to record but with headphones I ran out of luck. I tried this link with all possible Audiosource and MediaRecorder but did not get expected result. So, help or any clue is greatly appreciated.
Edit : I thought to record headphone output but seems its not possible by Michael's answer. So, my requirement is as above. Any suggestion or clue about how can I achieve this is greatly appreciated. Thanks.
There's no support in Android for recording output streams. There might be phones that support it in some fashion, but that'll be completely vendor specific and not something you can expect to work on any Android device.
Voice call recording is a special case, because voice call audio aren't regular streams that are managed by applications. Many Android devices support recording of both the voice call uplink and downlink using the VOICE_CALL/VOICE_DOWNLINK/VOICE_UPLINK audio sources.
When you say that you were able to record the playback without headphones, what I suspect actually happened was that the microphone picked up what was coming out of the loudspeaker, rather than some form of internal recording of output streams. Recording the loudpeaker output through the primary microphone is certainly one way of doing it, but the resulting recording is probably going to sound really bad.
I usually just hook up my Android phone to a rig I originally made to record PlayStation 1 audio, into my computer.
Stereo RCA cable terminating in dual female ends on each side ( 3 bucks ) combined with two stereo adapters that take the signal from two female RCA plugs, into a single standard headphone jack.
Attach, place one of the now standard male stereo headphone plugs into phone, the other into the audio mic input of your computer.
Fire up program like WireTap or similar
Adjust settings so you can hear the received audio coming in through your streaming phone, and press the record button.
It may not be FLAC quality - but good enough.
Total cost of equipment ( not including phone or computer): About 15 bucks.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am thinking of assembling this system:
AMD CPU(A8-3870 APU which has Radeon HD 6550D inside: 400 stream processors:xxx GFLOPS) nearly 110$
AMD Graphics card: HD 7750 (512 stream processors:819 GFLOPS peak performance) nearly 170$
an appropriate ram(1600MHz bus) and mainboard
Can i achieve 819+xxx GFLOPS peak-performance mentioned in official sites with using OpenCL and similar programs?
Can i use all 912 cores with OpenCL/Jocl and is it important to add cpu-cores to the pot(4 of them(of course 2 of them will be used for feeding gpu))?
C++ or Java, which one has the most yielding libraries for using multiple gpu's or apu's present on computer?
What happens if i cancel both apu and gpu and buy a single Nvidia GTX-660? This wins?(229$ -1800GFLOPS)(with a simple 4-core cpu of cheapest without apu)
I am not trying to do a VS question. I need to know what could be better for scientific computing(%75 of the time) and gaming(%25 of the time) because i have a low budget. With "scientific calculations" i mean fluid dynamics+solidstate physics simulating. With games i mean those have openCL and PhysX.
Can you give a very very minimal simple example of OpenCL code using multiple GPUs ?
Thank you.
Can i achieve 819+xxx GFLOPS mentioned in official sites with using OpenCL and similar programs?
This is the peak performance. One definition of peak perform is; A manufacturers guarantee not exceed this rating.
You can achieve this number most likely, but not doing something useful. What you can achieve for your specific requirement depends greatly on what it is. You might expect to get 0.1% to 10% of this value in reality.
C++ or Java, which one has the most yielding libraries for using multiple gpu's or apu's present on computer?
I would use whatever you are most comfortable with. You can call the GPU from either, but the language you use is C-like so it doesn't matter what the "host" language is.
What happens if i cancel both apu and gpu and buy a single Nvidia GTX-660?
Impossible to say, but there is a good chance whatever you choose will be okay.
Can you give a very very minimal simple example of OpenCL code using multiple GPUs ?
There are lots of example on the web, but you really need to focus on what you will be using the system for.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Now that the oligopole of market data providers successfully killed OpenQuant, does any alternative to proprietary and expensive subscriptions for realtime market data subsist?
Ideally I would like to be able to monitor tick by tick securities from the NYSE, NASDAQ and AMEX (about 6000 symbols).
Most vendors put a limit of 500 symbols watchable at the same time, this is unacceptable to me, even if one can imagine a rotation among the 500 symbols ie. making windows of 5 sec. of effective observation out of each minute for every symbol.
Currently I'm doing this by a Java thread pool calling Google Finance, but this is unsatisfactory for several reasons, one being that Google doesn't return the volume traded, but the main one being that Google promptly is killing bots attempting to take advantage of this service ;-)
Any hint much appreciated,
Cheers
I think you'll find all you need to know by looking at this question: source of historical stock data
I don't know of any free data feeds other than Yahoo!, but it doesn't offer tick-by-tick data, it only offers 1 minute intervals with a 15 minute delay. If you want to use an already existing tool to download the historical data, then I would recommend EclipseTrader. It only saves the Open, Close, High, Low, and Volume.
(source: divbyzero.com)
You can write your own data scraper with very little effort. I've written an article on downloading real-time data from yahoo on my blog, but it's in C#. If you're familiar with C# then you'll be able to translate the action in Java pretty quickly. If you write your own data scraper then you can get pretty much ANYTHING that Yahoo! shows on their web site: Bid, Ask, Dividend Share, Earnings Share, Day's High, Day's Low, etc, etc, etc.
If you don't know C# then don't worry, it's REALLY simple: Yahoo allows you to download CSV files with quotes just by modifying a URL. You can find out everything about the URL and the tags that are used on yahoo here: http://www.gummy-stuff.org/Yahoo-data.htm
Here are the basic steps you need to follow:
Construct a URL for the symbol or multiple symbols of your choice.
Add the tags which you're interested in downloading (Open, Close, Volume, Beta, 52 week high, etc, etc.).
Create a URLConnection with the URL you just constructed.
Use a BufferedReader to read the CSV file that is returned from the connection stream.
Your CSV will have the following format:
Each row is a different symbol.
Each column is a different tag.
Open a TDAmeritrade account and you will have free access to ThinkOrSwim real time trading and quotes platform. Live trading is real time and paper trading is delayed 15 minutes. I forget what the minimum required is to open a TDAmeritrade account but you can go to TDAMeritrade.com or thinkorswim.com to check them out.
Intrinio has a bunch of feeds with free and paid tiers. Essentially you only have to pay for what you need as opposed to the bigger data suppliers. Intrinio focuses on data quality and caters to developers as well, so I think it'd be a great option for you.
full disclosure - I work at Intrinio as a developer
There's a handy function in Google Sheets (ImportHTML) which I've been using for a while to reasonable effect.
For example -
=ImportHTML("http://www.bloomberg.com/markets/commodities/futures/metals/","table",1),5,3) returns the EUR Gold spot price.
It works with Yahoo too, so =Index(ImportHTML("http://finance.yahoo.com/q?s=DX-Y.NYB","table",0),2,2) returns the DXY.
The data updates with some small delay but it's usable.