multiple ffmpeg threads

This commit is contained in:
nixo 2019-05-21 18:39:47 +02:00
parent c07dd34878
commit c05c0b85a6
1 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@
"Subsonic API compatible version"
const apiversion = "1.16.1"
const domain = "nixo.xyz"
const ffmpeg_threads = 6
"""
Helper function that prepares a subsonic response.
"""
@ -524,7 +524,8 @@ function giveconverted(file, bitrate, format)
end
function convert(infile; bitrate = 64, format = "oga")
pipeline(`ffmpeg -i $infile -y -c:a libvorbis -b:a $(bitrate)k -f $format pipe:1`,
global ffmpeg_threads
pipeline(`ffmpeg -i $infile -y -c:a libvorbis -b:a $(bitrate)k -threads $(ffmpeg_threads) -f $format pipe:1`,
stderr=devnull) |> read
end