How to reduce CPU usage when it reaches 100% while converting video using ffmpeg The 2019...

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Intergalactic human space ship encounters another ship, character gets shunted off beyond known universe, reality starts collapsing

Deal with toxic manager when you can't quit

What can I do to 'burn' a journal?

Fixing different display colors within string

Make it rain characters

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

Is there a writing software that you can sort scenes like slides in PowerPoint?

Can the DM override racial traits?

Was credit for the black hole image misappropriated?

Identify 80s or 90s comics with ripped creatures (not dwarves)

Solving overdetermined system by QR decomposition

"... to apply for a visa" or "... and applied for a visa"?

Student Loan from years ago pops up and is taking my salary

Why doesn't shell automatically fix "useless use of cat"?

Why not take a picture of a closer black hole?

Are spiders unable to hurt humans, especially very small spiders?

Does Parliament hold absolute power in the UK?

Working through the single responsibility principle (SRP) in Python when calls are expensive

How did passengers keep warm on sail ships?

How to determine omitted units in a publication

Can each chord in a progression create its own key?

Why can't wing-mounted spoilers be used to steepen approaches?

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?



How to reduce CPU usage when it reaches 100% while converting video using ffmpeg



The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraFFmpeg command converting M4V to FLV; video streaming is very slowhow to bring the cpu usage down when FFMPEG is making multi-bitrate videosForce ffmpeg to use 100% of CPUVideo player high CPU usageConverting video int Webm using ffmpeg, file sizeFFmpeg low CPU usageConverting images to video with FFmpeg on-the-flyFFMPEG copy hls high cpu usageHow do I specify ffmpeg video directory?Video encoded in FFmpeg using the libx264 codec won’t play back as expected on mobile devices





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















We are use ffmpeg for convert video to a specific form. The server is reaching 100% CPU usage, so my site is going down. That means the ffmpeg process has a strong effect on my main server.












share|improve this question









New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Are you running ffmpeg on the server itself, or does the server only holds the files?

    – LPChip
    yesterday











  • If you show your actual ffmpeg command and the complete log from the command we may be able to make more suggestions.

    – llogan
    yesterday


















0















We are use ffmpeg for convert video to a specific form. The server is reaching 100% CPU usage, so my site is going down. That means the ffmpeg process has a strong effect on my main server.












share|improve this question









New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Are you running ffmpeg on the server itself, or does the server only holds the files?

    – LPChip
    yesterday











  • If you show your actual ffmpeg command and the complete log from the command we may be able to make more suggestions.

    – llogan
    yesterday














0












0








0








We are use ffmpeg for convert video to a specific form. The server is reaching 100% CPU usage, so my site is going down. That means the ffmpeg process has a strong effect on my main server.












share|improve this question









New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












We are use ffmpeg for convert video to a specific form. The server is reaching 100% CPU usage, so my site is going down. That means the ffmpeg process has a strong effect on my main server.









ffmpeg






share|improve this question









New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









slhck

163k47451476




163k47451476






New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Jignesh PrajapatiJignesh Prajapati

1




1




New contributor




Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Jignesh Prajapati is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    Are you running ffmpeg on the server itself, or does the server only holds the files?

    – LPChip
    yesterday











  • If you show your actual ffmpeg command and the complete log from the command we may be able to make more suggestions.

    – llogan
    yesterday














  • 1





    Are you running ffmpeg on the server itself, or does the server only holds the files?

    – LPChip
    yesterday











  • If you show your actual ffmpeg command and the complete log from the command we may be able to make more suggestions.

    – llogan
    yesterday








1




1





Are you running ffmpeg on the server itself, or does the server only holds the files?

– LPChip
yesterday





Are you running ffmpeg on the server itself, or does the server only holds the files?

– LPChip
yesterday













If you show your actual ffmpeg command and the complete log from the command we may be able to make more suggestions.

– llogan
yesterday





If you show your actual ffmpeg command and the complete log from the command we may be able to make more suggestions.

– llogan
yesterday










2 Answers
2






active

oldest

votes


















2














That seems to be a small server with 4 GB RAM and a virtual dual-core CPU that is most likely using shared resources. Obviously, this machine is not going to be able to handle video encoding tasks and serve a website at the same time, unless you make compromises in terms of the time it takes for the video encoding to complete.



Under Linux, you can run nice to reduce the priority of a process.



For example, run:



nice ffmpeg -i <input> <output>


The "niceness" values range from -20 to 19, and the higher, the lower priority a process gets. Without further options, nice adds 10 to the value of the process, which is 0 by default.



That said, I'd encourage you to not run web servers and intensive processing tasks on the same machine unless you can compartmentalize them in such a way that high resource consumption doesn't kill your website.






