Files
ersatztv/ErsatzTV.Scanner/Core/FFmpeg/FFmpegPngService.cs
T
Jason DoveandGitHub 7b1edd9c54 add new scanner process (#1080)
* start moving local scans to separate process

* send progress updates to main process

* move scanners and tests

* simplify dependencies; sync search index

* commit search index more often when scanning

* support forced scan and cancellation

* use scanner process for plex libraries

* update changelog

* update dockerfiles

* fix search index for local folder scanning

* rework plex scanners

* rework scanner handlers

* emby works again

* sync jellyfin

* cleanup

* update build

* update changelog

* remove scanner dependency in pr and artifacts workflows

* fix mac sed syntax

* fix pr build
2022-12-30 12:53:05 -06:00

41 lines
1.3 KiB
C#

using CliWrap;
using ErsatzTV.Scanner.Core.Interfaces.FFmpeg;
namespace ErsatzTV.Scanner.Core.FFmpeg;
public class FFmpegPngService : IFFmpegPngService
{
public Command ConvertToPng(string ffmpegPath, string inputFile, string outputFile)
{
string[] arguments = {
"-threads", "1",
"-nostdin",
"-hide_banner", "-loglevel", "error", "-nostats",
"-i", inputFile,
"-f", "apng", "-y", outputFile
};
return Cli.Wrap(ffmpegPath)
.WithArguments(arguments)
.WithValidation(CommandResultValidation.None)
.WithStandardErrorPipe(PipeTarget.ToStream(Stream.Null));
}
public Command ExtractAttachedPicAsPng(string ffmpegPath, string inputFile, int streamIndex, string outputFile)
{
string[] arguments = {
"-threads", "1",
"-nostdin",
"-hide_banner", "-loglevel", "error", "-nostats",
"-i", inputFile,
"-map", $"0:{streamIndex}",
"-f", "apng", "-y", outputFile
};
return Cli.Wrap(ffmpegPath)
.WithArguments(arguments)
.WithValidation(CommandResultValidation.None)
.WithStandardErrorPipe(PipeTarget.ToStream(Stream.Null));
}
}