From d859f0746942c16a532768d903d1bff8a0d86760 Mon Sep 17 00:00:00 2001 From: ww-rm Date: Sat, 29 Mar 2025 23:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E8=BE=93=E5=87=BAffmpeg=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implementations/Exporter/GifExporter.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/SpineViewer/Exporter/Implementations/Exporter/GifExporter.cs b/SpineViewer/Exporter/Implementations/Exporter/GifExporter.cs index 7f74532..127a7f6 100644 --- a/SpineViewer/Exporter/Implementations/Exporter/GifExporter.cs +++ b/SpineViewer/Exporter/Implementations/Exporter/GifExporter.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using FFMpegCore.Arguments; +using System.Diagnostics; namespace SpineViewer.Exporter.Implementations.Exporter { @@ -30,12 +31,14 @@ namespace SpineViewer.Exporter.Implementations.Exporter var videoFramesSource = new RawVideoPipeSource(GetFrames(spinesToRender, worker)) { FrameRate = args.FPS }; try { - FFMpegArguments + var ffmpegArgs = FFMpegArguments .FromPipeInput(videoFramesSource) .OutputToFile(savePath, true, options => options .ForceFormat("gif") - .WithCustomArgument(args.FFMpegCoreCustomArguments)) - .ProcessSynchronously(); + .WithCustomArgument(args.FFMpegCoreCustomArguments)); + + logger.Info("FFMpeg arguments: {}", ffmpegArgs.Arguments); + ffmpegArgs.ProcessSynchronously(); } catch (Exception ex) { @@ -58,12 +61,14 @@ namespace SpineViewer.Exporter.Implementations.Exporter var videoFramesSource = new RawVideoPipeSource(GetFrames(spine, worker)) { FrameRate = args.FPS }; try { - FFMpegArguments + var ffmpegArgs = FFMpegArguments .FromPipeInput(videoFramesSource) .OutputToFile(savePath, true, options => options .ForceFormat("gif") - .WithCustomArgument(args.FFMpegCoreCustomArguments)) - .ProcessSynchronously(); + .WithCustomArgument(args.FFMpegCoreCustomArguments)); + + logger.Info("FFMpeg arguments: {}", ffmpegArgs.Arguments); + ffmpegArgs.ProcessSynchronously(); } catch (Exception ex) {