DirectShow filter to detect specific frequencies - c++

loving and gracious Internet community. I am working on building an application that uses DirectShow to play HLS streams and run some processes on them.
I used Graphedt.exe to render the URL that we use and it works great, but we need to be able to detect specific sub-audible frequencies. I assume that a filter would serve that purpose well. Just not totally sure how to analyze the incoming frames for an audio frequency.
I am new to C++ programming but am willing to learn and work on it.
Any help is greatly appreciated. Thanks.

If you are using the default DirectSound audio renderer, then you should try writing a TransInPlace filter to Account the buffers flowed.
Furthermore, you can add a property page to be useful when debugging.

Related

Audio plugins. Mapping MIDI to audio files

I am a reasonably experienced programmer who is pretty inexperienced with C++ and brand new to creating plugins.
Thus far I have looked into http://martinfinke.de/blog/tags/making_audio_plugins.html but it seems incredibly dated, I'm hitting a whole load of compilation issues and don't know where to get the legacy SDKs which would mean I had the exact same set up that the author is using.
I have also looked into JUCE but there isn't a vast amount of resources out there that I can find.
What I am trying to do is create a plugin, VST only for now (will look at compatibility with other vendors later) which simply maps a MIDI input to an audio file which my partner, who is a sound engineer, has already created. We have enough samples for randomising and also various velocities
I highly recommend just working your way through the JUCE Tutorials or watching through the JUCE videos by The Audio Programmer on Youtube to get you started on JUCE. Whilst the first tutorials do not produce audio plugins, the components used within them are crucial 'building blocks' to creating a full plugin.
When you're happy with creating basic GUI elements and how audio can be played/ synthesised within both the Audio App and Audio Plug-In projects, I recommend you try building the smallest part of your plugin you can and, getting that working and slowly building upon it. I suggest starting with how to load an audio file into the buffer (take a look at the looping audio tutorial) as once that is complete it is just a case of using the tutorials again to create and handle the MIDI data.

How do you open a windows application as a source for OpenCV?

I would like to recognize objects of windows applications, mainly computer games. I would like to accomplish this by opening the window in OpenCV and applying all kinds of effects to the game application under execution and recognize objects such as UI elements, messages and even characters that are on the screen.
Since OpenCV only allows video and webcam as input, is there a way to open a running application as a source for OpenCV?
There maybe some testing applications used in game development that use similar methods for testing, but I couldn't find any.
I also don't know the right terms that that are used when discussing the recognition of virtual objects of a computer program or computer game, but that is exactly what I would like to do.
I tried to look up forums, articles or anything written about this, but found nothing. Any help would be appreciated.
I used OpenCV for a year and I am not sure if you can pass the running application to it.
As an alternative, you might like to have a function which gives you the current screenshot of the desktop. So you can get it and pass to OpenCV.
This way you can periodically do screenshots and use your recognition.
If you are working under Windows you might need this discussion.
Hope this will somehow help you.
I've been trying all method using desktop as source in opencv few months ago as my experiment project and i success, but there's a trail inside the windows, as maybe the speed or processor depends on it. It using your own function to use desktop as source not from opencv libraries. And from there i continued custom things and got stuck in some bug that has something from memory, as it use lots of memory. I did post on stackoverflow. Hope this information helps.

'Field Scraping' in Windows

I want to develop an auditing application for certain Windows applications. I want to grab the text from MessageBoxes, Windows, Forms, Selections etc and ideally I would like to program in C++.
I've looked into Windows UI Automation as a possible solution, but am slightly put off as it says it will need to know parts of the underlying data structures which I can't get at. Alternatively, I've looked around and Neo's SafeKeys says that it protects against 'field scraping', but upon searching for it I can't find any information on how it is done. Could someone with experience with this please enlighten me? I'm aware you can scrape websites and the like, but I wish to scrape applications instead.
Any help would be greatly appreciated.
Look into using the accessibility layer, MSAA
I presume they are talking about doing a lot of EnumChildWindows() and GetWindowText().
A simple way of doing this without going near any data structures is to use Abbyy's OCR SDK http://www.abbyy.com/ocr_sdk/ to emulate in an application what their amazing Screenshot reader does. http://www.abbyy.com/screenshot_reader/ . With this technology, nothing you can read on the screen is safe from being captured as text, though it makes a mess of the odd character occasionally.

Video encoding services

I need to be able to allow users to upload a wide variety of video files in various formats then clean them up and make them kosher for delivery to a dedicated content handler.
I've tried ffmpeg onsite but it has some serious flaws in regards to h.264.
Then I tried flixcloud.com which has a very good interface, api, and was looking like the perfect solution except it doesn't provide the video frame rate correctly.
Moving on I tried Ankoder.com and it does work, but unfortunately it's API is somewhat of a mess and has some quirks that are proving to be difficult to code around.
What other services are out there, will only accept answer from someone who has used a video transcoding service.
Update:
Just started looking at http://www.encoding.com/ - seems interesting.
I have worked with a number of transcoding services in the past and have found flaws with just about all of them. For the last 3 projects I have been involved with that involved media encoding I have used Expression Encoder, with great results. The application its self is a pleasure to use and simple to achieve the results needed, and the SDK is one of the best out there. Microsoft have definatly done a great job.

C++ OpenGL application as a web service

We have created an OpenGL application in C++ which visualizes some physical simulations. The basic application is contained within a DLL which is used by a simple GUI. It currently runs on a desktop PC, but we have the idea to turn it into a web service.
Since the simulations require dedicated hardware, the idea is that a user, through his/her browser can interact with our application as a service and this service then renders the result to an image (jpg or anything appropriate) that can then be displayed/updated in the browser.
My question:
How can I "easily" turn a c++ application as described into a web-service that runs on some server so that I can approach it over the web? What kind of technologies/APIs should I look at? And are there any real-life examples that tackle a similar problem?
This is possible, but one major difficulty you'll have is trying to use OpenGL from a web service. You'll need to port this to do 100% offscreen rendering and work without a windowing context. That would be my first step, and it's not always a trivial one.
Also, it is very difficult to maintain and manage your opengl contexts from a webservice correctly, and the overhead involved can be quite painful. Depending on the number and types of renderings, you may run into some issues there.
If you need it to scale up well CGI would probably be kind of slow & hacky.
There are some C++ web frameworks out there, see this question.
As far as the OpenGL goes, you'll probably need to use the frame buffer extension as Jay said.
You could then render your image to a texture, and use use glGetTexImage() to grab the pixel data. From there just save into what ever image format you want with the accompanying library.
I had a similar project/question, that although it wasn't a web service, it required OpenGL rendering in a windows service. I had tons of problems getting it to work on Vista, although eventually it did work on XP with regular OpenGL.
I finally tried using Mesa, which I built to work as a private DLL for my service. It was a great decision because I could now actually step into the OpenGL calls and see where things were going wrong. It ran fine in software mode under the service, and while it wasn't hardware accelerated, it worked very well.
If your user-interaction needs are simple, I'd just look at CGI. It should be pretty easy to understand.
As far as getting the output of the OpenGL program, I'd take a look at the framebuffer extension. That should make it easy for you to render into memory, which could then be fed into a JPEG compressor.
I guess you already have access to some webserver, e.g. Apache or similar. In that case you could try out CppServ.
You just need to configure your webserver so it can communicate with CppServ. I'd then propose that you develop a servlet (check the documentation on the site) which in turn communicates with your already existing dll. Since the dll knows everything about OpenGL it should be no problem to create jpeg images etc.
How about using something like Flex to create a web-enabled 'control interface', with a server backend that streams the opengl rendering as video? Basically, you are redirecting keyboard/mouse input via the Flex app, and using it to display 'realtime' 3D activity using a standard movie component.
The devil's in the details, of course....
You can try to use O3D API from google and don't do anysort of service, it would be much more simple.
This answer might sound very basic and elementary, have you tried this approach
Send the vector data from the server to the client or vice versa (just co-ordinates and so on)
Render it on the client side.
This means that the server is only doing the calculations and the numbers are passed to and fro.
I agree that is not a trivial method of trying to vectorize every object/model and texture, but is very fast since instead of heavy graphical images going across, only vector data is being sent across.