Detect HandBrake Hw encoded streams
This commit is contained in:
parent
57a92c5a51
commit
af0514f485
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name AnimeBytes Mediainfo Improvements
|
||||
// @author WeebDataHoarder
|
||||
// @version 1.31.0
|
||||
// @version 1.31.1
|
||||
// @downloadURL https://git.gammaspectra.live/WeebDataHoarder/userscripts/raw/branch/master/AnimeBytes/ab-mediainfo.user.js
|
||||
// @updateURL https://git.gammaspectra.live/WeebDataHoarder/userscripts/raw/branch/master/AnimeBytes/ab-mediainfo.user.js
|
||||
// @description AnimeBytes Mediainfo Improvements. Adds several listing and matching releases against mediainfo utilities. MIT license
|
||||
|
@ -484,6 +484,20 @@ function extractFromMediainfo(tags, mediainfo, warnings, fileName, fileList, sou
|
|||
}
|
||||
|
||||
|
||||
let isHandbrake = false;
|
||||
|
||||
if ("general" in mediainfo) {
|
||||
if("writing_application" in mediainfo.general){
|
||||
if(mediainfo.general.writing_application.match(/^HandBrake /) !== null){
|
||||
if(settings.getSetting("warning_handbrakeEncoder")){
|
||||
warnings.general.push(["info", "Found HandBrake encoder"]);
|
||||
}
|
||||
isHandbrake = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let video = null;
|
||||
mediainfo.video.forEach((v) => {
|
||||
Mediainfo.makeVideoObject(v);
|
||||
|
@ -665,6 +679,12 @@ function extractFromMediainfo(tags, mediainfo, warnings, fileName, fileList, sou
|
|||
}else if(video.writing_library.trim().match(/[^0-9A-F]/i) !== null){
|
||||
[tags.videoEncoder] = video.writing_library.split(" ");
|
||||
}
|
||||
} else if (isHandbrake) {
|
||||
// HandBrake removes NVenc tags when using Hardware Encoder, at least on H.264 and H.265
|
||||
tags.videoEncoder = "HandBrake HW";
|
||||
if(settings.getSetting("warning_hwEncoder")){
|
||||
warnings.video.push(["danger", "Found probable HandBrake hardware-encoded stream"]);
|
||||
}
|
||||
}
|
||||
|
||||
//Detect probably H262 remuxes
|
||||
|
@ -1127,16 +1147,6 @@ function extractFromMediainfo(tags, mediainfo, warnings, fileName, fileList, sou
|
|||
}
|
||||
});
|
||||
|
||||
if ("general" in mediainfo) {
|
||||
if("writing_application" in mediainfo.general){
|
||||
if(mediainfo.general.writing_application.match(/^HandBrake /) !== null){
|
||||
if(settings.getSetting("warning_handbrakeEncoder")){
|
||||
warnings.general.push(["info", "Found HandBrake encoder"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tags;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue