mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-17 19:26:27 -07:00
Update worker with hb fps if available
This commit is contained in:
parent
04bc1281bc
commit
57b4662c3d
2 changed files with 36 additions and 1 deletions
|
|
@ -39,6 +39,28 @@ const handbrakeParser = ({
|
|||
return percentage;
|
||||
};
|
||||
|
||||
const getHandBrakeFps = ({
|
||||
str,
|
||||
}: {
|
||||
str: string,
|
||||
}): number => {
|
||||
try {
|
||||
if (typeof str !== 'string' || !(str.includes('(') && str.includes('fps'))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const out = parseInt(str.split('(')[1].split('fps')[0].trim(), 10);
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (!isNaN(out)) {
|
||||
return out;
|
||||
}
|
||||
} catch (err) {
|
||||
// err
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
// frame= 889 fps=106 q=26.0 Lsize= 25526kB time=00:00:35.69 bitrate=5858.3kbits/s speed=4.25x
|
||||
const getFFmpegVar = ({
|
||||
str,
|
||||
|
|
@ -227,5 +249,6 @@ export {
|
|||
ffmpegParser,
|
||||
getFFmpegPercentage,
|
||||
getFFmpegVar,
|
||||
getHandBrakeFps,
|
||||
editreadyParser,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue