2016-01-12 01:47:04 +01:00
|
|
|
-- Keep result of 'encoding.lua' except flac.
|
|
|
|
|
2016-11-15 12:21:20 +01:00
|
|
|
local bitrate = bps or 9999999
|
|
|
|
local OGGMAX = 500000
|
|
|
|
|
2016-01-12 01:47:04 +01:00
|
|
|
if output.format == 'flac' then
|
2016-11-15 12:21:20 +01:00
|
|
|
if bitrate > input.bitrate then
|
|
|
|
bitrate = input.bitrate
|
|
|
|
end
|
2016-01-12 01:47:04 +01:00
|
|
|
output.format = 'ogg'
|
2016-11-15 12:21:20 +01:00
|
|
|
output.parameters = {'-c:a', 'libvorbis', '-b:a', tostring(math.min(bitrate, OGGMAX))}
|
2016-01-12 01:47:04 +01:00
|
|
|
end
|