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. FFmpeg output string
Forum Updated to NodeBB v4.3 + New Features

FFmpeg output string

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 811 Views 3 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.
  • S Offline
    S Offline
    satyanarayana143
    wrote on 2 May 2019, 11:07 last edited by
    #1

    frame= 91 fps= 45 q=30.0 size= 25kB time=00:00:02.17 bitrate= 94.0kbits/s dup=39 drop=12 this is ffmpeg output i want to get only fps value how can i get.

    P 1 Reply Last reply 2 May 2019, 12:31
    0
    • S satyanarayana143
      2 May 2019, 11:07

      frame= 91 fps= 45 q=30.0 size= 25kB time=00:00:02.17 bitrate= 94.0kbits/s dup=39 drop=12 this is ffmpeg output i want to get only fps value how can i get.

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 2 May 2019, 12:31 last edited by
      #2

      @satyanarayana143 the description of your issue is not very detailed.

      So assuming you'll be running ffmpeg from Qt with the QProcess class, you may want to read the output when the QProcess::readyReadStandardOutput() signal is emitted.

      Then you can use a QRegularExpression object to extract the captured string for fps= (i.e. 45)

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • K Offline
        K Offline
        Kent-Dorfman
        wrote on 3 May 2019, 00:33 last edited by
        #3

        what Pablo said...but it's more complicated than that...Hint...file processing status lines are not newline terminated in ffmpeg. I use ffmpeg A LOT.

        P 1 Reply Last reply 3 May 2019, 12:01
        2
        • K Kent-Dorfman
          3 May 2019, 00:33

          what Pablo said...but it's more complicated than that...Hint...file processing status lines are not newline terminated in ffmpeg. I use ffmpeg A LOT.

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 3 May 2019, 12:01 last edited by
          #4

          @Kent-Dorfman thank you for sharing your experience. Since I haven't used ffmpeg this way I was talking from a general point of view of the QProcess class.

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          K 1 Reply Last reply 3 May 2019, 22:38
          2
          • S Offline
            S Offline
            satyanarayana143
            wrote on 3 May 2019, 12:24 last edited by
            #5

            i am using ffmpeg with Qporcess and from that output i want to extract fps= value

            1 Reply Last reply
            0
            • P Pablo J. Rogina
              3 May 2019, 12:01

              @Kent-Dorfman thank you for sharing your experience. Since I haven't used ffmpeg this way I was talking from a general point of view of the QProcess class.

              K Offline
              K Offline
              Kent-Dorfman
              wrote on 3 May 2019, 22:38 last edited by
              #6

              @Pablo-J.-Rogina your methodology is correct. The only gotcha is that line based REs won't work since the output lines are not newline terminated. The RE needs to be smart enough to deal with that...or even partial output lines like " fp" being in one pattern search string and "s=???" in the next so " fps=???" isn't seen in one text block at all, but in two consecutive blocks.

              1 Reply Last reply
              1
              • S Offline
                S Offline
                Stead23
                wrote on 16 May 2019, 05:48 last edited by Stead23
                #7

                ffmpeg is a very fast video and audio converter that can also grab from a live audio/video
                source. It can also convert between arbitrary sample rates and resize video on the fly
                with a high quality polyphase filter vivavideomaker

                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