1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 av,
7 click,
8 numpy,
9 pytestCheckHook,
10 opencv-python,
11 platformdirs,
12 tqdm,
13 versionCheckHook,
14}:
15let
16 testsResources = fetchFromGitHub {
17 owner = "Breakthrough";
18 repo = "PySceneDetect";
19 rev = "94389267a344785643980a2e0bb18179dcca01d3";
20 hash = "sha256-7ws7F7CkEJAa0PgfMEOwnpF4Xl2BQCn9+qFQb5MMlZ0=";
21 };
22in
23buildPythonPackage rec {
24 pname = "scenedetect";
25 version = "0.6.6";
26 pyproject = true;
27
28 src = fetchFromGitHub {
29 owner = "Breakthrough";
30 repo = "PySceneDetect";
31 tag = "v${version}-release";
32 hash = "sha256-G5NLk6eOpclfrzzHad2KT3uZqydSJU0oF/4L2NIdZe0=";
33 };
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 av
39 click
40 numpy
41 opencv-python
42 platformdirs
43 tqdm
44 ];
45
46 pythonImportsCheck = [
47 "scenedetect"
48 ];
49
50 preCheck = ''
51 cp -r ${testsResources}/tests/resources tests/
52 chmod -R +w tests/resources
53 '';
54
55 nativeCheckInputs = [
56 pytestCheckHook
57 versionCheckHook
58 ];
59
60 versionCheckProgramArg = "version";
61
62 meta = {
63 description = "Python and OpenCV-based scene cut/transition detection program & library";
64 homepage = "https://www.scenedetect.com";
65 changelog = "https://github.com/Breakthrough/PySceneDetect/releases/tag/v${version}-release";
66 mainProgram = "scenedetect";
67 license = lib.licenses.bsd3;
68 maintainers = with lib.maintainers; [ DataHearth ];
69 };
70}