Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Problem recording webcam with FFMPEG and QProcess

    General and Desktop
    fmpeg qprocess webca
    5
    9
    845
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Guigiidre last edited by aha_1980

      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!

      1 Reply Last reply Reply Quote 0
      • mranger90
        mranger90 last edited by

        did you try embedding quotes around "Logitech HD Webcam C270" in the argument list ?

        1 Reply Last reply Reply Quote 0
        • Christian Ehrlicher
          Christian Ehrlicher Lifetime Qt Champion last edited by

          Does it work on the command line without Qt?

          Qt has to stay free or it will die.

          1 Reply Last reply Reply Quote 0
          • G
            Guigiidre last edited by

            @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...

            jsulm 1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @Guigiidre last edited by

              @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

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 1
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                G 1 Reply Last reply Reply Quote 2
                • G
                  Guigiidre last edited by

                  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)

                  jsulm 1 Reply Last reply Reply Quote 0
                  • jsulm
                    jsulm Lifetime Qt Champion @Guigiidre last edited by

                    @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.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 0
                    • G
                      Guigiidre @SGaist last edited by

                      @jsulm I did :-) but I have no more information...
                      Anyway I will stop using the QProcess class to reccord video with my webcam, it seems too tricky, instead
                      I think I will use a library like LibVLC to do it...

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post