Merge pull request #445 from rpaschoal/feature/codec-copy

Update SaveM3U8Stream method to use "-codec copy" argument
This commit is contained in:
Malte Rosenbjerg 2023-05-21 11:37:03 +02:00 committed by GitHub
commit 6df9495e9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -0,0 +1,10 @@
namespace FFMpegCore.Arguments
{
/// <summary>
/// Represents a copy codec parameter
/// </summary>
public class CopyCodecArgument : IArgument
{
public string Text => $"-codec copy";
}
}

View file

@ -333,7 +333,10 @@ public static bool SaveM3U8Stream(Uri uri, string output)
}
return FFMpegArguments
.FromUrlInput(uri)
.FromUrlInput(uri, options =>
{
options.WithCopyCodec();
})
.OutputToFile(output)
.ProcessSynchronously();
}

View file

@ -77,6 +77,7 @@ public FFMpegArgumentOptions DeselectStreams(IEnumerable<int> streamIndices, int
public FFMpegArgumentOptions WithAudibleActivationBytes(string activationBytes) => WithArgument(new AudibleEncryptionKeyArgument(activationBytes));
public FFMpegArgumentOptions WithTagVersion(int id3v2Version = 3) => WithArgument(new ID3V2VersionArgument(id3v2Version));
public FFMpegArgumentOptions WithGifPaletteArgument(int streamIndex, Size? size, int fps = 12) => WithArgument(new GifPaletteArgument(streamIndex, fps, size));
public FFMpegArgumentOptions WithCopyCodec() => WithArgument(new CopyCodecArgument());
public FFMpegArgumentOptions WithArgument(IArgument argument)
{