cutcutcodec 1.0.post3__py3-none-any.whl
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.
Potentially problematic release.
This version of cutcutcodec might be problematic. Click here for more details.
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/__main__.py +38 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/c_build.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/_helper_properties.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/audio/properties/duration.py +83 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/ffprobe.py +637 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/find.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/graph/time_backprop.py +68 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_audio.py +239 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/rate_video.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/shape.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/stream/time_backprop.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/duration.py +162 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/nb_frames.py +159 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/rate.py +102 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/analysis/video/properties/timestamps.py +194 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/container.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/encoder.py +152 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/filter.py +33 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame.py +127 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_audio.py +205 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/frame_video.py +322 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/layout.py +206 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/meta_filter.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/muxer.py +184 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/node.py +164 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream.py +182 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_audio.py +130 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/classes/stream_video.py +193 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/__init__.py +7 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/ast_to_file.py +125 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/__init__.py +6 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/compatibility.py +734 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/default.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/encodec.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/muxer.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/export/rate.py +133 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_ast.py +477 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_json.py +104 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/graph_to_tree.py +190 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/json_to_graph.py +114 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/parse.py +123 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/__init__.py +15 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/dynamic.py +544 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/lambdify.py +612 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/preprocess.py +698 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/sympy_to_torch/printer.py +926 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/compilation/tree_to_graph.py +168 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/decision/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/add.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/edit/operation/remove.py +476 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/exceptions.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/add.py +170 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/cut.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/delay.py +85 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/equation.py +261 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/fir.py +231 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/resample.py +451 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/audio/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/cut.py +74 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/audio_cast.py +208 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/mix/video_cast.py +197 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/subclip.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/add.py +331 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cat.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/cut.py +113 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/delay.py +84 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/equation.py +265 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/identity.py +48 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/pad.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/filters/video/subclip.py +91 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/empty.py +73 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/equation.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/audio/noise.py +243 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/c_fractal.cpython-312-x86_64-linux-gnu.so +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/empty.py +69 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/equation.py +109 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/fractal.c +116 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/geometry.py +100 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/fractal/mandelbrot.py +176 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/generation/video/noise.py +112 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/interfaces/seedable.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_ffmpeg.py +904 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/read_svg.py +145 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/scheduler.py +356 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/io/write.py +340 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/basic.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/clean/graph.py +80 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/hashes/graph.py +81 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cache/singleton.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/cuda/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/factor/proba.py +189 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/__init__.py +5 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/generalize/delay_to_fir.py +88 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/graph.py +17 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/parallel/buffer.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/core/opti/utils.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/audio_5.1_narration.oga +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/intro.webm +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/logo.svg +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/project.json +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/examples/video.mp4 +0 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/__main__.py +25 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/actions.py +63 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/app/app.py +248 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/base.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/container_input_ffmpeg.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_equation.py +45 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_fir.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_audio_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_cut.py +82 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_delay.py +20 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_subclip.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_delay.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_equation.py +53 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/filter_video_subclip.py +9 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_equation.py +14 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_audio_noise.py +19 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_equation.py +13 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_mandelbrot.py +60 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/all/generator_video_noise.py +18 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/base.py +99 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/default.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/documentation.py +47 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/general.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/interface.py +305 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/loader.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edit_node_state/main.py +62 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/edition_tabs.py +34 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/base.py +122 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/filters.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry/generators.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/entry_tabs.py +46 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/_helper.py +54 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/container.py +226 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/doc.py +67 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/encodec.py +289 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/export/main.py +173 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/edge_properties.py +56 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/main.py +280 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/flowchart/node.py +44 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/main.py +151 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/menu.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/audio_settings.py +183 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/main.py +41 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/preferences/video_settings.py +257 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/run.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/main.py +30 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/slider.py +286 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/track.py +97 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/timeline/view.py +90 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/toolbar.py +29 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/tools.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/__init__.py +3 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/audio_player.py +103 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/control.py +96 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/frame_extractor.py +254 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/gui/video_preview/main.py +115 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__init__.py +8 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/__main__.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/coding_style.py +49 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/generation.py +52 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/install.py +72 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/run.py +58 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/abstract.py +215 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_cast.py +35 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/audio_equation.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/c_memory.py +132 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compatibility.py +27 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/compile.py +42 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/encoder.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_cut.py +107 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_delay.py +71 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/filter_empty.py +40 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/fir.py +143 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/hashes.py +23 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/initialisation.py +24 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/muxer.py +22 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/nan_snapshot.py +39 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/read.py +192 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/serialization_equality.py +50 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/snapshot_shape.py +21 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/sympy_to_torch.py +135 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/thread_safe.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/time_range.py +55 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/video_equation.py +77 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/testing/tests/write.py +95 -0
- cutcutcodec-1.0.post3.data/platlib/cutcutcodec/utils.py +40 -0
- cutcutcodec-1.0.post3.dist-info/LICENSE +7 -0
- cutcutcodec-1.0.post3.dist-info/METADATA +271 -0
- cutcutcodec-1.0.post3.dist-info/RECORD +233 -0
- cutcutcodec-1.0.post3.dist-info/WHEEL +5 -0
- cutcutcodec-1.0.post3.dist-info/entry_points.txt +6 -0
- cutcutcodec-1.0.post3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Interactive widget for help to choose the export codecs/encoders settings."""
|
|
4
|
+
|
|
5
|
+
from fractions import Fraction
|
|
6
|
+
|
|
7
|
+
from qtpy import QtCore, QtWidgets
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.core.classes.encoder import AllEncoders
|
|
10
|
+
from cutcutcodec.core.classes.encoder import Encoder
|
|
11
|
+
from cutcutcodec.core.classes.muxer import AllMuxers
|
|
12
|
+
from cutcutcodec.core.compilation.export.compatibility import Compatibilities
|
|
13
|
+
from cutcutcodec.core.compilation.parse import parse_to_number
|
|
14
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
15
|
+
from cutcutcodec.gui.export._helper import ComboBox
|
|
16
|
+
from cutcutcodec.gui.export.doc import DocViewer
|
|
17
|
+
from cutcutcodec.gui.preferences.audio_settings import PreferencesAudio
|
|
18
|
+
from cutcutcodec.gui.preferences.video_settings import PreferencesVideo
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class BitRateSelector(CutcutcodecWidget, QtWidgets.QLineEdit):
|
|
22
|
+
"""Configure the bitrate of one stream."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, parent):
|
|
25
|
+
super().__init__(parent)
|
|
26
|
+
self._parent = parent
|
|
27
|
+
self.textEdited.connect(self._validate_flow)
|
|
28
|
+
|
|
29
|
+
def _validate_flow(self, text):
|
|
30
|
+
"""Ensure the bitrate is correct."""
|
|
31
|
+
if text == "":
|
|
32
|
+
self.app.export_settings["bitrate"][self.parent.stream.type][self.parent.index] = None
|
|
33
|
+
self.setStyleSheet("background:none;")
|
|
34
|
+
return
|
|
35
|
+
try:
|
|
36
|
+
bitrate = round(parse_to_number(text))
|
|
37
|
+
except ValueError:
|
|
38
|
+
self.setStyleSheet("background:red;")
|
|
39
|
+
return
|
|
40
|
+
if bitrate < 0:
|
|
41
|
+
self.setStyleSheet("background:red;")
|
|
42
|
+
return
|
|
43
|
+
self.app.export_settings["bitrate"][self.parent.stream.type][self.parent.index] = text
|
|
44
|
+
self.setStyleSheet("background:none;")
|
|
45
|
+
|
|
46
|
+
def refresh(self):
|
|
47
|
+
"""Write in the box the recorded value."""
|
|
48
|
+
bitrate = self.app.export_settings["bitrate"][self.parent.stream.type][self.parent.index]
|
|
49
|
+
if bitrate is None:
|
|
50
|
+
self.setText("")
|
|
51
|
+
else:
|
|
52
|
+
self.setText(bitrate)
|
|
53
|
+
self.setStyleSheet("background:none;")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class CodecComboBox(ComboBox):
|
|
57
|
+
"""Lists the availables codecs."""
|
|
58
|
+
|
|
59
|
+
def _text_changed(self, name: str):
|
|
60
|
+
if name == "default":
|
|
61
|
+
name = None
|
|
62
|
+
index = self.parent.index
|
|
63
|
+
stream_type = self.parent.stream.type
|
|
64
|
+
if self.app.export_settings["codecs"][stream_type][index] != name:
|
|
65
|
+
self.app.export_settings["codecs"][stream_type][index] = name
|
|
66
|
+
print(f"update codec (stream {stream_type} {index}): {name}")
|
|
67
|
+
self.parent.widgets["encoder_combo_box"].text_changed("default")
|
|
68
|
+
self.parent.parent.refresh() # WindowsExportSettings
|
|
69
|
+
|
|
70
|
+
def available_codecs(self) -> set[str]:
|
|
71
|
+
"""Set of codecs supporting for this streams.
|
|
72
|
+
|
|
73
|
+
Takes in account the muxer and the stream type.
|
|
74
|
+
"""
|
|
75
|
+
stream_type = self.parent.stream.type
|
|
76
|
+
muxer = self.app.export_settings["muxer"]
|
|
77
|
+
muxers = None if muxer is None else [muxer]
|
|
78
|
+
if stream_type == "audio":
|
|
79
|
+
return set(
|
|
80
|
+
Compatibilities().codecs_audio(
|
|
81
|
+
muxers, # we should to forward 'profile' as well
|
|
82
|
+
layout=self.parent.stream.layout.name,
|
|
83
|
+
rate=self.app.export_settings["rates"]["audio"][self.parent.index],
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
if stream_type == "video":
|
|
87
|
+
rate_json = self.app.export_settings["rates"]["video"][self.parent.index]
|
|
88
|
+
return set(
|
|
89
|
+
Compatibilities().codecs_video(
|
|
90
|
+
muxers,
|
|
91
|
+
shape=self.app.export_settings["shapes"][self.parent.index],
|
|
92
|
+
rate=(None if rate_json is None else Fraction(rate_json)),
|
|
93
|
+
pix_fmt=self.app.export_settings["pix_fmt"][self.parent.index],
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
raise NotImplementedError(f"only available for audio and video, not for {stream_type}")
|
|
97
|
+
|
|
98
|
+
def refresh(self):
|
|
99
|
+
"""Update the list with the available codecs."""
|
|
100
|
+
self.clear()
|
|
101
|
+
codec = self.app.export_settings["codecs"][self.parent.stream.type][self.parent.index]
|
|
102
|
+
if codec is not None and codec not in self.available_codecs():
|
|
103
|
+
self.text_changed("default")
|
|
104
|
+
return
|
|
105
|
+
self.addItem(codec or "default")
|
|
106
|
+
for codec_ in [None] + sorted(self.available_codecs()):
|
|
107
|
+
if codec_ == codec:
|
|
108
|
+
continue
|
|
109
|
+
self.addItem(codec_ or "default")
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class EncoderComboBox(ComboBox):
|
|
113
|
+
"""Lists the availables encoders."""
|
|
114
|
+
|
|
115
|
+
def _text_changed(self, name: str):
|
|
116
|
+
if name == "default":
|
|
117
|
+
name = None
|
|
118
|
+
index = self.parent.index
|
|
119
|
+
stream_type = self.parent.stream.type
|
|
120
|
+
if self.app.export_settings["encoders"][stream_type][index] != name:
|
|
121
|
+
self.app.export_settings["encoders"][stream_type][index] = name
|
|
122
|
+
print(f"update encoder (stream {stream_type} {index}): {name}")
|
|
123
|
+
self.parent.parent.refresh() # WindowsExportSettings
|
|
124
|
+
|
|
125
|
+
def available_encoders(self) -> set[str]:
|
|
126
|
+
"""Set of encoders supporting for this streams.
|
|
127
|
+
|
|
128
|
+
The returned encoders are tested to ensure the compatibility with the muxer and the codec.
|
|
129
|
+
"""
|
|
130
|
+
stream_type = self.parent.stream.type
|
|
131
|
+
codec = self.app.export_settings["codecs"][stream_type][self.parent.index]
|
|
132
|
+
muxer = self.app.export_settings["muxer"]
|
|
133
|
+
muxers = [muxer] if muxer is not None else None
|
|
134
|
+
|
|
135
|
+
if stream_type == "audio":
|
|
136
|
+
if codec is None:
|
|
137
|
+
encoders = sorted(AllEncoders().audio)
|
|
138
|
+
comp = Compatibilities().check( # we should to forward 'profile' as well
|
|
139
|
+
encoders, (muxers or sorted(AllMuxers().set)),
|
|
140
|
+
layout=self.parent.stream.layout.name,
|
|
141
|
+
rate=self.app.export_settings["rates"]["audio"][self.parent.index],
|
|
142
|
+
)
|
|
143
|
+
return {e for e, a in zip(encoders, (comp != "").any(axis=1)) if a}
|
|
144
|
+
return set(
|
|
145
|
+
Compatibilities().encoders_audio(
|
|
146
|
+
codec, muxers, # we should to forward 'profile' as well
|
|
147
|
+
layout=self.parent.stream.layout.name,
|
|
148
|
+
rate=self.app.export_settings["rates"]["audio"][self.parent.index],
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
if stream_type == "video":
|
|
152
|
+
rate_json = self.app.export_settings["rates"]["video"][self.parent.index]
|
|
153
|
+
if codec is None:
|
|
154
|
+
encoders = sorted(AllEncoders().video)
|
|
155
|
+
comp = Compatibilities().check(
|
|
156
|
+
encoders, (muxers or sorted(AllMuxers().set)),
|
|
157
|
+
shape=self.app.export_settings["shapes"][self.parent.index],
|
|
158
|
+
rate=(None if rate_json is None else Fraction(rate_json)),
|
|
159
|
+
pix_fmt=self.app.export_settings["pix_fmt"][self.parent.index],
|
|
160
|
+
)
|
|
161
|
+
return {e for e, a in zip(encoders, (comp != "").any(axis=1)) if a}
|
|
162
|
+
return set(
|
|
163
|
+
Compatibilities().encoders_video(
|
|
164
|
+
codec, muxers,
|
|
165
|
+
shape=self.app.export_settings["shapes"][self.parent.index],
|
|
166
|
+
rate=(None if rate_json is None else Fraction(rate_json)),
|
|
167
|
+
pix_fmt=self.app.export_settings["pix_fmt"][self.parent.index],
|
|
168
|
+
)
|
|
169
|
+
)
|
|
170
|
+
raise NotImplementedError(f"only available for audio and video, not for {stream_type}")
|
|
171
|
+
|
|
172
|
+
def refresh(self):
|
|
173
|
+
"""Update the list with the available encoders."""
|
|
174
|
+
self.clear()
|
|
175
|
+
encoder = self.app.export_settings["encoders"][self.parent.stream.type][self.parent.index]
|
|
176
|
+
if encoder is not None and encoder not in self.available_encoders():
|
|
177
|
+
self.text_changed("default")
|
|
178
|
+
return
|
|
179
|
+
self.addItem(encoder or "default")
|
|
180
|
+
for encoder_ in [None] + sorted(self.available_encoders()):
|
|
181
|
+
if encoder_ == encoder:
|
|
182
|
+
continue
|
|
183
|
+
self.addItem(encoder_ or "default")
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class EncoderSettings(CutcutcodecWidget, QtWidgets.QWidget):
|
|
187
|
+
"""Able to choose and edit the encoder for a given stream."""
|
|
188
|
+
|
|
189
|
+
def __init__(self, parent, stream):
|
|
190
|
+
super().__init__(parent)
|
|
191
|
+
self._parent = parent
|
|
192
|
+
self.stream = stream
|
|
193
|
+
|
|
194
|
+
self.widgets = {}
|
|
195
|
+
self.widgets["preset"] = None
|
|
196
|
+
self.widgets["codec_combo_box"] = CodecComboBox(self)
|
|
197
|
+
self.widgets["encoder_label"] = QtWidgets.QLabel("Encoder:", self)
|
|
198
|
+
self.widgets["encoder_label"].hide()
|
|
199
|
+
self.widgets["encoder_combo_box"] = EncoderComboBox(self)
|
|
200
|
+
self.widgets["encoder_combo_box"].hide()
|
|
201
|
+
self.widgets["encoder_doc_viewer"] = DocViewer(
|
|
202
|
+
self,
|
|
203
|
+
self.app.export_settings["encoders_settings"][self.stream.type][self.index],
|
|
204
|
+
lambda doc_viewer: (
|
|
205
|
+
"" if (
|
|
206
|
+
encoder := (
|
|
207
|
+
doc_viewer.app.export_settings
|
|
208
|
+
)["encoders"][self.stream.type][doc_viewer.parent.index]
|
|
209
|
+
) is None else Encoder(encoder).doc
|
|
210
|
+
)
|
|
211
|
+
)
|
|
212
|
+
self.widgets["encoder_doc_viewer"].hide()
|
|
213
|
+
self.widgets["bitrate_selector"] = BitRateSelector(self)
|
|
214
|
+
# if self.stream.type == "video":
|
|
215
|
+
# self.widgets["pix_fmt_label"] = QtWidgets.QLabel("Pixel Format:", self)
|
|
216
|
+
# self.widgets["pix_fmt_label"].hide()
|
|
217
|
+
|
|
218
|
+
grid_layout = QtWidgets.QGridLayout()
|
|
219
|
+
ref_span = self.init_title(grid_layout)
|
|
220
|
+
ref_span = self.init_preset(grid_layout, ref_span)
|
|
221
|
+
grid_layout.addWidget(QtWidgets.QLabel("Codec:"), ref_span+1, 0)
|
|
222
|
+
grid_layout.addWidget(self.widgets["codec_combo_box"], ref_span+1, 1)
|
|
223
|
+
grid_layout.addWidget(self.widgets["encoder_label"], ref_span+2, 0)
|
|
224
|
+
grid_layout.addWidget(self.widgets["encoder_combo_box"], ref_span+2, 1)
|
|
225
|
+
grid_layout.addWidget(self.widgets["encoder_doc_viewer"], ref_span+3, 0, 1, 2)
|
|
226
|
+
# if self.stream.type == "video":
|
|
227
|
+
# grid_layout.addWidget(self.widgets["pix_fmt_label"], ref_span+4, 0)
|
|
228
|
+
# ref_span += 4
|
|
229
|
+
# else:
|
|
230
|
+
# ref_span += 3
|
|
231
|
+
grid_layout.addWidget(QtWidgets.QLabel("Flow (bits/s):"), ref_span+4, 0)
|
|
232
|
+
grid_layout.addWidget(self.widgets["bitrate_selector"], ref_span+4, 1)
|
|
233
|
+
self.setLayout(grid_layout)
|
|
234
|
+
|
|
235
|
+
@property
|
|
236
|
+
def index(self):
|
|
237
|
+
"""Return the input stream relative index of the container output."""
|
|
238
|
+
for index, stream in enumerate(self.app.tree().in_select(self.stream.type)):
|
|
239
|
+
if stream is self.stream:
|
|
240
|
+
return index
|
|
241
|
+
raise KeyError(f"the stream {self.stream} is missing in the container output")
|
|
242
|
+
|
|
243
|
+
@property
|
|
244
|
+
def index_abs(self):
|
|
245
|
+
"""Return the input stream absolute index of the container output."""
|
|
246
|
+
for index, stream in enumerate(self.app.tree().in_streams):
|
|
247
|
+
if stream is self.stream:
|
|
248
|
+
return index
|
|
249
|
+
raise KeyError(f"the stream {self.stream} is missing in the container output")
|
|
250
|
+
|
|
251
|
+
def init_preset(self, grid_layout, ref_span=0):
|
|
252
|
+
"""Return the preferences."""
|
|
253
|
+
grid_layout.addWidget(QtWidgets.QLabel("Profile:"), ref_span, 0)
|
|
254
|
+
if self.stream.type == "audio":
|
|
255
|
+
self.widgets["preset"] = PreferencesAudio(self, self.index_abs)
|
|
256
|
+
elif self.stream.type == "video":
|
|
257
|
+
self.widgets["preset"] = PreferencesVideo(self, self.index_abs)
|
|
258
|
+
else:
|
|
259
|
+
raise NotImplementedError(f"not yet supported {self.stream.type}")
|
|
260
|
+
grid_layout.addWidget(self.widgets["preset"], ref_span, 1)
|
|
261
|
+
return ref_span + 1
|
|
262
|
+
|
|
263
|
+
def init_title(self, grid_layout, ref_span=0):
|
|
264
|
+
"""Return the section title."""
|
|
265
|
+
title = QtWidgets.QLabel(
|
|
266
|
+
f"Stream {self.index_abs} {self.stream.type} {self.index} Settings"
|
|
267
|
+
)
|
|
268
|
+
title.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
|
|
269
|
+
title.setStyleSheet("font-weight: bold")
|
|
270
|
+
grid_layout.addWidget(title, ref_span, 0, 1, 2)
|
|
271
|
+
return ref_span + 1
|
|
272
|
+
|
|
273
|
+
def refresh(self):
|
|
274
|
+
"""Update the elements of this widget and child widgets."""
|
|
275
|
+
self.widgets["codec_combo_box"].refresh()
|
|
276
|
+
self.widgets["encoder_combo_box"].refresh()
|
|
277
|
+
if self.app.export_settings["codecs"][self.stream.type][self.index] is None:
|
|
278
|
+
self.widgets["encoder_label"].hide()
|
|
279
|
+
self.widgets["encoder_combo_box"].hide()
|
|
280
|
+
# if self.stream.type == "video":
|
|
281
|
+
# self.widgets["pix_fmt_label"].hide()
|
|
282
|
+
else:
|
|
283
|
+
self.widgets["encoder_label"].show()
|
|
284
|
+
self.widgets["encoder_combo_box"].show()
|
|
285
|
+
# if self.stream.type == "video":
|
|
286
|
+
# self.widgets["pix_fmt_label"].show()
|
|
287
|
+
self.widgets["encoder_doc_viewer"].refresh()
|
|
288
|
+
self.widgets["preset"].refresh()
|
|
289
|
+
self.widgets["bitrate_selector"].refresh()
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Interactive window for help to choose the export settings."""
|
|
4
|
+
|
|
5
|
+
import pathlib
|
|
6
|
+
|
|
7
|
+
from qtpy import QtWidgets
|
|
8
|
+
|
|
9
|
+
from cutcutcodec.core.compilation.export.default import suggest_export_params
|
|
10
|
+
from cutcutcodec.core.compilation.tree_to_graph import tree_to_graph
|
|
11
|
+
from cutcutcodec.core.exceptions import IncompatibleSettings
|
|
12
|
+
from cutcutcodec.core.io.write import ContainerOutputFFMPEG
|
|
13
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
14
|
+
from cutcutcodec.gui.export.container import ContainerSettings
|
|
15
|
+
from cutcutcodec.gui.export.encodec import EncoderSettings
|
|
16
|
+
from cutcutcodec.gui.tools import WaitCursor
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class WindowsExportSettings(CutcutcodecWidget, QtWidgets.QDialog):
|
|
20
|
+
"""Show the exportation settings."""
|
|
21
|
+
|
|
22
|
+
def __init__(self, parent):
|
|
23
|
+
super().__init__(parent)
|
|
24
|
+
self._parent = parent
|
|
25
|
+
self.encoders_widgets = []
|
|
26
|
+
|
|
27
|
+
with WaitCursor(self.main_window):
|
|
28
|
+
self._container_settings = ContainerSettings(self)
|
|
29
|
+
self.encoders_widgets = [
|
|
30
|
+
EncoderSettings(self, stream) for stream in self.app.tree().in_streams
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
self.setWindowTitle("Export settings")
|
|
34
|
+
|
|
35
|
+
# simplified configuration
|
|
36
|
+
simplified_tab = QtWidgets.QWidget()
|
|
37
|
+
simplified_layout = QtWidgets.QVBoxLayout()
|
|
38
|
+
simplified_layout.addWidget(
|
|
39
|
+
QtWidgets.QLabel("Not yet implemented, Please go in 'Advanced Settings' tab.")
|
|
40
|
+
)
|
|
41
|
+
simplified_tab.setLayout(simplified_layout)
|
|
42
|
+
|
|
43
|
+
# advanced settings
|
|
44
|
+
advanced_tab = QtWidgets.QWidget()
|
|
45
|
+
advanced_layout = QtWidgets.QVBoxLayout()
|
|
46
|
+
advanced_layout.addWidget(self._container_settings)
|
|
47
|
+
advanced_streams_w = QtWidgets.QWidget()
|
|
48
|
+
advanced_layout_streams = QtWidgets.QHBoxLayout()
|
|
49
|
+
advanced_streams_w.setLayout(advanced_layout_streams)
|
|
50
|
+
for i, encoder in enumerate(self.encoders_widgets):
|
|
51
|
+
if i:
|
|
52
|
+
separador = QtWidgets.QFrame()
|
|
53
|
+
separador.setFrameShape(QtWidgets.QFrame.Shape.VLine)
|
|
54
|
+
advanced_layout_streams.addWidget(separador)
|
|
55
|
+
advanced_layout_streams.addWidget(encoder)
|
|
56
|
+
advanced_layout.addWidget(advanced_streams_w)
|
|
57
|
+
advanced_tab.setLayout(advanced_layout)
|
|
58
|
+
|
|
59
|
+
# positioning of the widgets
|
|
60
|
+
tabs = QtWidgets.QTabWidget()
|
|
61
|
+
tabs.addTab(simplified_tab, "Simplifed Configuration")
|
|
62
|
+
tabs.addTab(advanced_tab, "Advanced Settings")
|
|
63
|
+
layout = QtWidgets.QVBoxLayout()
|
|
64
|
+
layout.addWidget(tabs)
|
|
65
|
+
self.init_next(layout)
|
|
66
|
+
self.setLayout(layout)
|
|
67
|
+
|
|
68
|
+
self.refresh()
|
|
69
|
+
|
|
70
|
+
def export(self):
|
|
71
|
+
"""Complete the job or the next step in the main pipeline."""
|
|
72
|
+
self.accept()
|
|
73
|
+
streams = self.app.tree().in_streams
|
|
74
|
+
|
|
75
|
+
# conversion of supplied parameters
|
|
76
|
+
filename = (
|
|
77
|
+
pathlib.Path(self.app.export_settings["parent"]) / self.app.export_settings["stem"]
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
indexs = {}
|
|
81
|
+
streams_settings = []
|
|
82
|
+
for stream in streams:
|
|
83
|
+
index = indexs.get(stream.type, -1) + 1
|
|
84
|
+
indexs[stream.type] = index
|
|
85
|
+
streams_settings.append({
|
|
86
|
+
"encodec": self.app.export_settings["encoders"][stream.type][index],
|
|
87
|
+
"options": self.app.export_settings["encoders_settings"][stream.type][index],
|
|
88
|
+
})
|
|
89
|
+
if streams_settings[-1]["encodec"] is None:
|
|
90
|
+
streams_settings[-1]["encodec"] = (
|
|
91
|
+
self.app.export_settings["codecs"][stream.type][index]
|
|
92
|
+
)
|
|
93
|
+
if stream.type == "audio":
|
|
94
|
+
streams_settings[-1]["rate"] = self.app.export_settings["rates"]["audio"][index]
|
|
95
|
+
streams_settings[-1]["bitrate"] = (
|
|
96
|
+
self.app.export_settings["bitrate"]["audio"][index]
|
|
97
|
+
)
|
|
98
|
+
elif stream.type == "video":
|
|
99
|
+
streams_settings[-1]["rate"] = self.app.export_settings["rates"]["video"][index]
|
|
100
|
+
streams_settings[-1]["shape"] = self.app.export_settings["shapes"][index]
|
|
101
|
+
streams_settings[-1]["bitrate"] = (
|
|
102
|
+
self.app.export_settings["bitrate"]["video"][index]
|
|
103
|
+
)
|
|
104
|
+
streams_settings[-1]["pix_fmt"] = self.app.export_settings["pix_fmt"][index]
|
|
105
|
+
else:
|
|
106
|
+
raise TypeError(f"not yet supported {stream.type}")
|
|
107
|
+
|
|
108
|
+
container_settings = {
|
|
109
|
+
"format": self.app.export_settings["muxer"],
|
|
110
|
+
"container_options": self.app.export_settings["muxer_settings"],
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
# completes the missing parameters
|
|
114
|
+
try:
|
|
115
|
+
filename, streams_settings, container_settings = suggest_export_params(
|
|
116
|
+
streams,
|
|
117
|
+
filename=filename,
|
|
118
|
+
streams_settings=streams_settings,
|
|
119
|
+
container_settings=container_settings,
|
|
120
|
+
)
|
|
121
|
+
except IncompatibleSettings as err:
|
|
122
|
+
QtWidgets.QMessageBox.warning(None, "Incompatible Parameters", str(err))
|
|
123
|
+
|
|
124
|
+
# transmission of the information for next steps
|
|
125
|
+
tree = ContainerOutputFFMPEG(
|
|
126
|
+
streams,
|
|
127
|
+
filename=filename,
|
|
128
|
+
streams_settings=streams_settings,
|
|
129
|
+
container_settings=container_settings,
|
|
130
|
+
)
|
|
131
|
+
self.main_window.output.put_nowait({
|
|
132
|
+
"graph": tree_to_graph(tree),
|
|
133
|
+
"optimize": self.app.export_settings["optimize"],
|
|
134
|
+
"excecute": self.app.export_settings["excecute"],
|
|
135
|
+
"filename": (
|
|
136
|
+
pathlib.Path(self.app.export_settings["parent"]) / self.app.export_settings["stem"]
|
|
137
|
+
)
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
# close
|
|
141
|
+
self.main_window.close()
|
|
142
|
+
|
|
143
|
+
def init_next(self, layout):
|
|
144
|
+
"""Return the button for the next stape."""
|
|
145
|
+
|
|
146
|
+
def set_optimize(state):
|
|
147
|
+
self.app.export_settings["optimize"] = bool(state)
|
|
148
|
+
|
|
149
|
+
def set_excecute(state):
|
|
150
|
+
self.app.export_settings["excecute"] = bool(state)
|
|
151
|
+
|
|
152
|
+
separador = QtWidgets.QFrame()
|
|
153
|
+
separador.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
|
154
|
+
layout.addWidget(separador)
|
|
155
|
+
optimize = QtWidgets.QCheckBox("Optimize the graph.")
|
|
156
|
+
optimize.setChecked(self.app.export_settings["optimize"])
|
|
157
|
+
optimize.stateChanged.connect(set_optimize)
|
|
158
|
+
layout.addWidget(optimize)
|
|
159
|
+
excecute = QtWidgets.QCheckBox("Excecute the generated code.")
|
|
160
|
+
excecute.setChecked(self.app.export_settings["excecute"])
|
|
161
|
+
excecute.stateChanged.connect(set_excecute)
|
|
162
|
+
layout.addWidget(excecute)
|
|
163
|
+
button = QtWidgets.QPushButton("Let's Go!")
|
|
164
|
+
button.setAutoDefault(False)
|
|
165
|
+
button.clicked.connect(self.export)
|
|
166
|
+
layout.addWidget(button)
|
|
167
|
+
|
|
168
|
+
def refresh(self):
|
|
169
|
+
"""Update the elements of this widget and child widgets."""
|
|
170
|
+
with WaitCursor(self):
|
|
171
|
+
self._container_settings.refresh()
|
|
172
|
+
for enc in self.encoders_widgets:
|
|
173
|
+
enc.refresh()
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
"""Interactive window for a specific edge properties."""
|
|
4
|
+
|
|
5
|
+
import math
|
|
6
|
+
|
|
7
|
+
from cutcutcodec.gui.base import CutcutcodecWidget
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def edge_properties(parent: CutcutcodecWidget, edge_name: tuple[str, str, str]) -> str:
|
|
11
|
+
"""Serach the content of the tool tip of this edge."""
|
|
12
|
+
stream = parent.app.tree_edge(edge_name)
|
|
13
|
+
properties = {}
|
|
14
|
+
|
|
15
|
+
# the general type
|
|
16
|
+
properties["Type"] = stream.type.title()
|
|
17
|
+
|
|
18
|
+
# beginning
|
|
19
|
+
beginning = float(stream.beginning)
|
|
20
|
+
if beginning == math.inf:
|
|
21
|
+
beginning = "infinite"
|
|
22
|
+
else:
|
|
23
|
+
beginning = (
|
|
24
|
+
f"{round(beginning//3600):0>2}:{round(beginning%3600//60):0>2}:{beginning%60:.3f} "
|
|
25
|
+
f"({stream.beginning} seconds)"
|
|
26
|
+
)
|
|
27
|
+
properties["Beginning"] = beginning
|
|
28
|
+
|
|
29
|
+
# duration
|
|
30
|
+
duration = float(stream.duration)
|
|
31
|
+
if duration == math.inf:
|
|
32
|
+
duration = "infinite"
|
|
33
|
+
else:
|
|
34
|
+
duration = (
|
|
35
|
+
f"{round(duration//3600):0>2}:{round(duration%3600//60):0>2}:{duration%60:.3f} "
|
|
36
|
+
f"({stream.duration} seconds)"
|
|
37
|
+
)
|
|
38
|
+
properties["Duration"] = duration
|
|
39
|
+
|
|
40
|
+
# time continuous
|
|
41
|
+
continuous = {True: "yes", False: "no"}[stream.is_time_continuous]
|
|
42
|
+
properties["Time is continuous"] = continuous
|
|
43
|
+
|
|
44
|
+
# space continuous
|
|
45
|
+
if stream.type == "video":
|
|
46
|
+
continuous = {True: "yes", False: "no"}[stream.is_space_continuous]
|
|
47
|
+
properties["Space is continuous"] = continuous
|
|
48
|
+
|
|
49
|
+
# channels
|
|
50
|
+
if stream.type == "audio":
|
|
51
|
+
properties["Profile"] = (
|
|
52
|
+
f"{stream.layout.name} "
|
|
53
|
+
f"({'+'.join(n for n, d in stream.layout.channels)})"
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
return "<br>".join(f"{k}: {v}" for k, v in properties.items())
|