简体   繁体   中英

Low CPU Usage with dbPoweramp Powershell

I am using a program called dbPoweramp to convert music from within Powershell. I am using the documentation here which was all I could find for it when searching. Whenever I use the program itself to convert I get 100% CPU usage and it fully utilizes all eight threads. However, whenever I launch through the command line I only get something around 13% CPU usage. It obviously isn't desirable to have to launch the program manually because I am going for automation here. I have tried messing with the -processors argument but it has made no difference. Does anyone have any idea as to why that would be?

I have also tried using FFMPEG instead, but the CPU usage for FFMPEG is similarly low. If anyone could post code that would make FFMPEG utilize all eight cores that would work just as well.

Here is the section of code that does the actual conversion, essentially it just searches for all flac, m4a, or mp3 files and then automatically converts them to variable bitrate quality 1 mp3s for streaming.

$oldMusic = Get-ChildItem -Include @("*.flac", "*.m4a", "*.mp3") -Path $inProcessPath -Recurse #gets all of the music

cd 'C:\Program Files (x86)\Illustrate\dBpoweramp'

foreach ($oldSong in $oldMusic) {
    $newSong = [io.path]::ChangeExtension($oldSong.FullName, '.mp3')
    $oldSongPath = $oldSong.FullName 
    $newSongPath = "E:\Temp\$newSong"
    .\CoreConverter.exe  -infile= $oldSongPath -outfile= $newSong -convert_to= "mp3 (Lame)" -V $quality #converts the file

}

Thanks in advance!

I don't think the encoder runs on more than a single thread. I think that it encodes up to 8 tracks at a time, one on each core. In your example, the encoding will happen serially meaning that you're only going to use one core at a time. The same will occur with FFmpeg.

I'm no Powershell guy, but if you can get it to run up to 8 processes at once, you won't have this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM