Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem recording webcam with FFMPEG and QProcess

Problem recording webcam with FFMPEG and QProcess

Scheduled Pinned Locked Moved Unsolved General and Desktop
fmpegqprocesswebca
9 Posts 5 Posters 1.3k Views
  • 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 Offline
    G Offline
    Guigiidre
    wrote on last edited by aha_1980
    #1

    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
    0
    • mranger90M Offline
      mranger90M Offline
      mranger90
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Does it work on the command line without Qt?

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Guigiidre
          wrote on last edited by
          #4

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

          jsulmJ 1 Reply Last reply
          0
          • G Guigiidre

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

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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
            1
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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
              2
              • G Offline
                G Offline
                Guigiidre
                wrote on last edited by
                #7

                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)

                jsulmJ 1 Reply Last reply
                0
                • G Guigiidre

                  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)

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @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
                  0
                  • SGaistS SGaist

                    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.

                    G Offline
                    G Offline
                    Guigiidre
                    wrote on last edited by
                    #9

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

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved