1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 replaceVars,
6 fetchpatch2,
7 setuptools,
8 pytestCheckHook,
9 pytest-mock,
10 ffmpeg,
11}:
12
13buildPythonPackage {
14 pname = "ffmpeg-python";
15 version = "0.2.0-unstable-2022-07-11";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "kkroening";
20 repo = "ffmpeg-python";
21 rev = "df129c7ba30aaa9ffffb81a48f53aa7253b0b4e6";
22 hash = "sha256-jPiFhYRwfuS+vo6LsLw0+65NWy2A+B+EdC8SewZTRP4=";
23 };
24
25 patches = [
26 (replaceVars ./ffmpeg-location.patch { inherit ffmpeg; })
27
28 # Remove dependency on `future`
29 # https://github.com/kkroening/ffmpeg-python/pull/795
30 (fetchpatch2 {
31 url = "https://github.com/kkroening/ffmpeg-python/commit/dce459d39ace25f03edbabdad1735064787568f7.patch?full_index=1";
32 hash = "sha256-ZptCFplL88d0p2s741ymHiwyDsDGVFylBJ8FTrZDGMc=";
33 })
34
35 # Fix ffmpeg/tests/test_ffmpeg.py: test_pipe() (v1: ignore duplicate frames)
36 # https://github.com/kkroening/ffmpeg-python/pull/726
37 (fetchpatch2 {
38 url = "https://github.com/kkroening/ffmpeg-python/commit/557ed8e81ff48c5931c9249ec4aae525347ecf85.patch?full_index=1";
39 hash = "sha256-XrL9yLaBg1tu63OYZauEb/4Ghp2zHtiF6vB+1YYbv1Y=";
40 })
41
42 # Fix `test__probe` on FFmpeg 7
43 # https://github.com/kkroening/ffmpeg-python/pull/848
44 (fetchpatch2 {
45 url = "https://github.com/kkroening/ffmpeg-python/commit/eeaa83398ba1d4e5b470196f7d4c7ca4ba9e8ddf.patch?full_index=1";
46 hash = "sha256-/qxez4RF/RPRr9nA+wp+XB49L3VNgnMwMQhFD2NwijU=";
47 })
48 ];
49
50 build-system = [ setuptools ];
51
52 nativeCheckInputs = [
53 pytestCheckHook
54 pytest-mock
55 ];
56
57 pythonImportsCheck = [ "ffmpeg" ];
58
59 meta = {
60 description = "Python bindings for FFmpeg - with complex filtering support";
61 homepage = "https://github.com/kkroening/ffmpeg-python";
62 license = lib.licenses.asl20;
63 maintainers = [ lib.maintainers.emily ];
64 };
65}