Rename {Chromaprint,FFmpegWrapper}.cs
This commit is contained in:
parent
bbed34b0e7
commit
fb6cd5c1d7
@ -14,7 +14,7 @@ public class TestAudioFingerprinting
|
|||||||
[FactSkipFFmpegTests]
|
[FactSkipFFmpegTests]
|
||||||
public void TestInstallationCheck()
|
public void TestInstallationCheck()
|
||||||
{
|
{
|
||||||
Assert.True(Chromaprint.CheckFFmpegVersion());
|
Assert.True(FFmpegWrapper.CheckFFmpegVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
@ -58,7 +58,7 @@ public class TestAudioFingerprinting
|
|||||||
3472417825, 3395841056, 3458735136, 3341420624, 1076496560, 1076501168, 1076501136, 1076497024
|
3472417825, 3395841056, 3458735136, 3341420624, 1076496560, 1076501168, 1076501136, 1076497024
|
||||||
};
|
};
|
||||||
|
|
||||||
var actual = Chromaprint.Fingerprint(queueEpisode("audio/big_buck_bunny_intro.mp3"));
|
var actual = FFmpegWrapper.Fingerprint(queueEpisode("audio/big_buck_bunny_intro.mp3"));
|
||||||
|
|
||||||
Assert.Equal(expected, actual);
|
Assert.Equal(expected, actual);
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ public class TestAudioFingerprinting
|
|||||||
{77, 5},
|
{77, 5},
|
||||||
};
|
};
|
||||||
|
|
||||||
var actual = Chromaprint.CreateInvertedIndex(Guid.NewGuid(), fpr);
|
var actual = FFmpegWrapper.CreateInvertedIndex(Guid.NewGuid(), fpr);
|
||||||
|
|
||||||
Assert.Equal(expected, actual);
|
Assert.Equal(expected, actual);
|
||||||
}
|
}
|
||||||
@ -90,8 +90,8 @@ public class TestAudioFingerprinting
|
|||||||
|
|
||||||
var lhsEpisode = queueEpisode("audio/big_buck_bunny_intro.mp3");
|
var lhsEpisode = queueEpisode("audio/big_buck_bunny_intro.mp3");
|
||||||
var rhsEpisode = queueEpisode("audio/big_buck_bunny_clip.mp3");
|
var rhsEpisode = queueEpisode("audio/big_buck_bunny_clip.mp3");
|
||||||
var lhsFingerprint = Chromaprint.Fingerprint(lhsEpisode);
|
var lhsFingerprint = FFmpegWrapper.Fingerprint(lhsEpisode);
|
||||||
var rhsFingerprint = Chromaprint.Fingerprint(rhsEpisode);
|
var rhsFingerprint = FFmpegWrapper.Fingerprint(rhsEpisode);
|
||||||
|
|
||||||
var (lhs, rhs) = task.CompareEpisodes(
|
var (lhs, rhs) = task.CompareEpisodes(
|
||||||
lhsEpisode.EpisodeId,
|
lhsEpisode.EpisodeId,
|
||||||
|
@ -58,7 +58,7 @@ public class TroubleshootingController : ControllerBase
|
|||||||
bundle.Append(" seasons");
|
bundle.Append(" seasons");
|
||||||
bundle.Append('\n');
|
bundle.Append('\n');
|
||||||
|
|
||||||
bundle.Append(Chromaprint.GetChromaprintLogs());
|
bundle.Append(FFmpegWrapper.GetChromaprintLogs());
|
||||||
|
|
||||||
return bundle.ToString();
|
return bundle.ToString();
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ public class VisualizationController : ControllerBase
|
|||||||
{
|
{
|
||||||
if (needle.EpisodeId == id)
|
if (needle.EpisodeId == id)
|
||||||
{
|
{
|
||||||
return Chromaprint.Fingerprint(needle);
|
return FFmpegWrapper.Fingerprint(needle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class Entrypoint : IServerEntryPoint
|
|||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
public Task RunAsync()
|
public Task RunAsync()
|
||||||
{
|
{
|
||||||
Chromaprint.Logger = _logger;
|
FFmpegWrapper.Logger = _logger;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
LogVersion();
|
LogVersion();
|
||||||
|
@ -9,9 +9,9 @@ using Microsoft.Extensions.Logging;
|
|||||||
namespace ConfusedPolarBear.Plugin.IntroSkipper;
|
namespace ConfusedPolarBear.Plugin.IntroSkipper;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wrapper for libchromaprint.
|
/// Wrapper for libchromaprint and the silencedetect filter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class Chromaprint
|
public static class FFmpegWrapper
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the logger.
|
/// Gets or sets the logger.
|
@ -40,7 +40,7 @@ public class QueueManager
|
|||||||
public void EnqueueAllEpisodes()
|
public void EnqueueAllEpisodes()
|
||||||
{
|
{
|
||||||
// Assert that ffmpeg with chromaprint is installed
|
// Assert that ffmpeg with chromaprint is installed
|
||||||
if (!Chromaprint.CheckFFmpegVersion())
|
if (!FFmpegWrapper.CheckFFmpegVersion())
|
||||||
{
|
{
|
||||||
throw new FingerprintException(
|
throw new FingerprintException(
|
||||||
"ffmpeg with chromaprint is not installed on this system - episodes will not be analyzed. If Jellyfin is running natively, install jellyfin-ffmpeg5. If Jellyfin is running in a container, upgrade it to the latest version of 10.8.0.");
|
"ffmpeg with chromaprint is not installed on this system - episodes will not be analyzed. If Jellyfin is running natively, install jellyfin-ffmpeg5. If Jellyfin is running in a container, upgrade it to the latest version of 10.8.0.");
|
||||||
|
@ -269,7 +269,7 @@ public class AnalyzeEpisodesTask : IScheduledTask
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fingerprintCache[episode.EpisodeId] = Chromaprint.Fingerprint(episode);
|
fingerprintCache[episode.EpisodeId] = FFmpegWrapper.Fingerprint(episode);
|
||||||
}
|
}
|
||||||
catch (FingerprintException ex)
|
catch (FingerprintException ex)
|
||||||
{
|
{
|
||||||
@ -436,8 +436,8 @@ public class AnalyzeEpisodesTask : IScheduledTask
|
|||||||
var rhsRanges = new List<TimeRange>();
|
var rhsRanges = new List<TimeRange>();
|
||||||
|
|
||||||
// Generate inverted indexes for the left and right episodes.
|
// Generate inverted indexes for the left and right episodes.
|
||||||
var lhsIndex = Chromaprint.CreateInvertedIndex(lhsId, lhsPoints);
|
var lhsIndex = FFmpegWrapper.CreateInvertedIndex(lhsId, lhsPoints);
|
||||||
var rhsIndex = Chromaprint.CreateInvertedIndex(rhsId, rhsPoints);
|
var rhsIndex = FFmpegWrapper.CreateInvertedIndex(rhsId, rhsPoints);
|
||||||
var indexShifts = new HashSet<int>();
|
var indexShifts = new HashSet<int>();
|
||||||
|
|
||||||
// For all audio points in the left episode, check if the right episode has a point which matches exactly.
|
// For all audio points in the left episode, check if the right episode has a point which matches exactly.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user