cutcutcodec 1.0.3.post0__tar.gz → 1.1.0__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.0.3.post0 → cutcutcodec-1.1.0}/LICENSE +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/PKG-INFO +29 -23
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/README.rst +14 -12
- {cutcutcodec-1.0.3.post0/cutcutcodec → cutcutcodec-1.1.0}/c_build.py +1 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/__init__.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/__main__.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/ffprobe.py +3 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/graph/find.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/graph/time_backprop.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/rate_audio.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/rate_video.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/shape.py +58 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/time_backprop.py +12 -12
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/encoder.py +1 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/frame_audio.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/frame_video.py +35 -17
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/layout.py +1 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/stream.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/stream_audio.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/stream_video.py +3 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/export/compatibility.py +18 -18
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/graph_to_ast.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/graph_to_tree.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +4 -4
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +7 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/tree_to_graph.py +2 -2
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/opti → cutcutcodec-1.1.0/cutcutcodec/core/edit}/factor/__init__.py +0 -2
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/opti → cutcutcodec-1.1.0/cutcutcodec/core/edit}/factor/proba.py +3 -3
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/opti → cutcutcodec-1.1.0/cutcutcodec/core/edit}/generalize/__init__.py +0 -2
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/opti → cutcutcodec-1.1.0/cutcutcodec/core/edit}/generalize/delay_to_fir.py +4 -5
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/add.py +7 -4
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/cat.py +4 -4
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/cut.py +4 -4
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/delay.py +4 -2
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/equation.py +4 -3
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/fir.py +21 -6
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/identity.py +1 -1
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/resample.py +24 -15
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/subclip.py +7 -7
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/mix/audio_cast.py +3 -3
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/mix/video_cast.py +20 -14
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/add.py +16 -14
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/cat.py +4 -4
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/cut.py +5 -5
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/delay.py +2 -2
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/equation.py +4 -3
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/identity.py +1 -1
- cutcutcodec-1.1.0/cutcutcodec/core/filter/video/pad.py +159 -0
- cutcutcodec-1.1.0/cutcutcodec/core/filter/video/patch.py +142 -0
- cutcutcodec-1.1.0/cutcutcodec/core/filter/video/resize.py +344 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/subclip.py +7 -7
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/audio/equation.py +3 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/equation.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/fractal/fractal.c +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/fractal/mandelbrot.py +2 -2
- cutcutcodec-1.1.0/cutcutcodec/core/io/__init__.py +79 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/io/read_ffmpeg.py +26 -18
- cutcutcodec-1.1.0/cutcutcodec/core/io/read_image.py +181 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/io/read_svg.py +60 -31
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/io/scheduler.py +5 -5
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/io/write.py +11 -11
- cutcutcodec-1.1.0/cutcutcodec/core/nn/__init__.py +3 -0
- cutcutcodec-1.1.0/cutcutcodec/core/nn/dataaug/__init__.py +3 -0
- cutcutcodec-1.1.0/cutcutcodec/core/nn/dataaug/image.py +104 -0
- cutcutcodec-1.1.0/cutcutcodec/core/nn/loader.py +264 -0
- cutcutcodec-1.1.0/cutcutcodec/core/nn/model/__init__.py +3 -0
- cutcutcodec-1.1.0/cutcutcodec/core/nn/model/compression/__init__.py +3 -0
- cutcutcodec-1.1.0/cutcutcodec/core/nn/model/compression/img_cgavaenn.py +367 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/basic.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/clean/graph.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/hashes/graph.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/parallel/buffer.py +3 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/utils.py +3 -2
- cutcutcodec-1.1.0/cutcutcodec/examples/logo.png +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/examples/project.json +7 -7
- cutcutcodec-1.1.0/cutcutcodec/gui/__init__.py +3 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/__main__.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/actions.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py +3 -31
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_audio_fir.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py +1 -1
- cutcutcodec-1.1.0/cutcutcodec/gui/edit_node_state/all/filter_video_resize.py +19 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/base.py +4 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/interface.py +93 -9
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/entry/filters.py +3 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/export/container.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/export/doc.py +3 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/flowchart/edge_properties.py +12 -8
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/flowchart/main.py +11 -13
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/flowchart/node.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/preferences/audio_settings.py +3 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/preferences/video_settings.py +11 -10
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/timeline/view.py +7 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/video_preview/frame_extractor.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/video_preview/main.py +2 -1
- cutcutcodec-1.1.0/cutcutcodec/testing/__init__.py +3 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/__main__.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/coding_style.py +12 -12
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/install.py +20 -5
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/run.py +13 -9
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/abstract.py +16 -16
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/audio_cast.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/c_memory.py +1 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/compile.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/filter_cut.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/filter_delay.py +4 -4
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/fir.py +3 -3
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/nan_snapshot.py +4 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/serialization_equality.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/snapshot_shape.py +2 -1
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/write.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/utils.py +2 -2
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec.egg-info/PKG-INFO +29 -23
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec.egg-info/SOURCES.txt +42 -30
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec.egg-info/requires.txt +9 -5
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec.egg-info/top_level.txt +1 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/pyproject.toml +28 -15
- cutcutcodec-1.0.3.post0/cutcutcodec/core/filters/video/pad.py +0 -99
- cutcutcodec-1.0.3.post0/cutcutcodec/core/io/__init__.py +0 -3
- cutcutcodec-1.0.3.post0/cutcutcodec/gui/__init__.py +0 -8
- cutcutcodec-1.0.3.post0/cutcutcodec/testing/__init__.py +0 -8
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/_helper_properties.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/audio/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/audio/properties/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/audio/properties/duration.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/graph/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/video/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/video/properties/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/video/properties/duration.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/video/properties/nb_frames.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/video/properties/rate.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/video/properties/timestamps.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/container.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/filter.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/frame.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/meta_filter.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/muxer.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/classes/node.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/ast_to_file.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/export/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/export/default.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/export/encodec.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/export/muxer.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/export/rate.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/graph_to_json.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/json_to_graph.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/parse.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/compilation/sympy_to_torch/printer.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/edit/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/edit/decision/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/edit/operation/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/edit/operation/add.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/edit/operation/remove.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/exceptions.py +0 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/audio/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/cut.py +0 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/mix/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/subclip.py +0 -0
- {cutcutcodec-1.0.3.post0/cutcutcodec/core/filters → cutcutcodec-1.1.0/cutcutcodec/core/filter}/video/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/audio/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/audio/empty.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/audio/noise.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/empty.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/fractal/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/fractal/geometry.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/generation/video/noise.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/interfaces/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/interfaces/seedable.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/clean/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/hashes/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cache/singleton.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/cuda/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/graph.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/opti/parallel/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/examples/intro.webm +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/examples/logo.svg +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/examples/video.mp4 +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/app/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/app/app.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/base.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_audio_delay.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_cut.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_delay.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_subclip.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_video_delay.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/default.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/documentation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/general.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/loader.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edit_node_state/main.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/edition_tabs.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/entry/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/entry/base.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/entry/generators.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/entry_tabs.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/export/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/export/_helper.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/export/encodec.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/export/main.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/flowchart/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/main.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/menu.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/preferences/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/preferences/main.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/run.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/timeline/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/timeline/main.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/timeline/slider.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/timeline/track.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/toolbar.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/tools.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/video_preview/__init__.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/video_preview/audio_player.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/gui/video_preview/control.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/generation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/audio_equation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/compatibility.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/encoder.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/filter_empty.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/hashes.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/initialisation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/muxer.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/read.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/sympy_to_torch.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/thread_safe.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/time_range.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/testing/tests/video_equation.py +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec.egg-info/dependency_links.txt +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec.egg-info/entry_points.txt +0 -0
- {cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Copyright © 2023 Robin RICHARD
|
|
2
2
|
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
3
|
+
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:
|
|
4
4
|
|
|
5
5
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
6
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cutcutcodec
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
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
7
|
License: Copyright © 2023 Robin RICHARD
|
|
8
8
|
|
|
9
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
|
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
10
|
|
|
11
11
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ License: Copyright © 2023 Robin RICHARD
|
|
|
15
15
|
Project-URL: Homepage, https://framagit.org/robinechuca/cutcutcodec/-/blob/main/README.rst
|
|
16
16
|
Project-URL: Documentation, https://cutcutcodec.readthedocs.io/latest/
|
|
17
17
|
Project-URL: Repository, https://framagit.org/robinechuca/cutcutcodec/
|
|
18
|
-
Keywords: audio,effect,equation,ffmpeg,filtering,fractal,graph,graphical interface,gui,open source,video editing
|
|
18
|
+
Keywords: audio,effect,equation,ffmpeg,filtering,fractal,graph,graphical interface,gui,movie,open source,video editing
|
|
19
19
|
Classifier: Development Status :: 5 - Production/Stable
|
|
20
20
|
Classifier: Environment :: GPU
|
|
21
21
|
Classifier: Environment :: X11 Applications :: Qt
|
|
@@ -27,10 +27,11 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
27
27
|
Classifier: Natural Language :: English
|
|
28
28
|
Classifier: Operating System :: POSIX :: Linux
|
|
29
29
|
Classifier: Programming Language :: C
|
|
30
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
30
31
|
Classifier: Programming Language :: Python :: 3.10
|
|
31
32
|
Classifier: Programming Language :: Python :: 3.11
|
|
32
33
|
Classifier: Programming Language :: Python :: 3.12
|
|
33
|
-
Classifier: Programming Language :: Python :: 3.
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
34
35
|
Classifier: Topic :: Multimedia :: Graphics :: Editors
|
|
35
36
|
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
|
|
36
37
|
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
|
|
@@ -49,14 +50,16 @@ Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
|
49
50
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
50
51
|
Classifier: Topic :: Software Development :: Code Generators
|
|
51
52
|
Classifier: Typing :: Typed
|
|
52
|
-
Requires-Python: <3.
|
|
53
|
+
Requires-Python: <3.14,>=3.9
|
|
53
54
|
Description-Content-Type: text/x-rst
|
|
54
55
|
License-File: LICENSE
|
|
55
56
|
Requires-Dist: av
|
|
57
|
+
Requires-Dist: black
|
|
56
58
|
Requires-Dist: cairosvg
|
|
57
59
|
Requires-Dist: click
|
|
60
|
+
Requires-Dist: lightning
|
|
58
61
|
Requires-Dist: networkx>=3.0
|
|
59
|
-
Requires-Dist: numpy>=
|
|
62
|
+
Requires-Dist: numpy>=2.0
|
|
60
63
|
Requires-Dist: opencv-contrib-python-headless
|
|
61
64
|
Requires-Dist: pip>=23.0
|
|
62
65
|
Requires-Dist: sympy>=1.10
|
|
@@ -64,27 +67,28 @@ Requires-Dist: torch>=2.1
|
|
|
64
67
|
Requires-Dist: tqdm
|
|
65
68
|
Requires-Dist: unidecode
|
|
66
69
|
Provides-Extra: gui
|
|
67
|
-
Requires-Dist: black; extra == "gui"
|
|
68
70
|
Requires-Dist: pdoc3; extra == "gui"
|
|
69
71
|
Requires-Dist: pyqt6; extra == "gui"
|
|
70
72
|
Requires-Dist: pyqtgraph>=0.3.1; extra == "gui"
|
|
71
73
|
Requires-Dist: qtpy; extra == "gui"
|
|
72
74
|
Requires-Dist: qtpynodeeditor>=0.3.1; extra == "gui"
|
|
73
75
|
Provides-Extra: all
|
|
74
|
-
Requires-Dist:
|
|
76
|
+
Requires-Dist: matplotlib; extra == "all"
|
|
75
77
|
Requires-Dist: pdoc3; extra == "all"
|
|
76
78
|
Requires-Dist: pydocstyle<=6.1.1; extra == "all"
|
|
77
|
-
Requires-Dist: pylama[all]; extra == "all"
|
|
78
|
-
Requires-Dist: pylama[toml]; extra == "all"
|
|
79
|
+
Requires-Dist: pylama[all,toml]; extra == "all"
|
|
79
80
|
Requires-Dist: pyqt6; extra == "all"
|
|
80
81
|
Requires-Dist: pyqtgraph>=0.3.1; extra == "all"
|
|
81
82
|
Requires-Dist: pytest; extra == "all"
|
|
82
83
|
Requires-Dist: qtpy; extra == "all"
|
|
83
84
|
Requires-Dist: qtpynodeeditor>=0.3.1; extra == "all"
|
|
84
85
|
Requires-Dist: recommonmark; extra == "all"
|
|
85
|
-
Requires-Dist: sphinx
|
|
86
|
+
Requires-Dist: sphinx; extra == "all"
|
|
86
87
|
Requires-Dist: sphinx-copybutton; extra == "all"
|
|
87
88
|
Requires-Dist: sphinx-inline-tabs; extra == "all"
|
|
89
|
+
Requires-Dist: sphinx-rtd-dark-mode; extra == "all"
|
|
90
|
+
Requires-Dist: sphinx-rtd-theme; extra == "all"
|
|
91
|
+
Requires-Dist: sphinxcontrib-video; extra == "all"
|
|
88
92
|
Requires-Dist: sphinxext-opengraph; extra == "all"
|
|
89
93
|
|
|
90
94
|
.. rst syntax: https://deusyss.developpez.com/tutoriels/Python/SphinxDoc/
|
|
@@ -109,14 +113,10 @@ CutCutCodec
|
|
|
109
113
|
:alt: [testing]
|
|
110
114
|
:target: https://docs.pytest.org/
|
|
111
115
|
|
|
112
|
-
.. image:: https://img.shields.io/badge/python-3.
|
|
116
|
+
.. image:: https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue
|
|
113
117
|
:alt: [versions]
|
|
114
118
|
:target: https://framagit.org/robinechuca/cutcutcodec/-/blob/main/run_tests.sh
|
|
115
119
|
|
|
116
|
-
.. image:: https://img.shields.io/pypi/v/cutcutcodec.svg
|
|
117
|
-
:alt: [pypi version]
|
|
118
|
-
:target: https://pypi.python.org/pypi/cutcutcodec
|
|
119
|
-
|
|
120
120
|
.. image:: https://static.pepy.tech/badge/cutcutcodec
|
|
121
121
|
:alt: [downloads]
|
|
122
122
|
:target: https://www.pepy.tech/projects/cutcutcodec
|
|
@@ -155,7 +155,7 @@ Quick Start
|
|
|
155
155
|
Installation
|
|
156
156
|
------------
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
Please follow the `cutcutcodec installation guide <https://cutcutcodec.readthedocs.io/latest/installation.html>`_.
|
|
159
159
|
|
|
160
160
|
You can use the following command to install everything automatically (not recommended, it's better to follow the guide).
|
|
161
161
|
|
|
@@ -210,6 +210,7 @@ Video
|
|
|
210
210
|
#. Mandelbrot fractal generation.
|
|
211
211
|
* Filters
|
|
212
212
|
#. Cutting, translate and concatenate.
|
|
213
|
+
#. Resize and crop (high quality, no aliasing).
|
|
213
214
|
#. Overlaying video tracks (with transparency control).
|
|
214
215
|
#. Apply an arbitrary equation one several video streams.
|
|
215
216
|
|
|
@@ -221,16 +222,16 @@ In this example we open a video file, add video noise, add audio A and C note, s
|
|
|
221
222
|
|
|
222
223
|
.. code:: python
|
|
223
224
|
|
|
224
|
-
from cutcutcodec.core.
|
|
225
|
-
from cutcutcodec.core.
|
|
226
|
-
from cutcutcodec.core.
|
|
227
|
-
from cutcutcodec.core.
|
|
225
|
+
from cutcutcodec.core.filter.audio.subclip import FilterAudioSubclip
|
|
226
|
+
from cutcutcodec.core.filter.video.add import FilterVideoAdd
|
|
227
|
+
from cutcutcodec.core.filter.video.equation import FilterVideoEquation
|
|
228
|
+
from cutcutcodec.core.filter.video.subclip import FilterVideoSubclip
|
|
228
229
|
from cutcutcodec.core.generation.audio.equation import GeneratorAudioEquation
|
|
229
230
|
from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
230
|
-
from cutcutcodec.core.io
|
|
231
|
+
from cutcutcodec.core.io import read
|
|
231
232
|
from cutcutcodec.core.io.write import ContainerOutputFFMPEG
|
|
232
233
|
|
|
233
|
-
with
|
|
234
|
+
with read("cutcutcodec/examples/video.mp4") as container:
|
|
234
235
|
(trans,) = FilterVideoEquation(container.out_streams, "b0", "g0", "r0", "a0/2").out_streams
|
|
235
236
|
(noise,) = GeneratorVideoNoise().out_streams
|
|
236
237
|
(video,) = FilterVideoAdd([trans, noise]).out_streams
|
|
@@ -270,3 +271,8 @@ For the complete list of changes, refer to the `git commits <https://framagit.or
|
|
|
270
271
|
|
|
271
272
|
* Improved ergonomics of the "Entry Tabs" and "Export" window.
|
|
272
273
|
* Speed-up codec/encoder/muxer tests of compatibility by a factor 10.
|
|
274
|
+
|
|
275
|
+
1.0.4
|
|
276
|
+
-----
|
|
277
|
+
|
|
278
|
+
* Read images and SVG as well.
|
|
@@ -20,14 +20,10 @@ CutCutCodec
|
|
|
20
20
|
:alt: [testing]
|
|
21
21
|
:target: https://docs.pytest.org/
|
|
22
22
|
|
|
23
|
-
.. image:: https://img.shields.io/badge/python-3.
|
|
23
|
+
.. image:: https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13-blue
|
|
24
24
|
:alt: [versions]
|
|
25
25
|
:target: https://framagit.org/robinechuca/cutcutcodec/-/blob/main/run_tests.sh
|
|
26
26
|
|
|
27
|
-
.. image:: https://img.shields.io/pypi/v/cutcutcodec.svg
|
|
28
|
-
:alt: [pypi version]
|
|
29
|
-
:target: https://pypi.python.org/pypi/cutcutcodec
|
|
30
|
-
|
|
31
27
|
.. image:: https://static.pepy.tech/badge/cutcutcodec
|
|
32
28
|
:alt: [downloads]
|
|
33
29
|
:target: https://www.pepy.tech/projects/cutcutcodec
|
|
@@ -66,7 +62,7 @@ Quick Start
|
|
|
66
62
|
Installation
|
|
67
63
|
------------
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
Please follow the `cutcutcodec installation guide <https://cutcutcodec.readthedocs.io/latest/installation.html>`_.
|
|
70
66
|
|
|
71
67
|
You can use the following command to install everything automatically (not recommended, it's better to follow the guide).
|
|
72
68
|
|
|
@@ -121,6 +117,7 @@ Video
|
|
|
121
117
|
#. Mandelbrot fractal generation.
|
|
122
118
|
* Filters
|
|
123
119
|
#. Cutting, translate and concatenate.
|
|
120
|
+
#. Resize and crop (high quality, no aliasing).
|
|
124
121
|
#. Overlaying video tracks (with transparency control).
|
|
125
122
|
#. Apply an arbitrary equation one several video streams.
|
|
126
123
|
|
|
@@ -132,16 +129,16 @@ In this example we open a video file, add video noise, add audio A and C note, s
|
|
|
132
129
|
|
|
133
130
|
.. code:: python
|
|
134
131
|
|
|
135
|
-
from cutcutcodec.core.
|
|
136
|
-
from cutcutcodec.core.
|
|
137
|
-
from cutcutcodec.core.
|
|
138
|
-
from cutcutcodec.core.
|
|
132
|
+
from cutcutcodec.core.filter.audio.subclip import FilterAudioSubclip
|
|
133
|
+
from cutcutcodec.core.filter.video.add import FilterVideoAdd
|
|
134
|
+
from cutcutcodec.core.filter.video.equation import FilterVideoEquation
|
|
135
|
+
from cutcutcodec.core.filter.video.subclip import FilterVideoSubclip
|
|
139
136
|
from cutcutcodec.core.generation.audio.equation import GeneratorAudioEquation
|
|
140
137
|
from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
141
|
-
from cutcutcodec.core.io
|
|
138
|
+
from cutcutcodec.core.io import read
|
|
142
139
|
from cutcutcodec.core.io.write import ContainerOutputFFMPEG
|
|
143
140
|
|
|
144
|
-
with
|
|
141
|
+
with read("cutcutcodec/examples/video.mp4") as container:
|
|
145
142
|
(trans,) = FilterVideoEquation(container.out_streams, "b0", "g0", "r0", "a0/2").out_streams
|
|
146
143
|
(noise,) = GeneratorVideoNoise().out_streams
|
|
147
144
|
(video,) = FilterVideoAdd([trans, noise]).out_streams
|
|
@@ -181,3 +178,8 @@ For the complete list of changes, refer to the `git commits <https://framagit.or
|
|
|
181
178
|
|
|
182
179
|
* Improved ergonomics of the "Entry Tabs" and "Export" window.
|
|
183
180
|
* Speed-up codec/encoder/muxer tests of compatibility by a factor 10.
|
|
181
|
+
|
|
182
|
+
1.0.4
|
|
183
|
+
-----
|
|
184
|
+
|
|
185
|
+
* Read images and SVG as well.
|
|
@@ -23,10 +23,9 @@ class Build(_build_py):
|
|
|
23
23
|
super().initialize_options()
|
|
24
24
|
if self.distribution.ext_modules is None:
|
|
25
25
|
self.distribution.ext_modules = []
|
|
26
|
-
|
|
27
26
|
self.distribution.ext_modules.append(
|
|
28
27
|
Extension(
|
|
29
|
-
"cutcutcodec.core.generation.video.
|
|
28
|
+
"cutcutcodec.core.generation.video.fractal.fractal",
|
|
30
29
|
sources=["cutcutcodec/core/generation/video/fractal/fractal.c"],
|
|
31
30
|
**get_compilation_rules(),
|
|
32
31
|
)
|
|
@@ -19,7 +19,7 @@ from cutcutcodec.core.exceptions import MissingInformation, MissingStreamError
|
|
|
19
19
|
def _decode_duration_ffmpeg(filename: str, index: int, accurate: bool) -> Fraction:
|
|
20
20
|
"""Extract the duration by the complete decoding of the stream.
|
|
21
21
|
|
|
22
|
-
Slow but 100% accurate method. The duration of the last frame is
|
|
22
|
+
Slow but 100% accurate method. The duration of the last frame is taken in consideration.
|
|
23
23
|
Equivalent to:
|
|
24
24
|
``ffmpeg -thread 0 -loglevel quiet -stats -i file -map 0:v:0 -c:v rawvideo -f null /dev/null``
|
|
25
25
|
|
|
@@ -360,7 +360,7 @@ def get_metadata(
|
|
|
360
360
|
'filename': 'cutcutcodec/examples/audio_5.1_narration.oga',
|
|
361
361
|
'format_long_name': 'Ogg',
|
|
362
362
|
'format_name': 'ogg',
|
|
363
|
-
|
|
363
|
+
...
|
|
364
364
|
'nb_streams': 1,
|
|
365
365
|
'probe_score': 100,
|
|
366
366
|
'size': '34982',
|
|
@@ -471,7 +471,7 @@ def get_slices_metadata(
|
|
|
471
471
|
['video', '202240', '15.800000', ..., '15.960000', '354', '0'],
|
|
472
472
|
['video', '202752', '15.840000', ..., '15.920000', '247', '0'],
|
|
473
473
|
['video', '203264', '15.880000', ..., '15.880000', '192', '0']],
|
|
474
|
-
dtype='<U9')]
|
|
474
|
+
shape=(400, 11), dtype='<U9')]
|
|
475
475
|
>>>
|
|
476
476
|
"""
|
|
477
477
|
filename = pathlib.Path(filename)
|
|
@@ -45,7 +45,7 @@ def find_edge_from_edge_tree(
|
|
|
45
45
|
>>> from cutcutcodec.core.analysis.graph.find import find_edge_from_edge_tree
|
|
46
46
|
>>> from cutcutcodec.core.classes.container import ContainerOutput
|
|
47
47
|
>>> from cutcutcodec.core.compilation.tree_to_graph import tree_to_graph
|
|
48
|
-
>>> from cutcutcodec.core.
|
|
48
|
+
>>> from cutcutcodec.core.filter.audio.subclip import FilterAudioSubclip
|
|
49
49
|
>>> from cutcutcodec.core.generation.audio.noise import GeneratorAudioNoise
|
|
50
50
|
>>> container_out = ContainerOutput(
|
|
51
51
|
... FilterAudioSubclip(GeneratorAudioNoise(0).out_streams, 1, 2).out_streams
|
{cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/graph/time_backprop.py
RENAMED
|
@@ -17,7 +17,7 @@ def time_backprop(
|
|
|
17
17
|
graph: networkx.MultiDiGraph,
|
|
18
18
|
edge: tuple[str, str, str],
|
|
19
19
|
t_min: Fraction,
|
|
20
|
-
t_max: typing.Union[Fraction, float]
|
|
20
|
+
t_max: typing.Union[Fraction, float],
|
|
21
21
|
) -> tuple[tuple[str, str, str], tuple[Fraction, typing.Union[Fraction, float]]]:
|
|
22
22
|
"""Graph version of ``cutcutcodec.core.analysis.stream.time_backprop.time_backprop``.
|
|
23
23
|
|
{cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/rate_audio.py
RENAMED
|
@@ -27,8 +27,8 @@ from cutcutcodec.core.io.read_ffmpeg import ContainerInputFFMPEG
|
|
|
27
27
|
RATE_ESTIMATORS = {} # to each node stream class, associate the func to find the optimal rate
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
def _add_estimator(node_cls: type) ->
|
|
31
|
-
def _add_func(func) ->
|
|
30
|
+
def _add_estimator(node_cls: type) -> typing.Callable:
|
|
31
|
+
def _add_func(func) -> typing.Callable:
|
|
32
32
|
RATE_ESTIMATORS[node_cls] = func
|
|
33
33
|
return func
|
|
34
34
|
return _add_func
|
{cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/rate_video.py
RENAMED
|
@@ -14,8 +14,8 @@ from cutcutcodec.core.io.read_ffmpeg import ContainerInputFFMPEG
|
|
|
14
14
|
FPS_ESTIMATORS = {} # to each node stream class, associate the func to find the optimal rate
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
def _add_estimator(node_cls: type) ->
|
|
18
|
-
def _add_func(func) ->
|
|
17
|
+
def _add_estimator(node_cls: type) -> typing.Callable:
|
|
18
|
+
def _add_func(func) -> typing.Callable:
|
|
19
19
|
FPS_ESTIMATORS[node_cls] = func
|
|
20
20
|
return func
|
|
21
21
|
return _add_func
|
|
@@ -8,21 +8,42 @@ import typing
|
|
|
8
8
|
|
|
9
9
|
from cutcutcodec.core.analysis.stream.time_backprop import time_backprop
|
|
10
10
|
from cutcutcodec.core.classes.stream_video import StreamVideo
|
|
11
|
+
from cutcutcodec.core.filter.video.resize import FilterVideoResize
|
|
11
12
|
from cutcutcodec.core.io.read_ffmpeg import ContainerInputFFMPEG
|
|
13
|
+
from cutcutcodec.core.io.read_image import ContainerInputImage
|
|
14
|
+
from cutcutcodec.core.io.read_svg import ContainerInputSVG
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
SHAPE_ESTIMATORS = {} # to each node stream class, associate the func to find the optimal rate
|
|
15
18
|
|
|
16
19
|
|
|
17
|
-
def _add_estimator(node_cls: type) ->
|
|
18
|
-
def _add_func(func) ->
|
|
20
|
+
def _add_estimator(node_cls: type) -> typing.Callable:
|
|
21
|
+
def _add_func(func) -> typing.Callable:
|
|
19
22
|
SHAPE_ESTIMATORS[node_cls] = func
|
|
20
23
|
return func
|
|
21
24
|
return _add_func
|
|
22
25
|
|
|
23
26
|
|
|
27
|
+
@_add_estimator(FilterVideoResize)
|
|
28
|
+
def _optimal_shape_filter_video_resize(stream: StreamVideo, *_) -> tuple[int, int]:
|
|
29
|
+
"""Detect the best shape of a FilterVideoReshape.
|
|
30
|
+
|
|
31
|
+
Examples
|
|
32
|
+
--------
|
|
33
|
+
>>> from cutcutcodec.core.analysis.stream.shape import optimal_shape_video
|
|
34
|
+
>>> from cutcutcodec.core.filter.video.resize import FilterVideoResize
|
|
35
|
+
>>> from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
36
|
+
>>> (stream,) = FilterVideoResize(GeneratorVideoNoise(0).out_streams, (360, 640)).out_streams
|
|
37
|
+
>>> optimal_shape_video(stream)
|
|
38
|
+
(360, 640)
|
|
39
|
+
>>>
|
|
40
|
+
"""
|
|
41
|
+
assert isinstance(stream.node, FilterVideoResize), stream.node.__class__.__name__
|
|
42
|
+
return stream.node.shape
|
|
43
|
+
|
|
44
|
+
|
|
24
45
|
@_add_estimator(ContainerInputFFMPEG)
|
|
25
|
-
def _optimal_shape_container_input_ffmpeg(stream: StreamVideo, *_) ->
|
|
46
|
+
def _optimal_shape_container_input_ffmpeg(stream: StreamVideo, *_) -> tuple[int, int]:
|
|
26
47
|
"""Detect the shape of a ContainerInputFFMPEG.
|
|
27
48
|
|
|
28
49
|
Examples
|
|
@@ -38,6 +59,40 @@ def _optimal_shape_container_input_ffmpeg(stream: StreamVideo, *_) -> Fraction:
|
|
|
38
59
|
return (stream.height, stream.width)
|
|
39
60
|
|
|
40
61
|
|
|
62
|
+
@_add_estimator(ContainerInputImage)
|
|
63
|
+
def _optimal_shape_container_input_image(stream: StreamVideo, *_) -> tuple[int, int]:
|
|
64
|
+
"""Detect the shape of a ContainerInputFFMPEG.
|
|
65
|
+
|
|
66
|
+
Examples
|
|
67
|
+
--------
|
|
68
|
+
>>> from cutcutcodec.core.analysis.stream.shape import optimal_shape_video
|
|
69
|
+
>>> from cutcutcodec.core.io.read_image import ContainerInputImage
|
|
70
|
+
>>> (stream,) = ContainerInputImage("cutcutcodec/examples/logo.png").out_streams
|
|
71
|
+
>>> optimal_shape_video(stream)
|
|
72
|
+
(64, 64)
|
|
73
|
+
>>>
|
|
74
|
+
"""
|
|
75
|
+
assert isinstance(stream.node, ContainerInputImage), stream.node.__class__.__name__
|
|
76
|
+
return (stream.height, stream.width)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@_add_estimator(ContainerInputSVG)
|
|
80
|
+
def _optimal_shape_container_input_svg(stream: StreamVideo, *_) -> tuple[int, int]:
|
|
81
|
+
"""Detect the shape of a ContainerInputFFMPEG.
|
|
82
|
+
|
|
83
|
+
Examples
|
|
84
|
+
--------
|
|
85
|
+
>>> from cutcutcodec.core.analysis.stream.shape import optimal_shape_video
|
|
86
|
+
>>> from cutcutcodec.core.io.read_svg import ContainerInputSVG
|
|
87
|
+
>>> (stream,) = ContainerInputSVG("cutcutcodec/examples/logo.svg").out_streams
|
|
88
|
+
>>> optimal_shape_video(stream)
|
|
89
|
+
(64, 64)
|
|
90
|
+
>>>
|
|
91
|
+
"""
|
|
92
|
+
assert isinstance(stream.node, ContainerInputSVG), stream.node.__class__.__name__
|
|
93
|
+
return (stream.height, stream.width)
|
|
94
|
+
|
|
95
|
+
|
|
41
96
|
def optimal_shape_video(
|
|
42
97
|
stream: StreamVideo,
|
|
43
98
|
t_min: typing.Optional[Fraction] = None,
|
{cutcutcodec-1.0.3.post0 → cutcutcodec-1.1.0}/cutcutcodec/core/analysis/stream/time_backprop.py
RENAMED
|
@@ -7,17 +7,17 @@ import math
|
|
|
7
7
|
import typing
|
|
8
8
|
|
|
9
9
|
from cutcutcodec.core.classes.stream import Stream
|
|
10
|
-
from cutcutcodec.core.
|
|
11
|
-
from cutcutcodec.core.
|
|
12
|
-
from cutcutcodec.core.
|
|
13
|
-
from cutcutcodec.core.
|
|
10
|
+
from cutcutcodec.core.filter.audio.add import FilterAudioAdd
|
|
11
|
+
from cutcutcodec.core.filter.audio.delay import FilterAudioDelay
|
|
12
|
+
from cutcutcodec.core.filter.video.add import FilterVideoAdd
|
|
13
|
+
from cutcutcodec.core.filter.video.delay import FilterVideoDelay
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
SLICE_ESTIMATORS = {} # to each node stream class, associate the func to find the time translation
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
def _add_estimator(node_cls: type) ->
|
|
20
|
-
def _add_func(func) ->
|
|
19
|
+
def _add_estimator(node_cls: type) -> typing.Callable:
|
|
20
|
+
def _add_func(func) -> typing.Callable:
|
|
21
21
|
SLICE_ESTIMATORS[node_cls] = func
|
|
22
22
|
return func
|
|
23
23
|
return _add_func
|
|
@@ -33,8 +33,8 @@ def _slice_filter_audio_add(
|
|
|
33
33
|
--------
|
|
34
34
|
>>> from fractions import Fraction
|
|
35
35
|
>>> from cutcutcodec.core.analysis.stream.time_backprop import time_backprop
|
|
36
|
-
>>> from cutcutcodec.core.
|
|
37
|
-
>>> from cutcutcodec.core.
|
|
36
|
+
>>> from cutcutcodec.core.filter.audio.add import FilterAudioAdd
|
|
37
|
+
>>> from cutcutcodec.core.filter.audio.delay import FilterAudioDelay
|
|
38
38
|
>>> from cutcutcodec.core.generation.audio.noise import GeneratorAudioNoise
|
|
39
39
|
>>>
|
|
40
40
|
>>> (s_audio_0,) = GeneratorAudioNoise(0).out_streams
|
|
@@ -65,8 +65,8 @@ def _slice_filter_video_add(
|
|
|
65
65
|
--------
|
|
66
66
|
>>> from fractions import Fraction
|
|
67
67
|
>>> from cutcutcodec.core.analysis.stream.time_backprop import time_backprop
|
|
68
|
-
>>> from cutcutcodec.core.
|
|
69
|
-
>>> from cutcutcodec.core.
|
|
68
|
+
>>> from cutcutcodec.core.filter.video.add import FilterVideoAdd
|
|
69
|
+
>>> from cutcutcodec.core.filter.video.delay import FilterVideoDelay
|
|
70
70
|
>>> from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
71
71
|
>>>
|
|
72
72
|
>>> (s_video_0,) = GeneratorVideoNoise(0).out_streams
|
|
@@ -97,7 +97,7 @@ def _slice_filter_audio_delay(
|
|
|
97
97
|
--------
|
|
98
98
|
>>> from fractions import Fraction
|
|
99
99
|
>>> from cutcutcodec.core.analysis.stream.time_backprop import time_backprop
|
|
100
|
-
>>> from cutcutcodec.core.
|
|
100
|
+
>>> from cutcutcodec.core.filter.audio.delay import FilterAudioDelay
|
|
101
101
|
>>> from cutcutcodec.core.generation.audio.noise import GeneratorAudioNoise
|
|
102
102
|
>>> stream = GeneratorAudioNoise().out_streams[0]
|
|
103
103
|
>>> (s_a,) = FilterAudioDelay([stream], 10).out_streams
|
|
@@ -125,7 +125,7 @@ def _slice_filter_video_delay(
|
|
|
125
125
|
--------
|
|
126
126
|
>>> from fractions import Fraction
|
|
127
127
|
>>> from cutcutcodec.core.analysis.stream.time_backprop import time_backprop
|
|
128
|
-
>>> from cutcutcodec.core.
|
|
128
|
+
>>> from cutcutcodec.core.filter.video.delay import FilterVideoDelay
|
|
129
129
|
>>> from cutcutcodec.core.generation.video.noise import GeneratorVideoNoise
|
|
130
130
|
>>> stream = GeneratorVideoNoise().out_streams[0]
|
|
131
131
|
>>> (s_v,) = FilterVideoDelay([stream], 10).out_streams
|
|
@@ -29,6 +29,7 @@ class AllEncoders(metaclass=MetaSingleton):
|
|
|
29
29
|
for encodec in av.codec.codecs_available:
|
|
30
30
|
if encodec in {
|
|
31
31
|
"anull", # empty audio
|
|
32
|
+
"libjxl", # create segfault
|
|
32
33
|
"msrle", # old on microsoft windows only, segfault on linux
|
|
33
34
|
"rle", # alias to 'msrle'
|
|
34
35
|
"smc", # old on microsoft windows only, segfault on linux
|
|
@@ -36,7 +36,7 @@ class FrameAudio(Frame):
|
|
|
36
36
|
The time of the first sample of the frame in second (readonly).
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
|
-
def __new__(
|
|
39
|
+
def __new__( # pylint: disable=W0222
|
|
40
40
|
cls,
|
|
41
41
|
time: typing.Union[Fraction, numbers.Real, str],
|
|
42
42
|
rate: numbers.Integral,
|
|
@@ -75,7 +75,7 @@ class FrameAudio(Frame):
|
|
|
75
75
|
>>> FrameAudio("2/4", 48000, "stereo", torch.zeros(2, 1024))
|
|
76
76
|
FrameAudio('1/2', 48000, 'stereo', [[0., 0., 0., ..., 0., 0., 0.],
|
|
77
77
|
[0., 0., 0., ..., 0., 0., 0.]])
|
|
78
|
-
>>> _.to(
|
|
78
|
+
>>> _.to(torch.float16)
|
|
79
79
|
FrameAudio('1/2', 48000, 'stereo', [[0., 0., 0., ..., 0., 0., 0.],
|
|
80
80
|
[0., 0., 0., ..., 0., 0., 0.]],
|
|
81
81
|
dtype=torch.float16)
|
|
@@ -11,13 +11,13 @@ import numpy as np
|
|
|
11
11
|
import torch
|
|
12
12
|
|
|
13
13
|
from cutcutcodec.core.classes.frame import Frame
|
|
14
|
-
from cutcutcodec.core.
|
|
14
|
+
from cutcutcodec.core.filter.mix.video_cast import to_gray, to_gray_alpha, to_bgr, to_bgr_alpha
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class FrameVideo(Frame):
|
|
18
18
|
"""An image with time information for video context.
|
|
19
19
|
|
|
20
|
-
Behaves like a torch tensor of shape (height, width,
|
|
20
|
+
Behaves like a torch tensor of shape (height, width, channels).
|
|
21
21
|
The shape is consistent with pyav and cv2.
|
|
22
22
|
The dtype is automaticaly cast into torch.uint8.
|
|
23
23
|
|
|
@@ -38,7 +38,7 @@ class FrameVideo(Frame):
|
|
|
38
38
|
The dimension j (horizontal) of the image in pxl (readonly).
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
|
-
def __new__(
|
|
41
|
+
def __new__( # pylint: disable=W0222
|
|
42
42
|
cls,
|
|
43
43
|
time: typing.Union[Fraction, numbers.Real, str],
|
|
44
44
|
data: typing.Union[torch.Tensor, np.ndarray, typing.Container],
|
|
@@ -55,9 +55,14 @@ class FrameVideo(Frame):
|
|
|
55
55
|
**kwargs : dict
|
|
56
56
|
Transmitted to ``cutcutcodec.core.classes.frame.Frame`` initialisator.
|
|
57
57
|
"""
|
|
58
|
+
# create frame
|
|
58
59
|
frame = super().__new__(cls, data, context=time, **kwargs)
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
# cast shape
|
|
62
|
+
if frame.ndim == 2: # give flexibility for grayscale images
|
|
63
|
+
frame = frame.unsqueeze(2)
|
|
64
|
+
|
|
65
|
+
# verifications
|
|
61
66
|
frame.check_state()
|
|
62
67
|
return frame
|
|
63
68
|
|
|
@@ -68,7 +73,7 @@ class FrameVideo(Frame):
|
|
|
68
73
|
--------
|
|
69
74
|
>>> import torch
|
|
70
75
|
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
71
|
-
>>> FrameVideo("2/4", torch.zeros((480, 720, 3))) # doctest: +ELLIPSIS
|
|
76
|
+
>>> FrameVideo("2/4", torch.zeros((480, 720, 3), dtype=torch.uint8)) # doctest: +ELLIPSIS
|
|
72
77
|
FrameVideo('1/2', [[[0, 0, 0],
|
|
73
78
|
...
|
|
74
79
|
[0, 0, 0]]])
|
|
@@ -116,7 +121,7 @@ class FrameVideo(Frame):
|
|
|
116
121
|
assert self.shape[0] > 0, self.shape
|
|
117
122
|
assert self.shape[1] > 0, self.shape
|
|
118
123
|
assert self.shape[2] in {1, 2, 3, 4}, self.shape
|
|
119
|
-
assert self.dtype
|
|
124
|
+
assert self.dtype in {torch.uint8, torch.float32}, self.dtype
|
|
120
125
|
|
|
121
126
|
def convert(self, channels: int) -> Frame:
|
|
122
127
|
"""Change the numbers of channels of the frame.
|
|
@@ -242,12 +247,7 @@ class FrameVideo(Frame):
|
|
|
242
247
|
"""
|
|
243
248
|
assert isinstance(channels, int), channels.__class__.__name__
|
|
244
249
|
assert 1 <= channels <= 4, f"channels can only be 1, 2, 3, or 4, not {channels}"
|
|
245
|
-
converter = {
|
|
246
|
-
1: to_gray,
|
|
247
|
-
2: to_gray_alpha,
|
|
248
|
-
3: to_bgr,
|
|
249
|
-
4: to_bgr_alpha,
|
|
250
|
-
}[channels]
|
|
250
|
+
converter = {1: to_gray, 2: to_gray_alpha, 3: to_bgr, 4: to_bgr_alpha}[channels]
|
|
251
251
|
return self.__class__(self.time, converter(self))
|
|
252
252
|
|
|
253
253
|
@property
|
|
@@ -279,7 +279,7 @@ class FrameVideo(Frame):
|
|
|
279
279
|
return self.context
|
|
280
280
|
|
|
281
281
|
def to_numpy_bgr(self, contiguous=False) -> np.ndarray[np.uint8]:
|
|
282
|
-
"""Return the 3 channels numpy frame representation.
|
|
282
|
+
"""Return the 3 channels uint8 numpy frame representation.
|
|
283
283
|
|
|
284
284
|
Parameters
|
|
285
285
|
----------
|
|
@@ -290,19 +290,37 @@ class FrameVideo(Frame):
|
|
|
290
290
|
--------
|
|
291
291
|
>>> import torch
|
|
292
292
|
>>> from cutcutcodec.core.classes.frame_video import FrameVideo
|
|
293
|
-
>>>
|
|
293
|
+
>>>
|
|
294
|
+
>>> # from float32
|
|
295
|
+
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_bgr() # classical bgr
|
|
296
|
+
>>> type(frame), frame.shape, frame.dtype
|
|
297
|
+
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
298
|
+
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_bgr() # grayscale
|
|
299
|
+
>>> type(frame), frame.shape, frame.dtype
|
|
300
|
+
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
301
|
+
>>> frame = FrameVideo(0, torch.zeros(480, 720, 3)).to_numpy_bgr() # alpha channel
|
|
302
|
+
>>> type(frame), frame.shape, frame.dtype
|
|
303
|
+
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
304
|
+
>>>
|
|
305
|
+
>>> # from uint8
|
|
306
|
+
>>> frame = FrameVideo(0, torch.empty(480, 720, 3, dtype=torch.uint8)).to_numpy_bgr()
|
|
294
307
|
>>> type(frame), frame.shape, frame.dtype
|
|
295
308
|
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
296
|
-
>>> frame = FrameVideo(0, torch.empty(480, 720, 3)).to_numpy_bgr()
|
|
309
|
+
>>> frame = FrameVideo(0, torch.empty(480, 720, 3, dtype=torch.uint8)).to_numpy_bgr()
|
|
297
310
|
>>> type(frame), frame.shape, frame.dtype
|
|
298
311
|
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
299
|
-
>>> frame = FrameVideo(0, torch.empty(480, 720, 3)).to_numpy_bgr()
|
|
312
|
+
>>> frame = FrameVideo(0, torch.empty(480, 720, 3, dtype=torch.uint8)).to_numpy_bgr()
|
|
300
313
|
>>> type(frame), frame.shape, frame.dtype
|
|
301
314
|
(<class 'numpy.ndarray'>, (480, 720, 3), dtype('uint8'))
|
|
302
315
|
>>>
|
|
303
316
|
"""
|
|
304
317
|
assert isinstance(contiguous, bool), contiguous.__class__.__name__
|
|
305
318
|
frame_np = self.convert(3).numpy(force=True)
|
|
319
|
+
if frame_np.dtype == np.float32:
|
|
320
|
+
frame_np = frame_np.copy()
|
|
321
|
+
frame_np *= 255.0
|
|
322
|
+
frame_np += 0.5 # to transform floor in round
|
|
323
|
+
frame_np = frame_np.astype(np.uint8) # floor
|
|
306
324
|
if contiguous:
|
|
307
325
|
return np.ascontiguousarray(frame_np)
|
|
308
326
|
return frame_np
|
|
@@ -150,6 +150,7 @@ class Layout:
|
|
|
150
150
|
name = name_
|
|
151
151
|
assert isinstance(name, str), name.__class__.__name__
|
|
152
152
|
audio_profile = AllLayouts()
|
|
153
|
+
name = {"1 channel": "mono", "2 channels": "stereo"}.get(name, name) # debug .wav files
|
|
153
154
|
if (channels := audio_profile.layouts.get(name, None)) is None:
|
|
154
155
|
raise ValueError(
|
|
155
156
|
f"profile audio {name} not in {sorted(AllLayouts().layouts)}"
|
|
@@ -41,7 +41,7 @@ class Stream(abc.ABC):
|
|
|
41
41
|
The audit must be conducted in the children's classes.
|
|
42
42
|
It is not done here in order to avoid cyclic imports.
|
|
43
43
|
node_main : cutcutcodec.core.classes.node.Node
|
|
44
|
-
In the case this streams comes from ``cutcutcodec.core.
|
|
44
|
+
In the case this streams comes from ``cutcutcodec.core.filter.meta_filter.MetaFilter``,
|
|
45
45
|
`node_main` is the meta filter while `node` is the subgraph of the meta-filter.
|
|
46
46
|
"""
|
|
47
47
|
self._node = node
|