Key callbacks with gstreamer - c++

I was wondering if anyone has any idea of how to do key callbacks with gstreamer. I've looked, and can't find anything. I'm trying to do the equivalent of cvWaitKey. I do have OpenCV in my program and it can interact with Gstreamer. However, Gstreamer is outputting the video to the screen thus cvWaitKey doesn't work.
Thanks!

This has nothing to do with GStreamer. Pick a UI toolkit like Gtk+ or Qt and use the functionality there.

Related

Recording desktop using Qt multimedia

I'm trying to record microphones, cameras and monitors using Qt's multimedia module. But I couldn't find anything about screen recording in documentation. So it seemed I'd to do it by myself.
I've searched about that, found that answer:
How to display desktop in windows form using Qt?
Seems I've to use FFMPEG to merge these taken screenshots into mp4 file, also it doesn't seem an efficient way. I want to show real time recording output with QVideoWidget. I was going to use QMediaCaptureSession, QMediaRecorder. But they only work with camera. Is there any way to record desktop screen with Qt's multimedia module?
P.S: Please correct me, if my question is wrong

Qt5 extracting audio from video

I have a task: user chooses a video file, I need to get an audio track from it and give an opportunity to play it with equalizer and then save this audio in mp3.
I found an example of media player in Qt. Playing video with Qt is very easy as the example has shown so I'd like to realize this task only with Qt API. The only way I know to get audio track from video is to use libAV or similar libraries. Is there an opportunity to get audio from video with Qt API? Also I haven't found the way to save an audio in a specific format with Qt. Is it possible?
Thanks a lot.

How to retrieve QML camera feed and send to C++ backend

I am trying different implementations of how to achieve further processing from the QML camera, I need to pass on the feed to the C++ end so it can then be converted to a cv::Mat image and passed to a function for processing. I have tried setting a QCamera from the C++ end and starting it on a button click but it seems Qt cannot create two instances of the same camera. I have also tried an open CV method but to no avail. What is the best way to do this?
This is a not a fix but a workaround. I used an OpenCv plugin for the camera and made it visible to my QML using qmlRegisterType. I could then easily send the frames from the backend to my other class for processing. For anyone looking to do this I used this plugin: https://github.com/rferrazz/CvCamView
Qt QML Camera to C++ QImage on Android
I just answered this question, I think you were having the same issue.
The basic Idea here is to get the instance of QML camera, access its QMediaObject point and probe it with QVideoProbe. There are other solutions, but AFAIK they arent really easy or fast in Android platforms, but if thats not your case, you probavly should try QAbstractVideoFilter alongside QVideoFilterRunnable classes which were developed specially for post processing qml video feed.
Note that QAbstractVideoFilter and QVideoFilterRunnable are Qt 5.5 classes only.

Modify audio output stream of QMediaPlayer

I'm trying to port an audio player from Qt4 to Qt5, and from Phonon to QtMultimedia.
Everything works fine with a QMediaPlayer, except that I can't find any way to modify the audio stream between the output of QMediaPlayer and the system sound.
I would like to apply a post-processing effect to the audio.
Any way to do this? Maybe by sub-classing QMediaPlayer? I've checked the QAudioOutput and QAudioDecoder classes but I would have to implement a lot of things to get the same behaviour as QMediaPlayer.
Thanks!

Can't get supported resolutions of the camera for image capturing using QCamera in Qt 5.0.2 (Linux)

I am trying to write a simple program for taking photos from the webcam using Qt.
There is an example project in the Qt Creator, where QCamera is used to take photos and record video. But it is not working the right way. I can't get supported resolutions of the camera using method QCameraImageCapture::supportedResolutions(). A null QList object is returned, and camera is always capturing images with 640x480 resolutions.
OS is Ubuntu 11.04. Same problem occurs on Windows XP.
Can anyone help me?
I have answered nearly the same question.
https://stackoverflow.com/a/21140214/2452081
In short:
Portable solution can be gstreamer, but if Windows DirectShow solution is enough for you download my code from here