From bfb2d9f1ab3d62ca8d351e0d4fcb865eac3ca8da Mon Sep 17 00:00:00 2001 From: John Andrews Date: Fri, 5 Aug 2022 14:33:34 +1200 Subject: [PATCH] FF-268 - video nodes now using -movflags +faststart for mp4 --- EmailNodes/EmailNodes.en.json | 2 +- Plex/Plex.en.json | 6 +++--- VideoLegacyNodes/VideoLegacyNodes.en.json | 4 ++-- VideoLegacyNodes/VideoNodes/EncodingNode.cs | 2 +- VideoNodes/FfmpegBuilderNodes/FfmpegBuilderExecutor.cs | 4 ++++ VideoNodes/VideoNodes.en.json | 10 +++++----- VideoNodes/VideoNodes/AudioToVideo.cs | 3 +++ VideoNodes/VideoNodes/EncodingNode.cs | 2 +- 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/EmailNodes/EmailNodes.en.json b/EmailNodes/EmailNodes.en.json index 8cba368b..ec98574f 100644 --- a/EmailNodes/EmailNodes.en.json +++ b/EmailNodes/EmailNodes.en.json @@ -28,7 +28,7 @@ "Subject": "Subject", "Subject-Help": "The subject of the email being set", "Body": "Body", - "Body-Help": "The content of the email message being sent. Uses the scriban templating language\nhttps://github.com/scriban/scriban" + "Body-Help": "The content of the email message being sent. Uses the [scriban](https://github.com/scriban/scriban) templating language" } } } diff --git a/Plex/Plex.en.json b/Plex/Plex.en.json index ee2407cf..f2a78354 100644 --- a/Plex/Plex.en.json +++ b/Plex/Plex.en.json @@ -7,7 +7,7 @@ "ServerUrl-Placeholder": "http://localhost:32400/", "ServerUrl-Help": "The URL of the Plex server", "AccessToken": "Access Token", - "AccessToken-Help": "The access token used to communicate with the Plex server.\nhttps://github.com/revenz/Fenrus/wiki/Plex-Token", + "AccessToken-Help": "The [access token](https://github.com/revenz/Fenrus/wiki/Plex-Token) used to communicate with the Plex server.", "Mapping": "Mapping", "Mapping-Help": "A list of mapping replacement used to paths in FileFlows with the paths that are used in Plex.", "MappingKey": "FileFlows", @@ -28,7 +28,7 @@ "ServerUrl-Placeholder": "http://localhost:32400/", "ServerUrl-Help": "The URL of the Plex server. If blank will use the Server defined in the Plugin settings.\nNote: Only set this if you want to override the plugin settings server URL.", "AccessToken": "Access Token", - "AccessToken-Help": "The access token used to communicate with the Plex server.\nhttps://github.com/revenz/Fenrus/wiki/Plex-Token\nNote: Only set this if you want to override the plugin settings access token.", + "AccessToken-Help": "The [access token](https://github.com/revenz/Fenrus/wiki/Plex-Token) used to communicate with the Plex server.\nNote: Only set this if you want to override the plugin settings access token.", "Mapping": "Mapping", "Mapping-Help": "A list of mapping replacement used to paths in FileFlows with the paths that are used in Plex.\nNote: This will not be used unless the Server URL is also set here, otherwise the plugin settings mappings will be used.", "MappingKey": "FileFlows", @@ -46,7 +46,7 @@ "ServerUrl-Placeholder": "http://localhost:32400/", "ServerUrl-Help": "The URL of the Plex server. If blank will use the Server defined in the Plugin settings.\nNote: Only set this if you want to override the plugin settings server URL.", "AccessToken": "Access Token", - "AccessToken-Help": "The access token used to communicate with the Plex server.\nhttps://github.com/revenz/Fenrus/wiki/Plex-Token\nNote: Only set this if you want to override the plugin settings access token.", + "AccessToken-Help": "The [access token](https://github.com/revenz/Fenrus/wiki/Plex-Token) used to communicate with the Plex server.\nNote: Only set this if you want to override the plugin settings access token.", "Mapping": "Mapping", "Mapping-Help": "A list of mapping replacement used to paths in FileFlows with the paths that are used in Plex.\nNote: This will not be used unless the Server URL is also set here, otherwise the plugin settings mappings will be used.", "MappingKey": "FileFlows", diff --git a/VideoLegacyNodes/VideoLegacyNodes.en.json b/VideoLegacyNodes/VideoLegacyNodes.en.json index 6dcc77bd..2410c4a9 100644 --- a/VideoLegacyNodes/VideoLegacyNodes.en.json +++ b/VideoLegacyNodes/VideoLegacyNodes.en.json @@ -89,7 +89,7 @@ "Description": "Allows you to set the language for any audio tracks that have no language set. If the audio track does have a language set, it will be skipped.\n\nOutput 1: Audio Tracks were updated\nOutput 2: No audio tracks were needing to be updated", "Fields": { "Language": "Language", - "Language-Help": "The ISO 639-2 language code to use. \nhttps://en.wikipedia.org/wiki/List_of_ISO_639-2_codes" + "Language-Help": "The [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) language code to use." } }, "AutoChapters": { @@ -209,7 +209,7 @@ "AudioCodec": "Audio Codec", "AudioCodec-Help": "The audio codec to encode the video with.\nIf left empty all original audio tracks will be copied.", "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" + "Language-Help": "Optional [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) language code to use. Will attempt to find an audio track with this language code if not the best audio track will be used." } }, "VideoHasStream": { diff --git a/VideoLegacyNodes/VideoNodes/EncodingNode.cs b/VideoLegacyNodes/VideoNodes/EncodingNode.cs index 5906fbe9..06d7152c 100644 --- a/VideoLegacyNodes/VideoNodes/EncodingNode.cs +++ b/VideoLegacyNodes/VideoNodes/EncodingNode.cs @@ -70,7 +70,7 @@ namespace FileFlows.VideoNodes { if (TotalTime.TotalMilliseconds == 0) { - Args?.Logger?.DLog("Can't report time progress as total time is 0"); + //Args?.Logger?.DLog("Can't report time progress as total time is 0"); return; } float percent = (float)((time.TotalMilliseconds / TotalTime.TotalMilliseconds) * 100); diff --git a/VideoNodes/FfmpegBuilderNodes/FfmpegBuilderExecutor.cs b/VideoNodes/FfmpegBuilderNodes/FfmpegBuilderExecutor.cs index 56e84eb4..7b40017d 100644 --- a/VideoNodes/FfmpegBuilderNodes/FfmpegBuilderExecutor.cs +++ b/VideoNodes/FfmpegBuilderNodes/FfmpegBuilderExecutor.cs @@ -121,6 +121,10 @@ namespace FileFlows.VideoNodes.FfmpegBuilderNodes startArgs.Add(file); } startArgs.Add("-y"); + if (extension.ToLower() == "mp4" && ffArgs.IndexOf("-movflags") < 0 && startArgs.IndexOf("-movflgs") < 0) + { + startArgs.AddRange(new[] { "-movflags", "+faststart" }); + } ffArgs = startArgs.Concat(ffArgs).ToList(); diff --git a/VideoNodes/VideoNodes.en.json b/VideoNodes/VideoNodes.en.json index d0ddf1bb..37a8c99a 100644 --- a/VideoNodes/VideoNodes.en.json +++ b/VideoNodes/VideoNodes.en.json @@ -10,8 +10,8 @@ "AudioToVideo": { "Description": "Converts an audio file into a video file and generates a video based on the audio", "Fields": { - "Visualisation": "Visualisation", - "Visualisation-Help": "The visualation to use in the generated video. See Help for examples", + "Visualization": "Visualisation", + "Visualization-Help": "The visualation to use in the generated video. See Help for examples", "Container": "Container", "Resolution": "Resolution", "Codec": "Codec", @@ -94,7 +94,7 @@ "Codec": "Codec", "Codec-Help": "The codec to use to encode the audio", "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" + "Language-Help": "Optional [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) language code to use. Will attempt to find an audio track with this language code if not the best audio track will be used." } }, "FfmpegBuilderAudioAdjustVolume": { @@ -210,7 +210,7 @@ "StreamType": "Type", "StreamType-Help": "The type of track to set the language for", "Language": "Language", - "Language-Help": "The ISO 639-2 language code to use.\nhttps://en.wikipedia.org/wiki/List_of_ISO_639-2_codes" + "Language-Help": "The [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) language code to use." } }, "FfmpegBuilderAutoChapters": { @@ -458,7 +458,7 @@ }, "Fields": { "Language": "Language", - "Language-Help": "The ISO 639-2 language code to use. \nhttps://en.wikipedia.org/wiki/List_of_ISO_639-2_codes", + "Language-Help": "The [ISO 639-2](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) language code to use.", "OutputFile": "Output File", "OutputFile-Help": "Where to save the the output file to, e.g. \"'{folder.Orig.FullName}\\{file.Orig.FileName}.srt'\" to save it with the original file as a srt output.\nIf left blank an srt subtitle will be created in the same folder as the original input file.", "SetWorkingFile": "Set as Working File", diff --git a/VideoNodes/VideoNodes/AudioToVideo.cs b/VideoNodes/VideoNodes/AudioToVideo.cs index 2daffcc8..36ceec47 100644 --- a/VideoNodes/VideoNodes/AudioToVideo.cs +++ b/VideoNodes/VideoNodes/AudioToVideo.cs @@ -132,6 +132,9 @@ public class AudioToVideo : EncodingNode List ffArgs = new List(); var encodingParameters = FfmpegBuilderVideoEncode.GetEncodingParameters(args, this.Codec, 28, HardwareEncoding); + if (Container.ToLower() == "mp4") + ffArgs.AddRange(new[] { "-movflags", "+faststart" }); + switch (Visualization) { case VisualizationStyle.Waves: diff --git a/VideoNodes/VideoNodes/EncodingNode.cs b/VideoNodes/VideoNodes/EncodingNode.cs index 9f1f2e2c..78e15dca 100644 --- a/VideoNodes/VideoNodes/EncodingNode.cs +++ b/VideoNodes/VideoNodes/EncodingNode.cs @@ -70,7 +70,7 @@ namespace FileFlows.VideoNodes { if (TotalTime.TotalMilliseconds == 0) { - Args?.Logger?.DLog("Can't report time progress as total time is 0"); + //Args?.Logger?.DLog("Can't report time progress as total time is 0"); return; } float percent = (float)((time.TotalMilliseconds / TotalTime.TotalMilliseconds) * 100);