2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-04-15 01:41:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# build
|
|
|
|
, cython
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
# runtime
|
2023-11-16 04:20:00 +00:00
|
|
|
, ffmpeg_5-headless
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, numpy
|
|
|
|
, pillow
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "av";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "10.0.0";
|
2022-04-15 01:41:22 +00:00
|
|
|
format = "pyproject";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mikeboers";
|
|
|
|
repo = "PyAV";
|
|
|
|
rev = "v${version}";
|
2022-11-04 12:27:35 +00:00
|
|
|
hash = "sha256-XcHP8RwC2iwD64Jc7SS+t9OxjFTsz3FbrnjMgJnN7Ak=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython
|
|
|
|
pkg-config
|
2022-09-30 11:47:45 +00:00
|
|
|
setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
ffmpeg_5-headless
|
2022-04-15 01:41:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# ensure we import the built version
|
|
|
|
rm -r av
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# Tests that want to download FATE data
|
|
|
|
# https://github.com/PyAV-Org/PyAV/issues/955
|
|
|
|
"--deselect=tests/test_audiofifo.py::TestAudioFifo::test_data"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestCodecContext::test_codec_tag"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestCodecContext::test_parse"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_aac"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_dnxhd"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_dvvideo"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_h264"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_mjpeg"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_mp2"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_mpeg1video"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_mpeg4"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_pcm_s24le"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_png"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_tiff"
|
|
|
|
"--deselect=tests/test_codec_context.py::TestEncoding::test_encoding_xvid"
|
|
|
|
"--deselect=tests/test_decode.py::TestDecode::test_decode_audio_sample_count"
|
|
|
|
"--deselect=tests/test_decode.py::TestDecode::test_decoded_motion_vectors"
|
|
|
|
"--deselect=tests/test_decode.py::TestDecode::test_decoded_motion_vectors_no_flag"
|
|
|
|
"--deselect=tests/test_decode.py::TestDecode::test_decoded_time_base"
|
|
|
|
"--deselect=tests/test_decode.py::TestDecode::test_decoded_video_frame_count"
|
|
|
|
"--deselect=tests/test_encode.py::TestBasicAudioEncoding::test_transcode"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestAudioProbe::test_container_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestAudioProbe::test_stream_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestDataProbe::test_container_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestDataProbe::test_stream_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestSubtitleProbe::test_container_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestSubtitleProbe::test_stream_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestVideoProbe::test_container_probing"
|
|
|
|
"--deselect=tests/test_file_probing.py::TestVideoProbe::test_stream_probing"
|
|
|
|
"--deselect=tests/test_python_io.py::TestPythonIO::test_reading_from_buffer"
|
|
|
|
"--deselect=tests/test_python_io.py::TestPythonIO::test_reading_from_buffer_no_see"
|
|
|
|
"--deselect=tests/test_python_io.py::TestPythonIO::test_reading_from_file"
|
|
|
|
"--deselect=tests/test_python_io.py::TestPythonIO::test_reading_from_pipe_readonly"
|
|
|
|
"--deselect=tests/test_python_io.py::TestPythonIO::test_reading_from_write_readonl"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_decode_half"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_seek_end"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_seek_float"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_seek_int64"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_seek_middle"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_seek_start"
|
|
|
|
"--deselect=tests/test_seek.py::TestSeek::test_stream_seek"
|
|
|
|
"--deselect=tests/test_streams.py::TestStreams::test_selection"
|
|
|
|
"--deselect=tests/test_streams.py::TestStreams::test_stream_tuples"
|
|
|
|
"--deselect=tests/test_subtitles.py::TestSubtitle::test_movtext"
|
|
|
|
"--deselect=tests/test_subtitles.py::TestSubtitle::test_vobsub"
|
|
|
|
"--deselect=tests/test_videoframe.py::TestVideoFrameImage::test_roundtrip"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
disabledTests = [
|
|
|
|
# urlopen fails during DNS resolution
|
|
|
|
"test_writing_to_custom_io"
|
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# urlopen fails during DNS resolution
|
|
|
|
"tests/test_doctests.py"
|
|
|
|
"tests/test_timeout.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"av"
|
|
|
|
"av.audio"
|
|
|
|
"av.buffer"
|
|
|
|
"av.bytesource"
|
|
|
|
"av.codec"
|
|
|
|
"av.container"
|
|
|
|
"av._core"
|
|
|
|
"av.datasets"
|
|
|
|
"av.descriptor"
|
|
|
|
"av.dictionary"
|
|
|
|
"av.enum"
|
|
|
|
"av.error"
|
|
|
|
"av.filter"
|
|
|
|
"av.format"
|
|
|
|
"av.frame"
|
|
|
|
"av.logging"
|
|
|
|
"av.option"
|
|
|
|
"av.packet"
|
|
|
|
"av.plane"
|
|
|
|
"av.stream"
|
|
|
|
"av.subtitles"
|
|
|
|
"av.utils"
|
|
|
|
"av.video"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Pythonic bindings for FFmpeg/Libav";
|
|
|
|
homepage = "https://github.com/mikeboers/PyAV/";
|
2022-04-15 01:41:22 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|