- Joined
- Nov 21, 2020
I did have a look at the wikipedia page for PREEMPT_RT after @Betonhaus mentioned it, but in all honesty, I'm just being really fucking lazy about kicking down the priority on this one process that doesn't play nice on my old tablet-ass laptop.
I use both JDownloader and yt-dlp from the command line to download stuff on an old 2-in-1 Toshiba with Chromebook levels of RAM, and both those applications spawn ffmpeg to perform various very CPU and IO intensive purposes.
Things are still basically usable if there's only one ffmpeg running in the background, but when I'm downloading an hour long YT video and reencoding with subtittles/chapters/whatever built in, there's a good chance of overlap, and I am too lazy to just queue up a bunch of files.
I didn't want to potentially cause problems for those applications when they're actually downloading stuff, as opposed to remuxing it or adding thumbnails or chapters or subtitles or whatever by doing a regular nice or an ionice down on those parent apps, so I just installed 'and' and had a bit of a fiddle.
Now that I think about it, it probably would have been less effort just to set up a cron job that would run every five seconds and knock down the nice/ionice priorities of any 'ffmpeg' process. Might do that anyway. 'and' actually uses several seconds of CPU time each hour when you have it set up to cycle every five seconds and do whatever calculations it does.
export PATH=/home/me/bin:$PATH
mkdir /home/me/bin
vi /home/me/bin/ffmpeg
i
#! /bin/bash
nice (niceval goes here) /usr/bin/ffmpeg $@
<esc>:wq
chmod a+rx /home/me/bin/ffmpeg
Make sure path is set before:
yt-dlp stuff
Alternatively:
yt-dlp --ffmpeg-location /home/me/bin/ffmpeg
Alternatively:
add --ffmpeg-location /home/me/bin/ffmpeg to a config file, like ~/.yt-dlp/config
The changes for JDownloader are left as an exercise for the reader, or just set the PATH.
Last edited: