This post is about my debating if I should use ‘cpupower’ in a script.
I have a bash shell script that stabilizes video files using FFmpeg’s vidstab filters and creates a side-by-side comparison with the original video. It does this in 3 phases.
-
Phase-1: uses ffmpeg’s vidstabdetect (which I have attempted to tmpfs optimize) to create vector movement files from frame to frame. This is very CPU intensive. It saves the vector file for use in the next phase.
-
Phase-2: creates (with ffmpeg) a stabilized video using vidstabtransform with the vector file (tmpfs optimized). This is more GPU intensive. It saves the stabilized video in this phase.
-
Phase-3. creates side-by-side comparison of original and stabilized videos. This is GPU intensive.
I previously sped up Phase-2 and Phase-3 a lot with Intel’s qsv … and to a lessor extent for phase-1 and phase-2 use of tmpfs. ![]()
However I am still (to a small extent - lol !
) able to learn new things, and today on my LEAP-15.6 PC I observed an update for an app called cpupower.
Now , I have a ‘resolution’ for openSUSE self improvement, that i am trying to follow, which is every time I have a software update, I try to research a small amount the app being updated, so I can learn more.
Naturally, I was curious about cpupower.
I read the ‘performance’ setting of cpupower ‘might’ speed up performance (although I suspect if it heats up my PC’s CPU too much, it won’t do anything as the PC firmware (?) will slow down the CPU to reduce high temperatures). Still, I am thinking it may be worth a shot to try for phase-1 (only) where the CPU is the processing bottleneck.
So I am considering, maybe to test, at the start of phase-1 of the script, sending the command (which will require me to enter the root password):
sudo cpupower frequency-set -g performance
and then at the end of phase-1, the CPU phase, send the command (to go back to default):
sudo cpupower frequency-set -g powersave
The script will need to prompt me for a password at the appropriate time.
I thought to post this idea here, in case any on our forum have experience with cpupower in other contexts, that would suggest such is a good idea, bad idea, or something curious to try and simply test vs different length videos (where some of my videos to stabilize are only 10 to 20 seconds and others are a few minutes long).