share|improve this answer

































    0














    In addition to slhck's suggestion of using nice you can limit encoding threads with the -threads option if nice is not nice enough.



    Another option is to offload the encoding to hardware, such as nvenc, if it is supported by your server.






    share|improve this answer
























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      Jignesh Prajapati is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1424172%2fhow-to-reduce-cpu-usage-when-it-reaches-100-while-converting-video-using-ffmpeg%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      That seems to be a small server with 4 GB RAM and a virtual dual-core CPU that is most likely using shared resources. Obviously, this machine is not going to be able to handle video encoding tasks and serve a website at the same time, unless you make compromises in terms of the time it takes for the video encoding to complete.



      Under Linux, you can run nice to reduce the priority of a process.



      For example, run:



      nice ffmpeg -i <input> <output>


      The "niceness" values range from -20 to 19, and the higher, the lower priority a process gets. Without further options, nice adds 10 to the value of the process, which is 0 by default.



      That said, I'd encourage you to not run web servers and intensive processing tasks on the same machine unless you can compartmentalize them in such a way that high resource consumption doesn't kill your website.






      share|improve this answer






























        2














        That seems to be a small server with 4 GB RAM and a virtual dual-core CPU that is most likely using shared resources. Obviously, this machine is not going to be able to handle video encoding tasks and serve a website at the same time, unless you make compromises in terms of the time it takes for the video encoding to complete.



        Under Linux, you can run nice to reduce the priority of a process.



        For example, run:



        nice ffmpeg -i <input> <output>


        The "niceness" values range from -20 to 19, and the higher, the lower priority a process gets. Without further options, nice adds 10 to the value of the process, which is 0 by default.



        That said, I'd encourage you to not run web servers and intensive processing tasks on the same machine unless you can compartmentalize them in such a way that high resource consumption doesn't kill your website.






        share|improve this answer




























          2












          2








          2







          That seems to be a small server with 4 GB RAM and a virtual dual-core CPU that is most likely using shared resources. Obviously, this machine is not going to be able to handle video encoding tasks and serve a website at the same time, unless you make compromises in terms of the time it takes for the video encoding to complete.



          Under Linux, you can run nice to reduce the priority of a process.



          For example, run:



          nice ffmpeg -i <input> <output>


          The "niceness" values range from -20 to 19, and the higher, the lower priority a process gets. Without further options, nice adds 10 to the value of the process, which is 0 by default.



          That said, I'd encourage you to not run web servers and intensive processing tasks on the same machine unless you can compartmentalize them in such a way that high resource consumption doesn't kill your website.






          share|improve this answer















          That seems to be a small server with 4 GB RAM and a virtual dual-core CPU that is most likely using shared resources. Obviously, this machine is not going to be able to handle video encoding tasks and serve a website at the same time, unless you make compromises in terms of the time it takes for the video encoding to complete.



          Under Linux, you can run nice to reduce the priority of a process.



          For example, run:



          nice ffmpeg -i <input> <output>


          The "niceness" values range from -20 to 19, and the higher, the lower priority a process gets. Without further options, nice adds 10 to the value of the process, which is 0 by default.



          That said, I'd encourage you to not run web servers and intensive processing tasks on the same machine unless you can compartmentalize them in such a way that high resource consumption doesn't kill your website.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered yesterday









          slhckslhck

          163k47451476




          163k47451476

























              0














              In addition to slhck's suggestion of using nice you can limit encoding threads with the -threads option if nice is not nice enough.



              Another option is to offload the encoding to hardware, such as nvenc, if it is supported by your server.






              share|improve this answer




























                0














                In addition to slhck's suggestion of using nice you can limit encoding threads with the -threads option if nice is not nice enough.



                Another option is to offload the encoding to hardware, such as nvenc, if it is supported by your server.






                share|improve this answer


























                  0












                  0








                  0







                  In addition to slhck's suggestion of using nice you can limit encoding threads with the -threads option if nice is not nice enough.



                  Another option is to offload the encoding to hardware, such as nvenc, if it is supported by your server.






                  share|improve this answer













                  In addition to slhck's suggestion of using nice you can limit encoding threads with the -threads option if nice is not nice enough.



                  Another option is to offload the encoding to hardware, such as nvenc, if it is supported by your server.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  lloganllogan

                  26.7k54884




                  26.7k54884






















                      Jignesh Prajapati is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      Jignesh Prajapati is a new contributor. Be nice, and check out our Code of Conduct.













                      Jignesh Prajapati is a new contributor. Be nice, and check out our Code of Conduct.












                      Jignesh Prajapati is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1424172%2fhow-to-reduce-cpu-usage-when-it-reaches-100-while-converting-video-using-ffmpeg%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Cannot install PyQt5 The Next CEO of Stack OverflowCannot install tcpreplay 3.4.4cannot...

                      Kapp-Putsch Acontecimentos | Outros artigos | Menu de navegação

                      Why did early computer designers eschew integers? The Next CEO of Stack OverflowWhat register...