auto-editor 27.1.0__tar.gz → 27.1.1__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.
- {auto_editor-27.1.0 → auto_editor-27.1.1}/PKG-INFO +1 -1
- auto_editor-27.1.1/auto_editor/__init__.py +1 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/edit.py +15 -10
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/formats/fcp7.py +12 -52
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/timeline.py +9 -6
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor.egg-info/PKG-INFO +1 -1
- auto_editor-27.1.0/auto_editor/__init__.py +0 -1
- {auto_editor-27.1.0 → auto_editor-27.1.1}/LICENSE +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/README.md +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/__main__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/analyze.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/__init__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/cache.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/desc.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/info.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/levels.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/palet.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/repl.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/subdump.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/cmds/test.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/ffwrapper.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/formats/__init__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/formats/fcp11.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/formats/json.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/formats/shotcut.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/formats/utils.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/help.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/json.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lang/__init__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lang/libintrospection.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lang/libmath.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lang/palet.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lang/stdenv.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lib/__init__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lib/contracts.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lib/data_structs.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/lib/err.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/make_layers.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/preview.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/render/__init__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/render/audio.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/render/subtitle.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/render/video.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/__init__.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/bar.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/chunks.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/cmdkw.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/container.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/func.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/log.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/utils/types.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor/vanparse.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor.egg-info/SOURCES.txt +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor.egg-info/dependency_links.txt +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor.egg-info/entry_points.txt +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor.egg-info/requires.txt +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/auto_editor.egg-info/top_level.txt +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/docs/build.py +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/pyproject.toml +0 -0
- {auto_editor-27.1.0 → auto_editor-27.1.1}/setup.cfg +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "27.1.1"
|
@@ -5,6 +5,7 @@ import sys
|
|
5
5
|
from fractions import Fraction
|
6
6
|
from heapq import heappop, heappush
|
7
7
|
from os.path import splitext
|
8
|
+
from pathlib import Path
|
8
9
|
from subprocess import run
|
9
10
|
from typing import TYPE_CHECKING, Any
|
10
11
|
|
@@ -28,14 +29,18 @@ if TYPE_CHECKING:
|
|
28
29
|
|
29
30
|
|
30
31
|
def set_output(
|
31
|
-
out: str | None, _export: str | None,
|
32
|
+
out: str | None, _export: str | None, path: Path | None, log: Log
|
32
33
|
) -> tuple[str, dict[str, Any]]:
|
33
|
-
if
|
34
|
-
|
34
|
+
if out is None:
|
35
|
+
if path is None:
|
36
|
+
log.error("`--output` must be set.") # When a timeline file is the input.
|
37
|
+
root, ext = splitext(path)
|
35
38
|
else:
|
36
|
-
root, ext = splitext(
|
37
|
-
|
38
|
-
|
39
|
+
root, ext = splitext(out)
|
40
|
+
|
41
|
+
if ext == "":
|
42
|
+
# Use `mp4` as the default, because it is most compatible.
|
43
|
+
ext = ".mp4" if path is None else path.suffix
|
39
44
|
|
40
45
|
if _export is None:
|
41
46
|
if ext == ".xml":
|
@@ -158,8 +163,7 @@ def parse_export(export: str, log: Log) -> dict[str, Any]:
|
|
158
163
|
|
159
164
|
def edit_media(paths: list[str], args: Args, log: Log) -> None:
|
160
165
|
bar = initBar(args.progress)
|
161
|
-
tl = None
|
162
|
-
src = None
|
166
|
+
tl = src = use_path = None
|
163
167
|
|
164
168
|
if args.keep_tracks_separate:
|
165
169
|
log.deprecated("--keep-tracks-separate is deprecated.")
|
@@ -181,9 +185,10 @@ def edit_media(paths: list[str], args: Args, log: Log) -> None:
|
|
181
185
|
tl = read_json(paths[0], log)
|
182
186
|
else:
|
183
187
|
sources = [FileInfo.init(path, log) for path in paths]
|
184
|
-
src =
|
188
|
+
src = sources[0]
|
189
|
+
use_path = src.path
|
185
190
|
|
186
|
-
output, export_ops = set_output(args.output, args.export,
|
191
|
+
output, export_ops = set_output(args.output, args.export, use_path, log)
|
187
192
|
assert "export" in export_ops
|
188
193
|
export = export_ops["export"]
|
189
194
|
|
@@ -2,7 +2,6 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import xml.etree.ElementTree as ET
|
4
4
|
from fractions import Fraction
|
5
|
-
from io import StringIO
|
6
5
|
from math import ceil
|
7
6
|
from typing import TYPE_CHECKING
|
8
7
|
from xml.etree.ElementTree import Element
|
@@ -29,59 +28,20 @@ DEPTH = "16"
|
|
29
28
|
|
30
29
|
|
31
30
|
def uri_to_path(uri: str) -> str:
|
32
|
-
|
33
|
-
uri_escape = {
|
34
|
-
"3C": "<",
|
35
|
-
"3E": ">",
|
36
|
-
"23": "#",
|
37
|
-
"25": "%",
|
38
|
-
"2B": "+",
|
39
|
-
"7B": "{",
|
40
|
-
"7D": "}",
|
41
|
-
"7C": "|",
|
42
|
-
"5C": "\\",
|
43
|
-
"5E": "^",
|
44
|
-
"7E": "~",
|
45
|
-
"5B": "[",
|
46
|
-
"5D": "]",
|
47
|
-
"60": "`",
|
48
|
-
"3F": "?",
|
49
|
-
"3A": ":",
|
50
|
-
"40": "@",
|
51
|
-
"3D": "=",
|
52
|
-
"2A": "*",
|
53
|
-
"29": ")",
|
54
|
-
"28": "(",
|
55
|
-
"27": "'",
|
56
|
-
"26": "&",
|
57
|
-
"24": "$",
|
58
|
-
"22": '"',
|
59
|
-
"21": "!",
|
60
|
-
"20": " ",
|
61
|
-
}
|
62
|
-
buf = StringIO()
|
63
|
-
i = 0
|
64
|
-
while i < len(s):
|
65
|
-
if s[i] == "%" and len(s) > i + 3:
|
66
|
-
tag = s[i + 1 : i + 3]
|
67
|
-
if tag in uri_escape:
|
68
|
-
buf.write(uri_escape[tag])
|
69
|
-
i += 3
|
70
|
-
else:
|
71
|
-
buf.write(s[i])
|
72
|
-
i += 1
|
73
|
-
else:
|
74
|
-
buf.write(s[i])
|
75
|
-
i += 1
|
76
|
-
return buf.getvalue()
|
31
|
+
urllib = __import__("urllib.parse", fromlist=["parse"])
|
77
32
|
|
78
33
|
if uri.startswith("file://localhost/"):
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
34
|
+
uri = uri[16:]
|
35
|
+
elif uri.startswith("file://"):
|
36
|
+
# Windows-style paths
|
37
|
+
if len(uri) > 8 and uri[9] == ":":
|
38
|
+
uri = uri[8:]
|
39
|
+
else:
|
40
|
+
uri = uri[7:]
|
41
|
+
else:
|
42
|
+
return uri
|
43
|
+
|
44
|
+
return urllib.parse.unquote(uri)
|
85
45
|
|
86
46
|
# /Users/wyattblue/projects/auto-editor/example.mp4
|
87
47
|
# file:///Users/wyattblue/projects/auto-editor/example.mp4
|
@@ -347,26 +347,29 @@ video\n"""
|
|
347
347
|
return self.T.sr
|
348
348
|
|
349
349
|
|
350
|
-
def make_tracks_dir(path: Path) ->
|
350
|
+
def make_tracks_dir(tracks_dir: Path, path: Path) -> None:
|
351
351
|
from os import mkdir
|
352
352
|
from shutil import rmtree
|
353
353
|
|
354
|
-
tracks_dir = path.parent / f"{path.stem}_tracks"
|
355
|
-
|
356
354
|
try:
|
357
355
|
mkdir(tracks_dir)
|
358
356
|
except OSError:
|
359
357
|
rmtree(tracks_dir)
|
360
358
|
mkdir(tracks_dir)
|
361
359
|
|
362
|
-
return tracks_dir
|
363
|
-
|
364
360
|
|
365
361
|
def set_stream_to_0(src: FileInfo, tl: v3, log: Log) -> None:
|
366
|
-
|
362
|
+
dir_exists = False
|
367
363
|
cache: dict[Path, FileInfo] = {}
|
368
364
|
|
369
365
|
def make_track(i: int, path: Path) -> FileInfo:
|
366
|
+
nonlocal dir_exists
|
367
|
+
|
368
|
+
fold = path.parent / f"{path.stem}_tracks"
|
369
|
+
if not dir_exists:
|
370
|
+
make_tracks_dir(fold, path)
|
371
|
+
dir_exists = True
|
372
|
+
|
370
373
|
newtrack = fold / f"{path.stem}_{i}.wav"
|
371
374
|
if newtrack not in cache:
|
372
375
|
mux(path, output=newtrack, stream=i)
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "27.1.0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|