VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    Ubuntu 20.04 LTS on a HP 8440w notebook.
    I am having trouble when converting video from ts to mp4 and scaling down from 1280x720 to 852x480 size.
    What happens is that the CPU gets overloaded and all other jobs on the system slow down awfully.
    Is there a switch for ffmpeg to tell it NOT to use all available resources of the computer?
    Quote Quote  
  2. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    I found the -threads argument to ffmpeg but there is no change if I use that...
    Without this top reports 740% utilization and this is the same when using no -threads argument.
    What am I doing wrong?
    This is what I have now in my script:
    Code:
    COMMAND="ffmpeg -hide_banner -threads 3 -i $INFILE -vf scale=w=-4:h=${VSIZE} -c:v libx264 -preset fast -crf 20 -c:a copy $OUTFILE"
    eval $COMMAND
    Quote Quote  
  3. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    It turned out that by setting argument "-threads 1" I managed to reduce the CPU load to about 400% as shown by top.
    Conversion speed dropped too of course so a 1-hour video takes about 22 min to convert.
    I should be able to schedule conversions at times when the download has been finished nightly.
    Quote Quote  
  4. Once again, run ffmpeg at low priority. That will give you the best of both worlds: ffmpeg won't interfere with other processes and the video won't take any longer to convert because ffmpeg will still get all the otherwise idle cpu time. See "nice" levels in linux.
    Quote Quote  
  5. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    Originally Posted by jagabo View Post
    Once again, run ffmpeg at low priority. That will give you the best of both worlds: ffmpeg won't interfere with other processes and the video won't take any longer to convert because ffmpeg will still get all the otherwise idle cpu time. See "nice" levels in linux.
    I don't think that priority can be set in Linux.
    As I stated on the first line of the first post in this thread I am using an Ubuntu 20.04 LTS computer here.
    Actually it is a HP 8440w Elitebook from 2010.
    It has 16GB RAM and a 500GB SSD.
    Quote Quote  
  6. Member
    Join Date
    Mar 2011
    Location
    Nova Scotia, Canada
    Search Comp PM
    Originally Posted by BosseB View Post
    Originally Posted by jagabo View Post
    Once again, run ffmpeg at low priority. That will give you the best of both worlds: ffmpeg won't interfere with other processes and the video won't take any longer to convert because ffmpeg will still get all the otherwise idle cpu time. See "nice" levels in linux.
    I don't think that priority can be set in Linux.....
    Yes it can. If you open System Monitor (it may be called something else in Gnome, which I don't use) and call up the process list, right click the ffmpeg one.

    Or as mentioned try nice.
    Quote Quote  
  7. Member
    Join Date
    Feb 2021
    Location
    Sweden
    Search Comp PM
    Originally Posted by Hoser Rob View Post
    Originally Posted by BosseB View Post
    Originally Posted by jagabo View Post
    Once again, run ffmpeg at low priority. That will give you the best of both worlds: ffmpeg won't interfere with other processes and the video won't take any longer to convert because ffmpeg will still get all the otherwise idle cpu time. See "nice" levels in linux.
    I don't think that priority can be set in Linux.....
    Yes it can. If you open System Monitor (it may be called something else in Gnome, which I don't use) and call up the process list, right click the ffmpeg one.
    I am interacting with this Linux box via SSH (PuTTY from Windows...
    Nothing to click on.
    The closest to a process viewer I can get is top.
    Or as mentioned try nice.
    Will try to do that and see what is happening.
    Quote Quote  
  8. Jeez, this is so trivial. From the wikipedia link I gave earlier

    If a user wanted to compress a large file, but not slow down other processes, they might run the following:

    $ nice -n 19 tar cvzf archive.tgz largefile
    Just replace the tar command line with the ffmpeg command line.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!