mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-18 20:46:43 +00:00
parent
1c5d7d26cb
commit
d4fdd646fe
1 changed files with 7 additions and 7 deletions
|
@ -150,7 +150,7 @@ public static bool Convert(
|
||||||
.UsingMultithreading(multithreaded)
|
.UsingMultithreading(multithreaded)
|
||||||
.WithVideoCodec(VideoCodec.LibX264)
|
.WithVideoCodec(VideoCodec.LibX264)
|
||||||
.WithVideoBitrate(2400)
|
.WithVideoBitrate(2400)
|
||||||
.WithVideoFilters(filterOptions => filterOptions
|
.WithVideoFilters(filterOptions => filterOptions
|
||||||
.Scale(outputSize))
|
.Scale(outputSize))
|
||||||
.WithSpeedPreset(speed)
|
.WithSpeedPreset(speed)
|
||||||
.WithAudioCodec(AudioCodec.Aac)
|
.WithAudioCodec(AudioCodec.Aac)
|
||||||
|
@ -162,7 +162,7 @@ public static bool Convert(
|
||||||
.UsingMultithreading(multithreaded)
|
.UsingMultithreading(multithreaded)
|
||||||
.WithVideoCodec(VideoCodec.LibTheora)
|
.WithVideoCodec(VideoCodec.LibTheora)
|
||||||
.WithVideoBitrate(2400)
|
.WithVideoBitrate(2400)
|
||||||
.WithVideoFilters(filterOptions => filterOptions
|
.WithVideoFilters(filterOptions => filterOptions
|
||||||
.Scale(outputSize))
|
.Scale(outputSize))
|
||||||
.WithSpeedPreset(speed)
|
.WithSpeedPreset(speed)
|
||||||
.WithAudioCodec(AudioCodec.LibVorbis)
|
.WithAudioCodec(AudioCodec.LibVorbis)
|
||||||
|
@ -181,7 +181,7 @@ public static bool Convert(
|
||||||
.UsingMultithreading(multithreaded)
|
.UsingMultithreading(multithreaded)
|
||||||
.WithVideoCodec(VideoCodec.LibVpx)
|
.WithVideoCodec(VideoCodec.LibVpx)
|
||||||
.WithVideoBitrate(2400)
|
.WithVideoBitrate(2400)
|
||||||
.WithVideoFilters(filterOptions => filterOptions
|
.WithVideoFilters(filterOptions => filterOptions
|
||||||
.Scale(outputSize))
|
.Scale(outputSize))
|
||||||
.WithSpeedPreset(speed)
|
.WithSpeedPreset(speed)
|
||||||
.WithAudioCodec(AudioCodec.LibVorbis)
|
.WithAudioCodec(AudioCodec.LibVorbis)
|
||||||
|
@ -236,7 +236,7 @@ public static bool SaveM3U8Stream(Uri uri, string output)
|
||||||
|
|
||||||
if (uri.Scheme != "http" && uri.Scheme != "https")
|
if (uri.Scheme != "http" && uri.Scheme != "https")
|
||||||
throw new ArgumentException($"Uri: {uri.AbsoluteUri}, does not point to a valid http(s) stream.");
|
throw new ArgumentException($"Uri: {uri.AbsoluteUri}, does not point to a valid http(s) stream.");
|
||||||
|
|
||||||
return FFMpegArguments
|
return FFMpegArguments
|
||||||
.FromUrlInput(uri)
|
.FromUrlInput(uri)
|
||||||
.OutputToFile(output)
|
.OutputToFile(output)
|
||||||
|
@ -319,7 +319,7 @@ internal static IReadOnlyList<PixelFormat> GetPixelFormatsInternal()
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = processArguments.StartAndWaitForExit();
|
var result = processArguments.StartAndWaitForExit();
|
||||||
if (result.ExitCode != 0)
|
if (result.ExitCode != 0)
|
||||||
throw new FFMpegException(FFMpegExceptionType.Process, string.Join("\r\n", result.OutputData));
|
throw new FFMpegException(FFMpegExceptionType.Process, string.Join("\r\n", result.OutputData));
|
||||||
|
|
||||||
return list.AsReadOnly();
|
return list.AsReadOnly();
|
||||||
|
@ -361,7 +361,7 @@ private static void ParsePartOfCodecs(Dictionary<string, Codec> codecs, string a
|
||||||
processArguments.OutputDataReceived += (e, data) =>
|
processArguments.OutputDataReceived += (e, data) =>
|
||||||
{
|
{
|
||||||
var codec = parser(data);
|
var codec = parser(data);
|
||||||
if(codec != null)
|
if (codec != null)
|
||||||
if (codecs.TryGetValue(codec.Name, out var parentCodec))
|
if (codecs.TryGetValue(codec.Name, out var parentCodec))
|
||||||
parentCodec.Merge(codec);
|
parentCodec.Merge(codec);
|
||||||
else
|
else
|
||||||
|
@ -408,7 +408,7 @@ public static IReadOnlyList<Codec> GetCodecs(CodecType type)
|
||||||
{
|
{
|
||||||
if (!GlobalFFOptions.Current.UseCache)
|
if (!GlobalFFOptions.Current.UseCache)
|
||||||
return GetCodecsInternal().Values.Where(x => x.Type == type).ToList().AsReadOnly();
|
return GetCodecsInternal().Values.Where(x => x.Type == type).ToList().AsReadOnly();
|
||||||
return FFMpegCache.Codecs.Values.Where(x=>x.Type == type).ToList().AsReadOnly();
|
return FFMpegCache.Codecs.Values.Where(x => x.Type == type).ToList().AsReadOnly();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IReadOnlyList<Codec> GetVideoCodecs() => GetCodecs(CodecType.Video);
|
public static IReadOnlyList<Codec> GetVideoCodecs() => GetCodecs(CodecType.Video);
|
||||||
|
|
Loading…
Reference in a new issue