cutcutcodec 1.2.2__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cutcutcodec-1.2.2/cutcutcodec.egg-info → cutcutcodec-1.2.4}/PKG-INFO +11 -18
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/README.rst +7 -6
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/c_build.py +3 -4
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/__init__.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/__main__.py +2 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/config/config.py +3 -3
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/__init__.py +24 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/_helper_properties.py +2 -2
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/audio/__init__.py +8 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/audio/properties/__init__.py +8 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/audio/properties/duration.py +1 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/ffprobe.py +14 -7
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/graph/time_backprop.py +2 -3
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/stream/__init__.py +9 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/stream/rate_audio.py +3 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/stream/rate_video.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/stream/shape.py +7 -21
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/stream/time_backprop.py +11 -12
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/__init__.py +12 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/metric/__init__.py +260 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/metric/metric.c +596 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/metric/psnr_torch.py +52 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/metric/ssim_torch.py +224 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/metric/utils.py +57 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/metric/vmaf.py +161 -0
- cutcutcodec-1.2.4/cutcutcodec/core/analysis/video/properties/__init__.py +11 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/video/properties/duration.py +2 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/video/properties/nb_frames.py +2 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/video/properties/rate.py +2 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/video/properties/timestamps.py +7 -7
- cutcutcodec-1.2.4/cutcutcodec/core/classes/colorspace.py +237 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/encoder.py +6 -7
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/filter.py +1 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/frame.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/frame_audio.py +3 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/frame_video.py +57 -56
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/layout.py +1 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/node.py +40 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/stream.py +26 -16
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/stream_video.py +10 -10
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/colorspace/__init__.py +0 -4
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/colorspace/cst.py +30 -10
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/colorspace/func.py +105 -101
- cutcutcodec-1.2.4/cutcutcodec/core/colorspace/heuristic.py +44 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/ast_to_file.py +1 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/export/compatibility.py +8 -13
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/export/rate.py +5 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/parse.py +2 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +31 -31
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +10 -11
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +2 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/printer.py +6 -6
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/tree_to_graph.py +4 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/factor/proba.py +1 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/operation/remove.py +9 -9
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/add.py +1 -8
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/cut.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/equation.py +4 -6
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/fir.py +1 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/wiener.py +2 -9
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/mix/audio_cast.py +2 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/mix/video_cast.py +14 -14
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/subclip.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/add.py +15 -22
- cutcutcodec-1.2.4/cutcutcodec/core/filter/video/blur.py +81 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/colorspace.py +38 -22
- cutcutcodec-1.2.4/cutcutcodec/core/filter/video/custom.py +89 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/cut.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/equation.py +35 -37
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/pad.py +3 -4
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/patch.py +4 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/resize.py +19 -19
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/speed.py +2 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/audio/empty.py +1 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/audio/equation.py +2 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/audio/noise.py +2 -4
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/empty.py +3 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/equation.py +4 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/fractal/mandelbrot.py +5 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/noise.py +3 -3
- cutcutcodec-1.2.4/cutcutcodec/core/io/__init__.py +119 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/cst.py +2 -1
- cutcutcodec-1.2.4/cutcutcodec/core/io/framecaster.c +322 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/pix_map.py +29 -28
- cutcutcodec-1.2.4/cutcutcodec/core/io/read_color.py +28 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/read_ffmpeg.py +86 -54
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/read_image.py +71 -72
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/read_svg.py +4 -4
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/scheduler.py +3 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/io/write_ffmpeg.py +15 -14
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/dataaug/image.py +2 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/loader.py +16 -16
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/basic.py +4 -2
- cutcutcodec-1.2.4/cutcutcodec/core/opti/cache/hashable.py +14 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/hashes/graph.py +2 -5
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/singleton.py +3 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/parallel/buffer.py +14 -16
- cutcutcodec-1.2.4/cutcutcodec/core/opti/parallel/threading.h +34 -0
- cutcutcodec-1.2.4/cutcutcodec/core/opti/parallel/threading.py +63 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/signal/window.py +6 -26
- cutcutcodec-1.2.4/cutcutcodec/doc.py +41 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/examples/project.json +4 -4
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/abstract.py +6 -38
- cutcutcodec-1.2.4/cutcutcodec/testing/tests/framecaster.py +310 -0
- cutcutcodec-1.2.4/cutcutcodec/testing/tests/metric.py +176 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/nan_snapshot.py +1 -2
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/write.py +9 -8
- cutcutcodec-1.2.4/cutcutcodec/utils.h +33 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/utils.py +10 -3
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4/cutcutcodec.egg-info}/PKG-INFO +11 -18
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec.egg-info/SOURCES.txt +20 -8
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec.egg-info/entry_points.txt +3 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec.egg-info/requires.txt +0 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec.egg-info/top_level.txt +0 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/pyproject.toml +6 -4
- cutcutcodec-1.2.2/cutcutcodec/core/analysis/__init__.py +0 -3
- cutcutcodec-1.2.2/cutcutcodec/core/analysis/audio/__init__.py +0 -3
- cutcutcodec-1.2.2/cutcutcodec/core/analysis/audio/properties/__init__.py +0 -3
- cutcutcodec-1.2.2/cutcutcodec/core/analysis/stream/__init__.py +0 -3
- cutcutcodec-1.2.2/cutcutcodec/core/analysis/video/__init__.py +0 -3
- cutcutcodec-1.2.2/cutcutcodec/core/analysis/video/properties/__init__.py +0 -3
- cutcutcodec-1.2.2/cutcutcodec/core/io/__init__.py +0 -74
- cutcutcodec-1.2.2/cutcutcodec/core/io/read_ffmpeg_color.py +0 -73
- cutcutcodec-1.2.2/cutcutcodec/core/signal/metric.c +0 -578
- cutcutcodec-1.2.2/docs/build/html/_static/check-solid.svg +0 -4
- cutcutcodec-1.2.2/docs/build/html/_static/copy-button.svg +0 -5
- cutcutcodec-1.2.2/docs/build/html/_static/css/fonts/fontawesome-webfont.svg +0 -2671
- cutcutcodec-1.2.2/docs/build/html/_static/nbsphinx-broken-thumbnail.svg +0 -9
- cutcutcodec-1.2.2/docs/build/html/_static/nbsphinx-no-thumbnail.svg +0 -9
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/LICENSE +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/config/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/graph/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/graph/find.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/container.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/meta_filter.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/muxer.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/classes/stream_audio.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/export/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/export/default.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/export/encodec.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/export/muxer.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/graph_to_ast.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/graph_to_json.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/graph_to_tree.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/json_to_graph.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/memory_check.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/compilation/sympy_to_torch/printer_atom.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/decision/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/factor/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/generalize/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/generalize/delay_to_fir.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/operation/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/edit/operation/add.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/exceptions.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/cat.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/delay.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/resample.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/audio/subclip.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/cut.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/identity.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/mix/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/cat.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/delay.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/filter/video/subclip.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/audio/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/fractal/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/fractal/fractal.c +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/generation/video/fractal/geometry.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/interfaces/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/interfaces/seedable.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/dataaug/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/model/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/model/compression/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/nn/model/compression/img_cgavaenn.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/clean/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/clean/graph.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cache/hashes/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/cuda/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/graph.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/parallel/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/opti/utils.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/signal/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/signal/psd.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/examples/intro.webm +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/examples/logo.png +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/examples/logo.svg +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/examples/video.mp4 +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/__init__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/__main__.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/coding_style.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/install.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/run.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/audio_cast.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/audio_equation.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/c_memory.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/colorspace.py +1 -1
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/compatibility.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/encoder.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/filter_cut.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/filter_delay.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/filter_empty.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/fir.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/initialisation.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/mandelbrot.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/muxer.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/pad.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/read.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/sympy_to_torch.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/thread_safe.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/testing/tests/video_equation.py +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec.egg-info/dependency_links.txt +0 -0
- {cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/setup.cfg +0 -0
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: cutcutcodec
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: video editing software
|
|
5
5
|
Author-email: "Robin RICHARD (robinechuca)" <serveurpython.oz@gmail.com>
|
|
6
6
|
Maintainer-email: "Robin RICHARD (robinechuca)" <serveurpython.oz@gmail.com>
|
|
7
|
-
License:
|
|
8
|
-
|
|
9
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files of cutcutcodec, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14
|
-
|
|
7
|
+
License-Expression: MIT
|
|
15
8
|
Project-URL: Homepage, https://framagit.org/robinechuca/cutcutcodec/-/blob/main/README.rst
|
|
16
9
|
Project-URL: Documentation, https://cutcutcodec.readthedocs.io/latest/
|
|
17
10
|
Project-URL: Repository, https://framagit.org/robinechuca/cutcutcodec/
|
|
@@ -23,7 +16,6 @@ Classifier: Intended Audience :: Developers
|
|
|
23
16
|
Classifier: Intended Audience :: Education
|
|
24
17
|
Classifier: Intended Audience :: End Users/Desktop
|
|
25
18
|
Classifier: Intended Audience :: Science/Research
|
|
26
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
27
19
|
Classifier: Natural Language :: English
|
|
28
20
|
Classifier: Operating System :: POSIX :: Linux
|
|
29
21
|
Classifier: Programming Language :: C
|
|
@@ -63,7 +55,6 @@ Requires-Dist: sympy>=1.10
|
|
|
63
55
|
Requires-Dist: torch>=2.1
|
|
64
56
|
Requires-Dist: tqdm
|
|
65
57
|
Requires-Dist: unidecode
|
|
66
|
-
Requires-Dist: wand
|
|
67
58
|
Provides-Extra: doc
|
|
68
59
|
Requires-Dist: ipykernel; extra == "doc"
|
|
69
60
|
Requires-Dist: mathjax; extra == "doc"
|
|
@@ -84,6 +75,7 @@ Requires-Dist: pytest; extra == "test"
|
|
|
84
75
|
Provides-Extra: gui
|
|
85
76
|
Requires-Dist: jupyter; extra == "gui"
|
|
86
77
|
Requires-Dist: matplotlib; extra == "gui"
|
|
78
|
+
Dynamic: license-file
|
|
87
79
|
|
|
88
80
|
.. rst syntax: https://deusyss.developpez.com/tutoriels/Python/SphinxDoc/
|
|
89
81
|
.. version conv: https://peps.python.org/pep-0440/
|
|
@@ -118,7 +110,7 @@ Requires-Dist: matplotlib; extra == "gui"
|
|
|
118
110
|
Useful links:
|
|
119
111
|
`Binary Installers <https://pypi.org/project/cutcutcodec>`_ |
|
|
120
112
|
`Source Repository <https://framagit.org/robinechuca/cutcutcodec>`_ |
|
|
121
|
-
`Online Documentation <https://cutcutcodec.readthedocs.io>`_ |
|
|
113
|
+
`Online Documentation <https://cutcutcodec.readthedocs.io/stable>`_ |
|
|
122
114
|
|
|
123
115
|
|
|
124
116
|
Description
|
|
@@ -148,7 +140,7 @@ Audio
|
|
|
148
140
|
|
|
149
141
|
* General properties
|
|
150
142
|
#. Supports a large number of channels (mono, stereo, 5.1, 7.1, ...) with all sampeling rate.
|
|
151
|
-
#. Automatic detection of the optimal sample frequency.
|
|
143
|
+
#. Automatic detection of the optimal sample frequency based on shannon theory.
|
|
152
144
|
* Generation
|
|
153
145
|
#. White-noise generation.
|
|
154
146
|
#. Generate any audio signal from any equation.
|
|
@@ -157,15 +149,15 @@ Audio
|
|
|
157
149
|
#. Add multiple tracks.
|
|
158
150
|
#. Arbitrary equation on several channels of several tracks. (dynamic volume, mixing, wouawoua, ...)
|
|
159
151
|
#. Finite Impulse Response (FIR) invariant filter. (reverb, equalizer, echo, delay, volume, ...)
|
|
160
|
-
#. Denoising based on Winer filtering.
|
|
152
|
+
#. Denoising based on optimal Winer filtering.
|
|
161
153
|
#. Hight quality anti aliasing low pass filter (based on FIR).
|
|
162
154
|
|
|
163
155
|
Video
|
|
164
156
|
-----
|
|
165
157
|
|
|
166
158
|
* General properties
|
|
167
|
-
#. Unlimited support of all image resolutions. (FULL HD, 4K, 8K, ...)
|
|
168
|
-
#. No limit on fps. (
|
|
159
|
+
#. Unlimited support of all image resolutions. (SD, FULL HD, 4K, 8K, ...)
|
|
160
|
+
#. No limit on fps. (3000/1001 fps, 60 fps, 120 fps, ...)
|
|
169
161
|
#. Automatic detection of the optimal resolution and fps.
|
|
170
162
|
#. Support for the alpha transparency layer.
|
|
171
163
|
#. Floating-point image calculation for greater accuracy.
|
|
@@ -178,4 +170,5 @@ Video
|
|
|
178
170
|
#. Resize and crop (high quality, no aliasing).
|
|
179
171
|
#. Overlaying video tracks (with transparency control).
|
|
180
172
|
#. Apply an arbitrary equation one several video streams.
|
|
181
|
-
#. Fast C implementation of the ``psnr``, ``
|
|
173
|
+
#. Fast C and fft implementation of the ``psnr``, ``ssim`` and ``vmaf`` metrics.
|
|
174
|
+
#. All gamut and gamma colorspace conversion. (sRGB, BT709, BT2020, ...)
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
Useful links:
|
|
32
32
|
`Binary Installers <https://pypi.org/project/cutcutcodec>`_ |
|
|
33
33
|
`Source Repository <https://framagit.org/robinechuca/cutcutcodec>`_ |
|
|
34
|
-
`Online Documentation <https://cutcutcodec.readthedocs.io>`_ |
|
|
34
|
+
`Online Documentation <https://cutcutcodec.readthedocs.io/stable>`_ |
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
Description
|
|
@@ -61,7 +61,7 @@ Audio
|
|
|
61
61
|
|
|
62
62
|
* General properties
|
|
63
63
|
#. Supports a large number of channels (mono, stereo, 5.1, 7.1, ...) with all sampeling rate.
|
|
64
|
-
#. Automatic detection of the optimal sample frequency.
|
|
64
|
+
#. Automatic detection of the optimal sample frequency based on shannon theory.
|
|
65
65
|
* Generation
|
|
66
66
|
#. White-noise generation.
|
|
67
67
|
#. Generate any audio signal from any equation.
|
|
@@ -70,15 +70,15 @@ Audio
|
|
|
70
70
|
#. Add multiple tracks.
|
|
71
71
|
#. Arbitrary equation on several channels of several tracks. (dynamic volume, mixing, wouawoua, ...)
|
|
72
72
|
#. Finite Impulse Response (FIR) invariant filter. (reverb, equalizer, echo, delay, volume, ...)
|
|
73
|
-
#. Denoising based on Winer filtering.
|
|
73
|
+
#. Denoising based on optimal Winer filtering.
|
|
74
74
|
#. Hight quality anti aliasing low pass filter (based on FIR).
|
|
75
75
|
|
|
76
76
|
Video
|
|
77
77
|
-----
|
|
78
78
|
|
|
79
79
|
* General properties
|
|
80
|
-
#. Unlimited support of all image resolutions. (FULL HD, 4K, 8K, ...)
|
|
81
|
-
#. No limit on fps. (
|
|
80
|
+
#. Unlimited support of all image resolutions. (SD, FULL HD, 4K, 8K, ...)
|
|
81
|
+
#. No limit on fps. (3000/1001 fps, 60 fps, 120 fps, ...)
|
|
82
82
|
#. Automatic detection of the optimal resolution and fps.
|
|
83
83
|
#. Support for the alpha transparency layer.
|
|
84
84
|
#. Floating-point image calculation for greater accuracy.
|
|
@@ -91,4 +91,5 @@ Video
|
|
|
91
91
|
#. Resize and crop (high quality, no aliasing).
|
|
92
92
|
#. Overlaying video tracks (with transparency control).
|
|
93
93
|
#. Apply an arbitrary equation one several video streams.
|
|
94
|
-
#. Fast C implementation of the ``psnr``, ``
|
|
94
|
+
#. Fast C and fft implementation of the ``psnr``, ``ssim`` and ``vmaf`` metrics.
|
|
95
|
+
#. All gamut and gamma colorspace conversion. (sRGB, BT709, BT2020, ...)
|
|
@@ -36,11 +36,10 @@ class Build(_build_py):
|
|
|
36
36
|
rules = get_compilation_rules()
|
|
37
37
|
root = get_project_root()
|
|
38
38
|
for file in (
|
|
39
|
-
file_root / basename
|
|
40
|
-
for file_root, _, files in root.walk()
|
|
41
|
-
for basename in files
|
|
42
|
-
if basename.endswith(".c")
|
|
39
|
+
file_root / basename for file_root, _, files in root.walk() for basename in files
|
|
43
40
|
):
|
|
41
|
+
if file.suffix.lower() not in {".cc", ".c", ".c++", ".cp", ".cxx", ".cpp"}:
|
|
42
|
+
continue
|
|
44
43
|
file = file.relative_to(root.parent)
|
|
45
44
|
self.distribution.ext_modules.append(
|
|
46
45
|
Extension(".".join(file.with_suffix("").parts), sources=[str(file)], **rules)
|
|
@@ -7,6 +7,7 @@ import sys
|
|
|
7
7
|
import click
|
|
8
8
|
|
|
9
9
|
from cutcutcodec import __version__
|
|
10
|
+
from cutcutcodec.doc import main as main_doc
|
|
10
11
|
from cutcutcodec.testing.__main__ import main as main_test
|
|
11
12
|
from cutcutcodec.utils import get_project_root
|
|
12
13
|
|
|
@@ -29,6 +30,7 @@ def main(ctx=None, version: bool = False):
|
|
|
29
30
|
)
|
|
30
31
|
|
|
31
32
|
|
|
33
|
+
main.add_command(main_doc, "doc")
|
|
32
34
|
main.add_command(main_test, "test")
|
|
33
35
|
|
|
34
36
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import configparser
|
|
6
6
|
import pathlib
|
|
7
|
-
import typing
|
|
8
7
|
|
|
9
8
|
from cutcutcodec.core.colorspace.cst import PRIMARIES, TRC
|
|
10
9
|
from cutcutcodec.utils import MetaSingleton
|
|
@@ -44,7 +43,7 @@ class Config(metaclass=MetaSingleton):
|
|
|
44
43
|
|
|
45
44
|
def __init__(
|
|
46
45
|
self,
|
|
47
|
-
config_file:
|
|
46
|
+
config_file: pathlib.Path | str | bytes = "~/.config/cutcutcodec/conf.ini"
|
|
48
47
|
):
|
|
49
48
|
"""Initialise the configuration from the file.
|
|
50
49
|
|
|
@@ -55,10 +54,11 @@ class Config(metaclass=MetaSingleton):
|
|
|
55
54
|
"""
|
|
56
55
|
self._config = configparser.ConfigParser()
|
|
57
56
|
self._config["colorspace"] = { # default values
|
|
58
|
-
"target-prim": "
|
|
57
|
+
"target-prim": "srgb",
|
|
59
58
|
"target-trc": "srgb",
|
|
60
59
|
"working-prim": "bt709",
|
|
61
60
|
}
|
|
61
|
+
# see 'colormgr get-devices' to autodetect screen colorspace
|
|
62
62
|
config_file = pathlib.Path(config_file).expanduser().resolve()
|
|
63
63
|
if config_file.is_file():
|
|
64
64
|
self._config.read(config_file)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Explore data to extract information."""
|
|
4
|
+
|
|
5
|
+
# from .audio import get_duration_audio
|
|
6
|
+
# from .ffprobe import get_metadata, get_slices_metadata, get_streams_type
|
|
7
|
+
# from .video import (
|
|
8
|
+
# get_duration_video, get_nb_frames, get_rate_video, get_timestamps_video, psnr, ssim, vmaf
|
|
9
|
+
# )
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# __all__ = [
|
|
13
|
+
# "get_duration_audio",
|
|
14
|
+
# "get_duration_video",
|
|
15
|
+
# "get_metadata",
|
|
16
|
+
# "get_nb_frames",
|
|
17
|
+
# "get_rate_video",
|
|
18
|
+
# "get_slices_metadata",
|
|
19
|
+
# "get_streams_type",
|
|
20
|
+
# "get_timestamps_video",
|
|
21
|
+
# "psnr",
|
|
22
|
+
# "ssim",
|
|
23
|
+
# "vmaf",
|
|
24
|
+
# ]
|
|
@@ -13,14 +13,14 @@ import typing
|
|
|
13
13
|
from cutcutcodec.core.exceptions import MissingStreamError, MissingInformation
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
def _check_pathexists_index(filename:
|
|
16
|
+
def _check_pathexists_index(filename: pathlib.Path | str | bytes, index: int) -> None:
|
|
17
17
|
assert pathlib.Path(filename).exists(), filename
|
|
18
18
|
assert isinstance(index, numbers.Integral), index.__class__.__name__
|
|
19
19
|
assert index >= 0, index
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
def _mix_and_check(
|
|
23
|
-
backend: typing.
|
|
23
|
+
backend: typing.Optional[str], accurate: bool, args: tuple, funcs: collections.OrderedDict
|
|
24
24
|
) -> typing.Any:
|
|
25
25
|
|
|
26
26
|
# checks
|
{cutcutcodec-1.2.2 → cutcutcodec-1.2.4}/cutcutcodec/core/analysis/audio/properties/duration.py
RENAMED
|
@@ -8,7 +8,6 @@ This allows not only the characteristics of the files but also the tags if there
|
|
|
8
8
|
from fractions import Fraction
|
|
9
9
|
import collections
|
|
10
10
|
import pathlib
|
|
11
|
-
import typing
|
|
12
11
|
|
|
13
12
|
from cutcutcodec.core.analysis._helper_properties import _check_pathexists_index, _mix_and_check
|
|
14
13
|
from cutcutcodec.core.analysis.ffprobe import (_decode_duration_ffmpeg, _estimate_duration_ffmpeg,
|
|
@@ -16,7 +15,7 @@ from cutcutcodec.core.analysis.ffprobe import (_decode_duration_ffmpeg, _estimat
|
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
def get_duration_audio(
|
|
19
|
-
filename:
|
|
18
|
+
filename: pathlib.Path | str | bytes,
|
|
20
19
|
index: int = 0,
|
|
21
20
|
*,
|
|
22
21
|
accurate: bool = False,
|
|
@@ -8,7 +8,6 @@ import numbers
|
|
|
8
8
|
import pathlib
|
|
9
9
|
import re
|
|
10
10
|
import subprocess
|
|
11
|
-
import typing
|
|
12
11
|
|
|
13
12
|
import numpy as np
|
|
14
13
|
import tqdm
|
|
@@ -75,7 +74,7 @@ def _decode_duration_ffmpeg(filename: str, index: int, accurate: bool) -> Fracti
|
|
|
75
74
|
|
|
76
75
|
def _decode_timestamps_ffmpeg(
|
|
77
76
|
filename: str, index: int
|
|
78
|
-
) -> np.ndarray[
|
|
77
|
+
) -> np.ndarray[None | Fraction]:
|
|
79
78
|
"""Retrieve the exact position of the frames in a stream.
|
|
80
79
|
|
|
81
80
|
Examples
|
|
@@ -246,8 +245,16 @@ def _estimate_rate_ffmpeg(filename: str, index: int, *, _indirect=True) -> Fract
|
|
|
246
245
|
)
|
|
247
246
|
|
|
248
247
|
|
|
249
|
-
def _get_streams_type(filename:
|
|
248
|
+
def _get_streams_type(filename: pathlib.Path) -> list[str]:
|
|
250
249
|
"""Help ``get_streams_type``."""
|
|
250
|
+
# optional shortcut
|
|
251
|
+
from cutcutcodec.core.io.cst import AUDIO_SUFFIXES, IMAGE_SUFFIXES # pylint: disable=C0415
|
|
252
|
+
if filename.suffix.lower() in IMAGE_SUFFIXES:
|
|
253
|
+
return ["video"]
|
|
254
|
+
if filename.suffix.lower() in AUDIO_SUFFIXES:
|
|
255
|
+
return ["audio"]
|
|
256
|
+
|
|
257
|
+
# rigourus way
|
|
251
258
|
cmd = [
|
|
252
259
|
"ffprobe", "-v", "error",
|
|
253
260
|
"-show_entries", "stream=index,codec_type",
|
|
@@ -333,7 +340,7 @@ def _map_index_rel_to_abs(filename: str, index: int, stream_type: str) -> int:
|
|
|
333
340
|
|
|
334
341
|
|
|
335
342
|
def get_metadata(
|
|
336
|
-
filename:
|
|
343
|
+
filename: pathlib.Path | str | bytes, ignore_errors=False
|
|
337
344
|
) -> dict[str]:
|
|
338
345
|
"""Call ``ffprobe`` and parse the result as a dictionary.
|
|
339
346
|
|
|
@@ -414,7 +421,7 @@ def get_metadata(
|
|
|
414
421
|
|
|
415
422
|
|
|
416
423
|
def get_slices_metadata(
|
|
417
|
-
filename:
|
|
424
|
+
filename: pathlib.Path | str | bytes, slice_type: str = "frame"
|
|
418
425
|
) -> tuple[list[list[str]], list[np.ndarray]]:
|
|
419
426
|
"""Get the packets informations for all streams.
|
|
420
427
|
|
|
@@ -555,7 +562,7 @@ def get_slices_metadata(
|
|
|
555
562
|
|
|
556
563
|
|
|
557
564
|
def get_streams_type(
|
|
558
|
-
filename:
|
|
565
|
+
filename: pathlib.Path | str | bytes, ignore_errors=False
|
|
559
566
|
) -> list[str]:
|
|
560
567
|
"""Retrieve in order the stream types present in the file.
|
|
561
568
|
|
|
@@ -598,7 +605,7 @@ def get_streams_type(
|
|
|
598
605
|
raise err
|
|
599
606
|
|
|
600
607
|
|
|
601
|
-
def parse_duration(duration:
|
|
608
|
+
def parse_duration(duration: numbers.Real | str) -> None | Fraction:
|
|
602
609
|
"""Try to convert a duration information into a fraction in second.
|
|
603
610
|
|
|
604
611
|
Parameters
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
from fractions import Fraction
|
|
6
6
|
import math
|
|
7
|
-
import typing
|
|
8
7
|
|
|
9
8
|
import networkx
|
|
10
9
|
|
|
@@ -17,8 +16,8 @@ def time_backprop(
|
|
|
17
16
|
graph: networkx.MultiDiGraph,
|
|
18
17
|
edge: tuple[str, str, str],
|
|
19
18
|
t_min: Fraction,
|
|
20
|
-
t_max:
|
|
21
|
-
) -> tuple[tuple[str, str, str], tuple[Fraction,
|
|
19
|
+
t_max: Fraction | float,
|
|
20
|
+
) -> tuple[tuple[str, str, str], tuple[Fraction, Fraction | float]]:
|
|
22
21
|
"""Graph version of ``cutcutcodec.core.analysis.stream.time_backprop.time_backprop``.
|
|
23
22
|
|
|
24
23
|
Parameters
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Probe the assembly graph by retropropagation to glean certain information."""
|
|
4
|
+
|
|
5
|
+
from .rate_audio import optimal_rate_audio
|
|
6
|
+
from .rate_video import optimal_rate_video
|
|
7
|
+
from .shape import optimal_shape_video
|
|
8
|
+
|
|
9
|
+
__all__ = ["optimal_rate_audio", "optimal_rate_video", "optimal_shape_video"]
|
|
@@ -35,7 +35,7 @@ def _add_estimator(node_cls: type) -> callable:
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
def _eq_estimate_freq_max(
|
|
38
|
-
signal, t_symb: Symbol, t_min: Fraction, t_max:
|
|
38
|
+
signal, t_symb: Symbol, t_min: Fraction, t_max: Fraction | float
|
|
39
39
|
) -> float:
|
|
40
40
|
"""Recursive delegation (parallelization is slower)."""
|
|
41
41
|
if t_symb not in signal.free_symbols: # facultative, optimisation
|
|
@@ -132,7 +132,7 @@ def _optimal_rate_container_input_ffmpeg(stream: StreamAudio, *_) -> int:
|
|
|
132
132
|
|
|
133
133
|
@_add_estimator(GeneratorAudioEquation)
|
|
134
134
|
def _optimal_rate_generator_audio_equation(
|
|
135
|
-
stream: StreamAudio, t_min: Fraction, t_max:
|
|
135
|
+
stream: StreamAudio, t_min: Fraction, t_max: Fraction | float
|
|
136
136
|
) -> int:
|
|
137
137
|
"""Detect the rate of a GeneratorAudioEquation stream.
|
|
138
138
|
|
|
@@ -201,7 +201,7 @@ def _optimal_rate_generator_audio_noise(stream: StreamAudio, *_) -> int:
|
|
|
201
201
|
def optimal_rate_audio(
|
|
202
202
|
stream: StreamAudio,
|
|
203
203
|
t_min: typing.Optional[Fraction] = None,
|
|
204
|
-
t_max: typing.Optional[
|
|
204
|
+
t_max: typing.Optional[Fraction | float] = None,
|
|
205
205
|
) -> int:
|
|
206
206
|
"""Find the optimal sampling rate for a given audio stream.
|
|
207
207
|
|
|
@@ -41,7 +41,7 @@ def _optimal_rate_container_input_ffmpeg(stream: StreamVideo, *_) -> Fraction:
|
|
|
41
41
|
def optimal_rate_video(
|
|
42
42
|
stream: StreamVideo,
|
|
43
43
|
t_min: typing.Optional[Fraction] = None,
|
|
44
|
-
t_max: typing.Optional[
|
|
44
|
+
t_max: typing.Optional[Fraction | float] = None,
|
|
45
45
|
choices: typing.Optional[set[Fraction]] = None,
|
|
46
46
|
) -> Fraction:
|
|
47
47
|
"""Find the optimal frame rate for a given video stream.
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
"""Smartly choose the shape of a video stream."""
|
|
4
4
|
|
|
5
|
-
from fractions import Fraction
|
|
6
5
|
import math
|
|
7
6
|
import typing
|
|
8
7
|
|
|
9
|
-
from cutcutcodec.core.analysis.stream.time_backprop import time_backprop
|
|
10
8
|
from cutcutcodec.core.classes.stream_video import StreamVideo
|
|
11
9
|
from cutcutcodec.core.filter.video.resize import FilterVideoResize
|
|
12
10
|
from cutcutcodec.core.io.read_ffmpeg import ContainerInputFFMPEG
|
|
@@ -25,7 +23,7 @@ def _add_estimator(node_cls: type) -> callable:
|
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
@_add_estimator(FilterVideoResize)
|
|
28
|
-
def _optimal_shape_filter_video_resize(stream: StreamVideo
|
|
26
|
+
def _optimal_shape_filter_video_resize(stream: StreamVideo) -> tuple[int, int]:
|
|
29
27
|
"""Detect the best shape of a FilterVideoReshape.
|
|
30
28
|
|
|
31
29
|
Examples
|
|
@@ -43,7 +41,7 @@ def _optimal_shape_filter_video_resize(stream: StreamVideo, *_) -> tuple[int, in
|
|
|
43
41
|
|
|
44
42
|
|
|
45
43
|
@_add_estimator(ContainerInputFFMPEG)
|
|
46
|
-
def _optimal_shape_container_input_ffmpeg(stream: StreamVideo
|
|
44
|
+
def _optimal_shape_container_input_ffmpeg(stream: StreamVideo) -> tuple[int, int]:
|
|
47
45
|
"""Detect the shape of a ContainerInputFFMPEG.
|
|
48
46
|
|
|
49
47
|
Examples
|
|
@@ -60,7 +58,7 @@ def _optimal_shape_container_input_ffmpeg(stream: StreamVideo, *_) -> tuple[int,
|
|
|
60
58
|
|
|
61
59
|
|
|
62
60
|
@_add_estimator(ContainerInputImage)
|
|
63
|
-
def _optimal_shape_container_input_image(stream: StreamVideo
|
|
61
|
+
def _optimal_shape_container_input_image(stream: StreamVideo) -> tuple[int, int]:
|
|
64
62
|
"""Detect the shape of a ContainerInputFFMPEG.
|
|
65
63
|
|
|
66
64
|
Examples
|
|
@@ -77,7 +75,7 @@ def _optimal_shape_container_input_image(stream: StreamVideo, *_) -> tuple[int,
|
|
|
77
75
|
|
|
78
76
|
|
|
79
77
|
@_add_estimator(ContainerInputSVG)
|
|
80
|
-
def _optimal_shape_container_input_svg(stream: StreamVideo
|
|
78
|
+
def _optimal_shape_container_input_svg(stream: StreamVideo) -> tuple[int, int]:
|
|
81
79
|
"""Detect the shape of a ContainerInputFFMPEG.
|
|
82
80
|
|
|
83
81
|
Examples
|
|
@@ -95,20 +93,14 @@ def _optimal_shape_container_input_svg(stream: StreamVideo, *_) -> tuple[int, in
|
|
|
95
93
|
|
|
96
94
|
def optimal_shape_video(
|
|
97
95
|
stream: StreamVideo,
|
|
98
|
-
t_min: typing.Optional[Fraction] = None,
|
|
99
|
-
t_max: typing.Optional[typing.Union[Fraction, float]] = None,
|
|
100
96
|
choices: typing.Optional[set[tuple[int, int]]] = None,
|
|
101
|
-
) ->
|
|
97
|
+
) -> None | tuple[int, int]:
|
|
102
98
|
"""Find the optimal frame shape for a given video stream.
|
|
103
99
|
|
|
104
100
|
Parameters
|
|
105
101
|
----------
|
|
106
102
|
stream : cutcutcodec.core.classes.stream_video.StreamVideo
|
|
107
103
|
The video stream that we want to find the optimal fps.
|
|
108
|
-
t_min : float, optional
|
|
109
|
-
The lower bound of the time slice estimation.
|
|
110
|
-
t_max : float, optional
|
|
111
|
-
The higher bound of the time slice estimation.
|
|
112
104
|
choices : set[tuple[int, int]], optional
|
|
113
105
|
The possible shape. If provide, returns the most appropriate shape of this set.
|
|
114
106
|
The convention adopted is the numpy convention (height, width) in pixels.
|
|
@@ -120,8 +112,6 @@ def optimal_shape_video(
|
|
|
120
112
|
"""
|
|
121
113
|
# verifications
|
|
122
114
|
assert isinstance(stream, StreamVideo), stream.__class__.__name__
|
|
123
|
-
assert t_min is None or isinstance(t_min, Fraction), t_min.__class__.__name__
|
|
124
|
-
assert t_max is None or t_max == math.inf or isinstance(t_max, Fraction), t_max
|
|
125
115
|
if choices is not None:
|
|
126
116
|
assert isinstance(choices, set), choices.__class__.__name__
|
|
127
117
|
assert all(isinstance(s, tuple) for s in choices), choices
|
|
@@ -141,14 +131,10 @@ def optimal_shape_video(
|
|
|
141
131
|
return choices.pop()
|
|
142
132
|
|
|
143
133
|
# estimation of the best shape
|
|
144
|
-
t_min, t_max = t_min or stream.beginning, t_max or stream.beginning + stream.duration
|
|
145
134
|
if (estimator := SHAPE_ESTIMATORS.get(stream.node.__class__, None)) is not None:
|
|
146
|
-
shape = estimator(stream
|
|
135
|
+
shape = estimator(stream)
|
|
147
136
|
else:
|
|
148
|
-
shapes = (
|
|
149
|
-
optimal_shape_video(s, *t) for s, *t in time_backprop(stream, t_min, t_max)
|
|
150
|
-
if s.type == "video"
|
|
151
|
-
)
|
|
137
|
+
shapes = (optimal_shape_video(s) for s in stream.node.in_streams if s.type == "video")
|
|
152
138
|
shapes = [s for s in shapes if s is not None]
|
|
153
139
|
shape = (max(s[0] for s in shapes), max(s[1] for s in shapes)) if shapes else None
|
|
154
140
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
from fractions import Fraction
|
|
6
6
|
import math
|
|
7
|
-
import typing
|
|
8
7
|
|
|
9
8
|
from cutcutcodec.core.classes.stream import Stream
|
|
10
9
|
from cutcutcodec.core.filter.audio.add import FilterAudioAdd
|
|
@@ -25,8 +24,8 @@ def _add_estimator(node_cls: type) -> callable:
|
|
|
25
24
|
|
|
26
25
|
@_add_estimator(FilterAudioAdd)
|
|
27
26
|
def _slice_filter_audio_add(
|
|
28
|
-
stream: Stream, t_min: Fraction, t_max:
|
|
29
|
-
) -> tuple[Stream, tuple[Fraction,
|
|
27
|
+
stream: Stream, t_min: Fraction, t_max: Fraction | float
|
|
28
|
+
) -> tuple[Stream, tuple[Fraction, Fraction | float]]:
|
|
30
29
|
"""Detect the time propagation into a FilterAudioAdd stream.
|
|
31
30
|
|
|
32
31
|
Examples
|
|
@@ -57,8 +56,8 @@ def _slice_filter_audio_add(
|
|
|
57
56
|
|
|
58
57
|
@_add_estimator(FilterVideoAdd)
|
|
59
58
|
def _slice_filter_video_add(
|
|
60
|
-
stream: Stream, t_min: Fraction, t_max:
|
|
61
|
-
) -> tuple[Stream, tuple[Fraction,
|
|
59
|
+
stream: Stream, t_min: Fraction, t_max: Fraction | float
|
|
60
|
+
) -> tuple[Stream, tuple[Fraction, Fraction | float]]:
|
|
62
61
|
"""Detect the time propagation into a FilterVideoAdd stream.
|
|
63
62
|
|
|
64
63
|
Examples
|
|
@@ -89,8 +88,8 @@ def _slice_filter_video_add(
|
|
|
89
88
|
|
|
90
89
|
@_add_estimator(FilterAudioDelay)
|
|
91
90
|
def _slice_filter_audio_delay(
|
|
92
|
-
stream: Stream, t_min: Fraction, t_max:
|
|
93
|
-
) -> tuple[Stream, tuple[Fraction,
|
|
91
|
+
stream: Stream, t_min: Fraction, t_max: Fraction | float
|
|
92
|
+
) -> tuple[Stream, tuple[Fraction, Fraction | float]]:
|
|
94
93
|
"""Detect the time propagation into a FilterAudioDelay stream.
|
|
95
94
|
|
|
96
95
|
Examples
|
|
@@ -117,8 +116,8 @@ def _slice_filter_audio_delay(
|
|
|
117
116
|
|
|
118
117
|
@_add_estimator(FilterVideoDelay)
|
|
119
118
|
def _slice_filter_video_delay(
|
|
120
|
-
stream: Stream, t_min: Fraction, t_max:
|
|
121
|
-
) -> tuple[Stream, tuple[Fraction,
|
|
119
|
+
stream: Stream, t_min: Fraction, t_max: Fraction | float
|
|
120
|
+
) -> tuple[Stream, tuple[Fraction, Fraction | float]]:
|
|
122
121
|
"""Detect the time propagation into a FilterVideoDelay stream.
|
|
123
122
|
|
|
124
123
|
Examples
|
|
@@ -144,8 +143,8 @@ def _slice_filter_video_delay(
|
|
|
144
143
|
|
|
145
144
|
|
|
146
145
|
def time_backprop(
|
|
147
|
-
stream: Stream, t_min: Fraction, t_max:
|
|
148
|
-
) -> tuple[Stream, tuple[Fraction,
|
|
146
|
+
stream: Stream, t_min: Fraction, t_max: Fraction | float
|
|
147
|
+
) -> tuple[Stream, tuple[Fraction, Fraction | float]]:
|
|
149
148
|
"""Match the time slice to the input streams of a node.
|
|
150
149
|
|
|
151
150
|
Helper for ``cutcutcodec.core.compilation.export.time_slice.time_backprop``.
|
|
@@ -156,7 +155,7 @@ def time_backprop(
|
|
|
156
155
|
One of the output stream of the node. It can be a stream of any type.
|
|
157
156
|
t_min : Fraction
|
|
158
157
|
The starting included time of decoding the data of the given stream.
|
|
159
|
-
t_max :
|
|
158
|
+
t_max : Fraction or inf
|
|
160
159
|
The final excluded time of decoding the data of the given stream.
|
|
161
160
|
|
|
162
161
|
Yields
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Probe video data."""
|
|
4
|
+
|
|
5
|
+
from .metric import compare, psnr, ssim, vmaf
|
|
6
|
+
from .properties import get_duration_video, get_nb_frames, get_rate_video, get_timestamps_video
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"get_duration_video", "get_nb_frames", "get_rate_video", "get_timestamps_video",
|
|
11
|
+
"compare", "psnr", "ssim", "vmaf"
|
|
12
|
+
]
|