kibsoft / QtMEL

Qt Media Encoding Library
GNU Lesser General Public License v2.1
67 stars 16 forks source link

Having the image grabber running even with the record off and don't record audio #26

Open Sol1du2 opened 9 years ago

Sol1du2 commented 9 years ago

Hello.

First of all thanks for this piece of code. I'm creating a program in which I need my users to see the video feed before they hit the record button (basically the video feed is always on, even if the record is off, like a video camera). There seems to be an issue with this and, as far as I can tell, it's because when the record starts it also starts the camera grabber and if it is already "rolling" the program crashes. I would think a small verification should solve this problem.

My second issue is with the audio recorder. I don't need to record audio but it seems that if I don't load an audio grabber the program crashes. When I load a grabber the code works fine, but it seems a bit pointless and a waste of memory if I don't intend to use it. I would also guess a small check for this would be enough?

Thanks for your time and reply.

kibsoft commented 9 years ago

Hello

Which ffmpeg version do you use? I think those crashes may happen because of different version than I used. Another possible reason - videocodec/audiocodec. Which codecs do you use?

To be honest FFmpeg (libav) is very unstable and crashes may happen in any time. Because of this I don't maintain this project anymore.

Sol1du2 commented 9 years ago

I'm using the version you have available for download, as I couldn't make it work with the newest one. So it is supposed to work without the audio grabber and even if I start the camera earlier? Because these two actions make it crash.

Is there another stable library that you would recommend? Since QT for windows is not recording video right now.

Marware commented 9 years ago

Hi,

First of all, Thanks @kibsoft for QtMEL, really helpful!

To @Sol1du2 I'm trying to figure a workaround for this issue, I'll keep you updated, if you managed to solve it, please make it available for the humanity :)

Sol1du2 commented 9 years ago

Hello.

I ended up solving the issue I believe. The audio was my fault, since I was not setting it to record video only and had audio + video. The problem with having the camera running before recording I solved by adding a check on the startGrabbers function, on record.cpp. Basically I verified if the m_imageGrabber was already on the ActiveState and if it was I wouldn't start it.

I'm not sure if this is the best solution though, because as kibsoft said the library is a bit unstable and I ended up changing to openCV only, so I didn't test it thoroughly. Let me know how it goes with you though. And in case you think it's stable enough (or find a better solution) I'd love to switch to it again, since now I need to record audio with my project.

Kind regards, João.

Marware commented 9 years ago

I turned to qt-vlc

Sol1du2 commented 9 years ago

Hey, I was checking that, seems like a nice alternative. Does it also support camera? Or only video playback. I can't seem to find camera support.