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;
}
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
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.
add a comment |
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
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
add a comment |
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
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
ffmpeg
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.
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
edited yesterday
answered yesterday
slhckslhck
163k47451476
163k47451476
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered yesterday
lloganllogan
26.7k54884
26.7k54884
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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