Skip to content

Commit

Permalink
Fix missing audio issues with muted VODs (#1141)
Browse files Browse the repository at this point in the history
* Fix ffconcat URL

* Explicitly set stream ids in ffconcat list
  • Loading branch information
ScrubN authored Jul 10, 2024
1 parent 50080e8 commit 62ab414
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion TwitchDownloaderCore/Tools/FfmpegConcatList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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));
}
Expand Down

0 comments on commit 62ab414

Please sign in to comment.