diff --git a/FFMpegCore.Test/ArgumentBuilderTest.cs b/FFMpegCore.Test/ArgumentBuilderTest.cs index 5f2ce5c..9a358ae 100644 --- a/FFMpegCore.Test/ArgumentBuilderTest.cs +++ b/FFMpegCore.Test/ArgumentBuilderTest.cs @@ -353,10 +353,10 @@ public void Builder_BuildString_SubtitleHardBurnFilterFixedPaths() .OutputToFile("output.mp4", false, opt => opt .WithVideoFilters(filterOptions => filterOptions .HardBurnSubtitle(SubtitleHardBurnOptions - .Create(subtitlePath: @"sample( \ : [ ] , ).srt")))) + .Create(subtitlePath: @"sample( \ : [ ] , ' ).srt")))) .Arguments; - Assert.AreEqual(@"-i ""input.mp4"" -vf ""subtitles='sample( \\ \: \[ \] \, ).srt'"" ""output.mp4""", + Assert.AreEqual(@"-i ""input.mp4"" -vf ""subtitles='sample( \\ \: \[ \] \, '\\\'' ).srt'"" ""output.mp4""", str); } diff --git a/FFMpegCore/Extend/StringExtensions.cs b/FFMpegCore/Extend/StringExtensions.cs index 7afcc34..2c33681 100644 --- a/FFMpegCore/Extend/StringExtensions.cs +++ b/FFMpegCore/Extend/StringExtensions.cs @@ -7,11 +7,11 @@ internal static class StringExtensions { private static Dictionary CharactersSubstitution { get; } = new Dictionary { - {'\\', @"\\"}, - {':', @"\:"}, - {'[', @"\["}, - {']', @"\]"}, - // {'\'', @"\'"} TODO: Quotes need to be escaped but i failed miserably + { '\\', @"\\" }, + { ':', @"\:" }, + { '[', @"\[" }, + { ']', @"\]" }, + { '\'', @"'\\\''" } }; ///