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. Getting ffmpeg output with QProccess

Getting ffmpeg output with QProccess

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 2 Posters 1.7k Views 1 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    Remove the channel handling at the end of the command.
    Also the proper way to pass parameters is to build a QStringList with each element separately.

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

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rktech
      wrote on last edited by rktech
      #3

      @SGaist

      params << " -i"<<" S01E01.mp4";
      

      Still nothing

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        Is that video file located in the same folder as the executable ?
        You should also check whether the command failed and its standard erreur channel.

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

        R 1 Reply Last reply
        0
        • SGaistS SGaist

          Is that video file located in the same folder as the executable ?
          You should also check whether the command failed and its standard erreur channel.

          R Offline
          R Offline
          rktech
          wrote on last edited by
          #5

          @SGaist

          Is that video file located in the same folder as the executable ?
          

          Yes, it is like this
          bea25094-c0a0-43dc-9ce1-b5c9bb04b6e2-image.png

          You should also check whether the command failed and its standard erreur channel.
          
          

          How?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            QProcess::readStandardError
            QProcess:exitCode
            QProcess::exitStatus

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

            R 1 Reply Last reply
            1
            • SGaistS SGaist

              QProcess::readStandardError
              QProcess:exitCode
              QProcess::exitStatus

              R Offline
              R Offline
              rktech
              wrote on last edited by
              #7

              @SGaist How to correctly use readStandartError? Print in qDebug?

              R SGaistS 2 Replies Last reply
              0
              • R rktech

                @SGaist How to correctly use readStandartError? Print in qDebug?

                R Offline
                R Offline
                rktech
                wrote on last edited by
                #8

                @rktech exitStatus: QProcess::NormalExit, exitCode: 1

                R 1 Reply Last reply
                0
                • R rktech

                  @SGaist How to correctly use readStandartError? Print in qDebug?

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @rktech said in Getting ffmpeg output with QProccess:

                  @SGaist How to correctly use readStandartError? Print in qDebug?

                  That's one way yes.

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

                  1 Reply Last reply
                  0
                  • R rktech

                    @rktech exitStatus: QProcess::NormalExit, exitCode: 1

                    R Offline
                    R Offline
                    rktech
                    wrote on last edited by
                    #10

                    @rktech readStandartError
                    ffmpeg version git-2020-04-24-a501947 Copyright (c) 2000-2020 the FFmpeg developers\r\n built with gcc 9.3.1 (GCC) 20200328\r\n configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf\r\n libavutil 56. 42.102 / 56. 42.102\r\n libavcodec 58. 81.100 / 58. 81.100\r\n libavformat 58. 42.101 / 58. 42.101\r\n libavdevice 58. 9.103 / 58. 9.103\r\n libavfilter 7. 79.100 / 7. 79.100\r\n libswscale 5. 6.101 / 5. 6.101\r\n libswresample 3. 6.100 / 3. 6.100\r\n libpostproc 55. 6.100 / 55. 6.100\r\n[NULL @ 0000024fd452b800] Unable to find a suitable output format for ' -i'\r\n -i: Invalid argument\r\n

                    I would drop error, but same as in my first post.

                    R 1 Reply Last reply
                    0
                    • R rktech

                      @rktech readStandartError
                      ffmpeg version git-2020-04-24-a501947 Copyright (c) 2000-2020 the FFmpeg developers\r\n built with gcc 9.3.1 (GCC) 20200328\r\n configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf\r\n libavutil 56. 42.102 / 56. 42.102\r\n libavcodec 58. 81.100 / 58. 81.100\r\n libavformat 58. 42.101 / 58. 42.101\r\n libavdevice 58. 9.103 / 58. 9.103\r\n libavfilter 7. 79.100 / 7. 79.100\r\n libswscale 5. 6.101 / 5. 6.101\r\n libswresample 3. 6.100 / 3. 6.100\r\n libpostproc 55. 6.100 / 55. 6.100\r\n[NULL @ 0000024fd452b800] Unable to find a suitable output format for ' -i'\r\n -i: Invalid argument\r\n

                      I would drop error, but same as in my first post.

                      R Offline
                      R Offline
                      rktech
                      wrote on last edited by
                      #11

                      @rktech That was caused by splitting parametrs into list, but the problem with wrong error continues:
                      "ffmpeg version git-2020-04-24-a501947 Copyright (c) 2000-2020 the FFmpeg developers\r\n built with gcc 9.3.1 (GCC) 20200328\r\n configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf\r\n libavutil 56. 42.102 / 56. 42.102\r\n libavcodec 58. 81.100 / 58. 81.100\r\n libavformat 58. 42.101 / 58. 42.101\r\n libavdevice 58. 9.103 / 58. 9.103\r\n libavfilter 7. 79.100 / 7. 79.100\r\n libswscale 5. 6.101 / 5. 6.101\r\n libswresample 3. 6.100 / 3. 6.100\r\n libpostproc 55. 6.100 / 55. 6.100\r\nOutput #0, mp4, to ' -i S01E01.mp4':\r\nOutput file #0 does not contain any stream\r\n"

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        Try removing the spaces in the parameter list.

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

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          rktech
                          wrote on last edited by
                          #13

                          Done like this:

                          params << "-i S01E01.mp4 2>&1";
                          

                          Getting this error:
                          "ffmpeg version git-2020-04-24-a501947 Copyright (c) 2000-2020 the FFmpeg developers\r\n built with gcc 9.3.1 (GCC) 20200328\r\n configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf\r\n libavutil 56. 42.102 / 56. 42.102\r\n libavcodec 58. 81.100 / 58. 81.100\r\n libavformat 58. 42.101 / 58. 42.101\r\n libavdevice 58. 9.103 / 58. 9.103\r\n libavfilter 7. 79.100 / 7. 79.100\r\n libswscale 5. 6.101 / 5. 6.101\r\n libswresample 3. 6.100 / 3. 6.100\r\n libpostproc 55. 6.100 / 55. 6.100\r\nUnrecognized option 'i S01E01.mp4 2>&1'.\r\nError splitting the argument list: Option not found\r\n"

                          SGaistS 1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            rktech
                            wrote on last edited by
                            #14

                            The

                            2>&1
                            

                            Is not the problem, it drops same error without it.

                            1 Reply Last reply
                            0
                            • R rktech

                              Done like this:

                              params << "-i S01E01.mp4 2>&1";
                              

                              Getting this error:
                              "ffmpeg version git-2020-04-24-a501947 Copyright (c) 2000-2020 the FFmpeg developers\r\n built with gcc 9.3.1 (GCC) 20200328\r\n configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf\r\n libavutil 56. 42.102 / 56. 42.102\r\n libavcodec 58. 81.100 / 58. 81.100\r\n libavformat 58. 42.101 / 58. 42.101\r\n libavdevice 58. 9.103 / 58. 9.103\r\n libavfilter 7. 79.100 / 7. 79.100\r\n libswscale 5. 6.101 / 5. 6.101\r\n libswresample 3. 6.100 / 3. 6.100\r\n libpostproc 55. 6.100 / 55. 6.100\r\nUnrecognized option 'i S01E01.mp4 2>&1'.\r\nError splitting the argument list: Option not found\r\n"

                              SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #15

                              params << "-i" << "S01E01.mp4"

                              In any case, "2>&1" is command prompt specific, so it does not make sense to put it there and might even interfere.

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

                              R 1 Reply Last reply
                              1
                              • SGaistS SGaist

                                params << "-i" << "S01E01.mp4"

                                In any case, "2>&1" is command prompt specific, so it does not make sense to put it there and might even interfere.

                                R Offline
                                R Offline
                                rktech
                                wrote on last edited by
                                #16

                                @SGaist Thanks, now it works

                                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