How to create an application for receiving a video stream from a (WiFi) camera? - c++

I am kind of a beginner in programming, learning it in school, so I really don't know much.
But I want to make a program for PC and maybe app for iPhone/Android that receives a video-stream from a camera and displays it, nothing more.
How do I do this in C++/C# in Visual Studio?
Camera -> WiFi -> PC/Phone

A good library for working with images/video in c++ is OpenCV. I would recommend taking a look at their examples.
http://docs.opencv.org/3.0.0/index.html
Check out the highgui module!

You should first check for cameras that come with a programming API so that it is easy to write programs to communicate with it.
If the camera drivers can make it communicate with standard chat apps like Sykpe, you should be able to use C++ and OpenCV to capture a stream from it. But you can choose the language and tools according to what you want to do with the video stream.

Related

Video capture from USB webcam using C++ and USB library

I just want to know if its possible to write a program in c++ on Windows which can grab frames of video from a web cam by making use of a USB library like libusb.
I have looked at http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/ . They define a basic sequence of the steps one must follow while using libusb to work with usb devices. To summarize:
1) Find and connect to the USB device
2) Send and receive data
3) Release the USB device
libusb handles part 1) and 3). So, the question comes down to part 2). I wonder if it is possible/feasible to send commands to the camera and receive data via USB by adhering to some type of standard (UVC 1.5 for example). I'm thinking that not knowing some proprietary, device specific information might be a problem though.
If this is possible but super hard, I would appreciate any insights into what the biggest challenge would be.
The hardware I have in mind are low-end logitech USB cameras.
Also, I am fully aware that OpenCV, Video for Windows (VFW), DirectShow, and FFMPEG can do web-cam video capture. I am interested in this project as a learning experience.
Thanks in advance!
Since you're obviously a bit inexperienced, I'll give an answer in high-level terms.
To talk to someone, or something, you need to speak a common language, or have a translator. Now, there are many different USB devices, and they speak many different languages, but OpenCV can act as a translator for many of those. If you don't want to use that, you will need to find another translator, or possibly learn to speak the camera's native language.
The first option (another translator) is no option for you, because you don't want a translator.
The second option is something we can't help you with, because we don't know which camera you have.

Cross-platform real-time MP3 recorder

I have an SDL app, that works under Linux, Mac and Windows. It's something like a media player, and can play audio just fine. I'd like to add audio recording feature to it, but I'd like to encode it in real time to MP3. Can anyone point me to an example how can I use LibLame, LibSoX, or possibly some other library to achieve this?
-- OR --
I'm also willing to rewrite the whole thing into something easier to manage than C++. I've looked at Kivy and Love2d which uses Lua, but audio recording it's still an issue there. If you know ANY toolkit that:
is cross platform
helps you build GUI using your own graphics
can play AND record mp3 files
ideally can operate under framebuffer (no X Window server under Linux)
Please let me know. I'm looking at Python + Pygame + Pyaudio, it can do graphics and output sound, but still can't record MP3's, only WAV's. Any way to integrate LAME into this to make it work?
FMOD can play practically anything, and handle audio input as well, although I don't know if integrating an entire audio engine is a bit overkill for your project.
It's free for non-commercial usage.
As for encoding, LAME is definitely the de-facto choice for MP3.
There's a very simple library called lame_enc.dll which wraps LAME's capabilities in a simple API. It's Windows only, but you could look at it's source for a good reference on how to use LAME.

how to use c++ to do data acquisition from frame grabber

We have an "MC1362 Camera" and an "Inspecta-5" frame grabber in our lab. There is program in LABVIEW11 which gets the data from a frame grabber, however as the Labview is slow my supervisor has told me to write a program in c++ to get the data from the frame grabber. I have no idea how to write a c++ program to connect to a frame grabber and do the data acquisition. I know how to write software in c++, but have never tried programming to connect to hardware and read data from it. Is there any specific library or framework which can help me, or any tutorial?
Please, if anybody knows, help me in this matter.
Update:just to add, we are doing medical image analysis, and a laser illuminate a subject, so camera will take pictures and pass it to the computer. I need to grab the pictures and analysis them.
You basically have a couple of options,
1 see if there is an SDK for the grabber card, if there is this is usually easier then option 2 but is of course restricted to work with that grabber or familly of grabber cards, we do it this way with the eurysys grabber cards.
2 assuming you are running on a windows platform, implement a DirectShow filtergraph and write your own ouput filter to get the data, the SDK for DirectShow is quiet good and has many examples. This approach is far more flexible and you should be able to use a number of grabber but its also alot more complex, we do it this way for USB / some other inbuilt grabbers.
Our software is done in Delphi 7 but its just importing DLLs, for C++ should be no problem and most SDK's are written round C++ anyway.
I know its not much but its a place to start.
Update
Just done a quick Google search and there is an SDK for that Grabber and on first looks its seams fairly straight forward.

Audio Signal Processing GUI developement using Qt, How to?

I have some basic effect algorithms (i.e chrous, LP filtering..) which I would like to build a GUI application to be able to use these algorithms.
For example I want to be able to open an audio file, process the audio file in some way with my algorithms and playback the processed file.
Later on I would like to, if possible be able to see the waveforms of the original file and the processed file in the GUI application. This is my objective now.
In the future I want to be able to create a user interface through which users can be able to use my own audio processing algorithms on files of their own.
Is it possible to design such a GUI with the Qt programming framework? If so, could someone point me in the right direction to get started? Right now I have the Qt SDK 1.1 beta running on Windows 7 OS and also using Qt creator. I would really appreciate some guidance.
Qt is a very powerful application framework, but do not expect any extra help with DSP tasks from it. It contains API for some basic and common tasks, like playing an audio/video file, working with audio devices, creating audio effects (search QAudio and Phonon in the Qt's help) etc. You can use some ready-to-use widgets and create your own multimedia player in a few moments.
But in the DSP you are -mostly, on your own. There is, for instance, only a limited audio file format support, so if you want to work with more formats than .wav and .aiff, use some specialized library. I recommend libsndfile (http://www.mega-nerd.com/libsndfile/) which is most powerful free audio file library available. And if you plan your effects to be more universal, use rather VST technology by Steinberg - today's audio plug-in standard, but it is relatively complicated, not suitable for beginners.
There is no built-in widget which can show a waveform, you have to create it yourself, but it is not much complicated. Qt has a really cool drawing functions, brushes, texts, gradients, transformations, antialiasing, even OpenGL wrapper - everything ready and very simple to use.
So the answer is definitely yes. I use Qt in my multimedia applications for three years and now I can't see how I could live without it (using VST GUI and Windows APIs before).
Sure its possible, QT is a framework for writing applications, you can write any application you want using it, you'll probably end up needing to write some custom controls. As an example, here's an Open source QT based application that does pretty much everything you are talking about and much more:
http://qtractor.sourceforge.net/qtractor-index.html

Audio Recording in C++

I was wondering, what was a good cross-platform utility for doing audio recording/ playback/ seeking in C++? I was thinking going the route of ALUT (OpenAL), but is there a better way? If not, do you guys know of any good tutorials/sample code for ALUT?
SFML and SDL have support for playing many different sound formats and are cross plattform. Neither of them provides you with means for recording audio. Then there is PortAudio which looks pretty active but I do have no experience with it at all.
Qt actually has some audio functions since version 4.6.
Didn't try the input for myself, but if you scroll down a bit in the Qt-Documentation
there is a basic example.
For Input you can work a layer higher with Qt. Here is an example.