reven The documentation doesn't exactly cover this so I have no idea how to log the bitrate, or even where what I have written is pulling the information from?
When I have looked at the logs for Audio Bitrate, it's mostly been shown how I have it in the script and I've used these units in a Video Bitrate checker script which seems to work correctly?
What I presume is the script referenced Video Information log:
2023-03-04 03:59:44.984 [INFO] -> Video Information:
Input #0, matroska,webm, from 'D:\Downloads\FileFlows\Usenet\Sonarr\S.W.A.T.2017.S06E15.720p.HEVC.x265-MeGusta\2b1ecdc585dc455b91d067054adf2b51.mkv':
Metadata:
ENCODER : Lavf59.34.102
Duration: 00:41:35.12, start: 0.000000, bitrate: 1306 kb/s
Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt709/unknown/unknown, progressive), 1280x718 [SAR 1:1 DAR 640:359], 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
ENCODER : Lavc59.54.100 libx265
DURATION : 00:41:35.118000000
Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
Metadata:
DURATION : 00:41:35.072000000
Video Bitrate Check script:
function Script()
{
// from the first video stream
let video = Variables.vi?.VideoInfo?.videoStreams[0];
if(video.Bitrate > 3000)
return 1; // Convert as per resolution prefernces
return 2; // Acceptable Bitrate | Keep As Source
}
Result:
2023-03-04 03:59:45.084 [INFO] -> ======================================================================
2023-03-04 03:59:45.084 [INFO] -> Executing Node 6: Video Bitrate Check [FileFlows.Server.ScriptNode]
2023-03-04 03:59:45.084 [INFO] -> ======================================================================
2023-03-04 03:59:45.280 [INFO] -> Script result: 2
2023-03-04 03:59:45.280 [INFO] -> Node execution time: 00:00:00.1962367
I'll add the additional "000"'s and see if that makes any difference.
Just a thought, but could the track reference in AudioStreams[0]
be pointing at the wrong one?