1
0
Fork 0

feat: 영상·오디오 Provider (FfmpegProvider) — FFmpeg 설치 시 활성화

FFMpegCore로 영상/오디오 변환·트랜스코딩·오디오 추출. ffmpeg/ffprobe가 없으면 NotReady로 비활성, PATH 또는 앱 폴더에 두면 자동 활성화(LGPL 분리 호출, 본체 미번들).

- 영상 mp4/mkv/webm/mov/avi/gif, 오디오 mp3/aac/m4a/opus/ogg/flac/wav N×M + 영상→오디오 추출
- ExternalToolDetector.TryFindFfmpeg (앱 폴더 + PATH 탐지)
- 진행률 best-effort (ffprobe duration 기반), 취소 전파
- 테스트 3개 + SSOT status 갱신 — 총 37개 통과
This commit is contained in:
Yun Chan 2026-06-01 13:24:50 +09:00
parent b76d51f3c1
commit 7235fc87f5
8 changed files with 182 additions and 13 deletions

View file

@ -0,0 +1,40 @@
using System.Linq;
using System.Threading.Tasks;
using Everything2Everything.Core;
using Everything2Everything.Core.Converters;
using Everything2Everything.Core.Providers;
using Xunit;
namespace Everything2Everything.Tests;
public class FfmpegProviderTests
{
[Fact]
public async Task WithoutFfmpeg_IsNotReady()
{
// 테스트 환경에 ffmpeg가 없다고 가정. 있으면 이 단언은 건너뜀.
if (ExternalToolDetector.TryFindFfmpeg(out _)) return;
var p = new FfmpegProvider();
var a = await p.CheckAvailabilityAsync();
Assert.False(a.IsReady);
Assert.NotNull(a.Reason);
}
[Fact]
public void Graph_HasVideoAndAudioEdges()
{
var graph = Everything2EverythingBootstrap.CreateDefault().Providers.Graph;
Assert.NotNull(graph.FindBestPath(".mp4", ".webm")); // 영상 트랜스코딩
Assert.NotNull(graph.FindBestPath(".wav", ".mp3")); // 오디오 변환
Assert.NotNull(graph.FindBestPath(".mp4", ".mp3")); // 영상→오디오 추출
}
[Fact]
public void Capability_DeclaresVideoAudioMatrix_NoSelfPairs()
{
var caps = new FfmpegProvider().Capability.SupportedConversions;
Assert.Contains(caps, c => c.InputExtension == ".mp4" && c.OutputExtension == ".mkv");
Assert.Contains(caps, c => c.InputExtension == ".flac" && c.OutputExtension == ".mp3");
Assert.DoesNotContain(caps, c => c.InputExtension == c.OutputExtension); // 자기쌍 없음
}
}