mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2025-12-30 13:09:59 -06:00
Added option to H265/AC3 to normalize audio
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -30,17 +30,21 @@
|
||||
}
|
||||
},
|
||||
"Video_H265_AC3":{
|
||||
"Description":"This will ensure all videos are encoded in H265 (if not already encoded) and that AC3 audio is the first audio channel\n\nOutput 1: Video was processed\nOutput 2: No processing required",
|
||||
"Fields":{
|
||||
"Language":"Language",
|
||||
"Language-Help":"Optional ISO 639-2 language code to use. Will attempt to find an audio track with this language code if not the best audio track will be used.\nhttps://en.wikipedia.org/wiki/List_of_ISO_639-2_codes",
|
||||
"Crf":"Constant Rate Factor",
|
||||
"Crf-Help":"Refer to ffmpeg for more details, the lower the value the bigger the file. A good value is around 19-23. Default is 21.",
|
||||
"NvidiaEncoding":"NVIDIA Encoding",
|
||||
"NvidiaEncoding-Help":"If NVIDIA hardware encoding should be used. If you do not have a supported NVIDIA card the encoding will fail.",
|
||||
"Threads":"Threads",
|
||||
"Threads-Help":"Only used if not using NVIDIA. If set to 0, the threads will use FFMpegs defaults."
|
||||
}
|
||||
"Description":"This will ensure all videos are encoded in H265 (if not already encoded) and that AC3 audio is the first audio channel\n\nOutput 1: Video was processed\nOutput 2: No processing required",
|
||||
"Fields": {
|
||||
"Language": "Language",
|
||||
"Language-Help": "Optional ISO 639-2 language code to use. Will attempt to find an audio track with this language code if not the best audio track will be used.\nhttps://en.wikipedia.org/wiki/List_of_ISO_639-2_codes",
|
||||
"Crf": "Constant Rate Factor",
|
||||
"Crf-Help": "Refer to ffmpeg for more details, the lower the value the bigger the file. A good value is around 19-23. Default is 21.",
|
||||
"NvidiaEncoding": "NVIDIA Encoding",
|
||||
"NvidiaEncoding-Help": "If NVIDIA hardware encoding should be used. If you do not have a supported NVIDIA card the encoding will fail.",
|
||||
"Threads": "Threads",
|
||||
"Threads-Help": "Only used if not using NVIDIA. If set to 0, the threads will use FFMpegs defaults.",
|
||||
"NormalizeAudio": "Normalize Audio",
|
||||
"NormalizeAudio-Help": "If the audio track should have its volume level normalized",
|
||||
"ForceRencode": "Force Rencode",
|
||||
"ForceRencode-Help": "If the video should always be reencoded regardless if it already is in H265/AC3"
|
||||
}
|
||||
},
|
||||
"FFMPEG":{
|
||||
"Description":"The node lets you run any FFMPEG command you like. Giving you full control over what it can do.\n\nFor more information refer to the FFMPEG documentation",
|
||||
|
||||
@@ -21,6 +21,17 @@ namespace FileFlows.VideoNodes
|
||||
[DefaultValue(0)]
|
||||
[NumberInt(4)]
|
||||
public int Threads { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Boolean(5)]
|
||||
public bool NormalizeAudio { get; set; }
|
||||
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Boolean(6)]
|
||||
public bool ForceRencode { get; set; }
|
||||
|
||||
|
||||
public override string Icon => "far fa-file-video";
|
||||
|
||||
private NodeParameters args;
|
||||
@@ -68,7 +79,7 @@ namespace FileFlows.VideoNodes
|
||||
if (crop != string.Empty)
|
||||
crop = " -vf crop=" + crop;
|
||||
|
||||
if (firstAc3 == true && videoH265 != null)
|
||||
if (ForceRencode == false && firstAc3 == true && videoH265 != null)
|
||||
{
|
||||
if (crop == string.Empty)
|
||||
{
|
||||
@@ -97,7 +108,9 @@ namespace FileFlows.VideoNodes
|
||||
|
||||
TotalTime = videoInfo.VideoStreams[0].Duration;
|
||||
|
||||
if (bestAudio.Codec.ToLower() != "ac3")
|
||||
if(NormalizeAudio)
|
||||
ffArgs.Add($"-map 0:{bestAudio.Index} -c:a ac3 -af loudnorm=I=-24:LRA=7:TP=-2.0");
|
||||
else if (bestAudio.Codec.ToLower() != "ac3")
|
||||
ffArgs.Add($"-map 0:{bestAudio.Index} -c:a ac3");
|
||||
else
|
||||
ffArgs.Add($"-map 0:{bestAudio.Index} -c:a copy");
|
||||
@@ -1,17 +1,17 @@
|
||||
[
|
||||
{
|
||||
"Name": "BasicNodes",
|
||||
"Version": "0.0.1.13",
|
||||
"Version": "0.0.1.14",
|
||||
"Package": "https://github.com/revenz/FileFlowsPlugins/blob/master/Builds/BasicNodes.zip?raw=true"
|
||||
},
|
||||
{
|
||||
"Name": "MetaNodes",
|
||||
"Version": "0.0.1.13",
|
||||
"Version": "0.0.1.14",
|
||||
"Package": "https://github.com/revenz/FileFlowsPlugins/blob/master/Builds/MetaNodes.zip?raw=true"
|
||||
},
|
||||
{
|
||||
"Name": "VideoNodes",
|
||||
"Version": "0.0.1.13",
|
||||
"Version": "0.0.1.14",
|
||||
"Package": "https://github.com/revenz/FileFlowsPlugins/blob/master/Builds/VideoNodes.zip?raw=true"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user