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. Calculate progress percentage of a process (which calls ffmpeg) (without progressbar)

Calculate progress percentage of a process (which calls ffmpeg) (without progressbar)

Scheduled Pinned Locked Moved General and Desktop
progressprocesspercentageencodingffmpeg
4 Posts 3 Posters 5.8k 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.
  • O Offline
    O Offline
    Opa114
    wrote on last edited by
    #1

    Hi there,

    i my application i call ffmpeg.exe via process->start(). With this call ffmpeg starts encoding an audio file in the background. Now i want to calculate the percentage of the progress of the encoding and show it to the user in my GUI in a Label.
    Should be look like "encoding ... 45%" and then it should everytime refresh the percentage.

    And i don't want to use a progressbar. Only if i could disable the green indicator and show only the percentage.

    thanks!

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      I don't think you can calculate it since ffmpeg is encoding, not your application. You should check which parameters ffmpeg is providing. Maybe it can output the current status as percentage. In this case you can parse the standard output of the ffmpeg process to get the current percentage.

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

      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        There is a switch to ffmpeg that makes it output a line looking like "frame=XXX ..." while it processes. I don't recall the param name. -verbose or -info or something like that. Check the manual.
        Then you would connect to the readyReadStandardOutput signal of QProcess, read the output and parse it for current frame value. Having a total frame count and current frame you can calculate the percentage.

        O 1 Reply Last reply
        0
        • Chris KawaC Chris Kawa

          There is a switch to ffmpeg that makes it output a line looking like "frame=XXX ..." while it processes. I don't recall the param name. -verbose or -info or something like that. Check the manual.
          Then you would connect to the readyReadStandardOutput signal of QProcess, read the output and parse it for current frame value. Having a total frame count and current frame you can calculate the percentage.

          O Offline
          O Offline
          Opa114
          wrote on last edited by
          #4

          @Chris-Kawa thanks for the hint. Works now :)

          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