Problem recording webcam with FFMPEG and QProcess
-
Hi everybody, I need some help for a very strange problem:
I try to reccord a video with my webcam and FFMPEG, when I use the Command line everything is OK:
ffmpeg.exe -y -f dshow -i video="Logitech HD Webcam C270" out.avi
but when I try to do the same thing with QProcess, it does not work:
QString program="C:/FFmpeg/bin/ffmpeg.exe"; mProcess->setReadChannel(QProcess::StandardOutput); mProcess->setProcessChannelMode(QProcess::MergedChannels); QStringList list; list<<"-y"<<"-f"<<"dshow"<<"-i"<<"video=Logitech HD Webcam C270"<<"output.avi"; mProcess->start(program,list);
I ve got the following error:
"Stream mapping:\r\n Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))\r\nPress [q] to stop, [?] for help\r\nvideo=Logitech HD Webcam C270: I/O error\r\n"
I use Qt 5.11.3 with mingw
Thank you in avance for your help!
-
Does it work on the command line without Qt?
-
@Christian-Ehrlicher yes it works with the command line and furthermore this code used to work properly before...
So I suspect the virus of defender of Windows 10 to annoy me... -
@Guigiidre said in Problem recording webcam with FFMPEG and QProcess:
So I suspect the virus of defender of Windows 10 to annoy me
Disable it and try again
-
Hi,
@Guigiidre said in Problem recording webcam with FFMPEG and QProcess:
video=Logitech HD Webcam C270
Try passing
video=\"Logitech HD Webcam C270\”
to QProcess. -
Yes I disabled the virus defender end it worked well....
But on another laptop with the last version of Windows I had another type of problem.
I have an error of the type : QProcess::FailedToStart.
I Checked that the exe existed so I suspect that the last version of Windows is incompatible with the QProcess class (Qt 5.11.3) -
@Guigiidre You should connect the error signals to a slot and check what happens. QProcess should work on latest Windows as well, there is probably something else on that machine.