From f777a2e908b3a7912963581462a3c7d46817e221 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:52:34 -0400 Subject: [PATCH 1/2] Fix ffconcat URL --- TwitchDownloaderCore/Tools/FfmpegConcatList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TwitchDownloaderCore/Tools/FfmpegConcatList.cs b/TwitchDownloaderCore/Tools/FfmpegConcatList.cs index c3ea6c5b..f6b5ad0d 100644 --- a/TwitchDownloaderCore/Tools/FfmpegConcatList.cs +++ b/TwitchDownloaderCore/Tools/FfmpegConcatList.cs @@ -7,7 +7,7 @@ namespace TwitchDownloaderCore.Tools { - // https://www.ffmpeg.org/ffmpeg-formats.html#toc-concat-1 + // https://www.ffmpeg.org/ffmpeg-formats.html#concat-1 public static class FfmpegConcatList { private const string LINE_FEED = "\u000A"; From f88e07c4aad60ebbfc12d142c789bdf1720e639e Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:54:54 -0400 Subject: [PATCH 2/2] Explicitly set stream ids in ffconcat list --- TwitchDownloaderCore/Tools/FfmpegConcatList.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TwitchDownloaderCore/Tools/FfmpegConcatList.cs b/TwitchDownloaderCore/Tools/FfmpegConcatList.cs index f6b5ad0d..38027745 100644 --- a/TwitchDownloaderCore/Tools/FfmpegConcatList.cs +++ b/TwitchDownloaderCore/Tools/FfmpegConcatList.cs @@ -27,6 +27,13 @@ public static async Task SerializeAsync(string filePath, M3U8 playlist, Range vi await sw.WriteAsync(DownloadTools.RemoveQueryString(stream.Path)); await sw.WriteLineAsync('\''); + await sw.WriteLineAsync("stream"); + await sw.WriteLineAsync("exact_stream_id 0x100"); // Audio + await sw.WriteLineAsync("stream"); + await sw.WriteLineAsync("exact_stream_id 0x101"); // Video + await sw.WriteLineAsync("stream"); + await sw.WriteLineAsync("exact_stream_id 0x102?"); // Subtitle + await sw.WriteAsync("duration "); await sw.WriteLineAsync(stream.PartInfo.Duration.ToString(CultureInfo.InvariantCulture)); }