reencode-hevc 0.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.
- reencode_hevc-0.1.0/PKG-INFO +15 -0
- reencode_hevc-0.1.0/README.md +8 -0
- reencode_hevc-0.1.0/pyproject.toml +10 -0
- reencode_hevc-0.1.0/setup.cfg +4 -0
- reencode_hevc-0.1.0/src/reencode_hevc/__init__.py +72 -0
- reencode_hevc-0.1.0/src/reencode_hevc.egg-info/PKG-INFO +15 -0
- reencode_hevc-0.1.0/src/reencode_hevc.egg-info/SOURCES.txt +8 -0
- reencode_hevc-0.1.0/src/reencode_hevc.egg-info/dependency_links.txt +1 -0
- reencode_hevc-0.1.0/src/reencode_hevc.egg-info/entry_points.txt +2 -0
- reencode_hevc-0.1.0/src/reencode_hevc.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: reencode-hevc
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Requires-Python: >=3.14
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# reencode-hevc
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
```
|
|
12
|
+
reencode-hevc.py [pattern]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This will re-encode all files that match `*pattern*` to HEVC and .mkv
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#! /usr/bin/python3
|
|
2
|
+
|
|
3
|
+
# ffmpeg -i in.mp4 \
|
|
4
|
+
# -c:v hevc_nvenc \
|
|
5
|
+
# -preset medium \
|
|
6
|
+
# -rc vbr \
|
|
7
|
+
# -cq 22 \
|
|
8
|
+
# -b:v 0 \
|
|
9
|
+
# -pix_fmt p010le \
|
|
10
|
+
# -c:a copy \
|
|
11
|
+
# -c:s copy \
|
|
12
|
+
# -c:t copy \
|
|
13
|
+
# -map 0 \
|
|
14
|
+
# out.mkv
|
|
15
|
+
import sys
|
|
16
|
+
import subprocess
|
|
17
|
+
import os
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def main():
|
|
21
|
+
if len(sys.argv) != 2:
|
|
22
|
+
print("You need to specify extension")
|
|
23
|
+
sys.exit()
|
|
24
|
+
|
|
25
|
+
pattern = sys.argv[1]
|
|
26
|
+
|
|
27
|
+
files = [
|
|
28
|
+
f
|
|
29
|
+
for f in os.listdir(os.getcwd())
|
|
30
|
+
if os.path.isfile(os.path.join(os.getcwd(), f)) and pattern.lower() in f.lower()
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
subprocess.run(["mkdir", "-p", "old"])
|
|
34
|
+
|
|
35
|
+
for f in files:
|
|
36
|
+
newname = f[:-4] + ".mkv"
|
|
37
|
+
oldname = "old-" + f
|
|
38
|
+
|
|
39
|
+
subprocess.run(["mv", f, oldname])
|
|
40
|
+
|
|
41
|
+
cmd = [
|
|
42
|
+
"ffmpeg",
|
|
43
|
+
"-i",
|
|
44
|
+
f"file:{oldname}",
|
|
45
|
+
"-c:v",
|
|
46
|
+
"hevc_nvenc",
|
|
47
|
+
"-preset",
|
|
48
|
+
"medium",
|
|
49
|
+
"-rc",
|
|
50
|
+
"vbr",
|
|
51
|
+
"-cq",
|
|
52
|
+
"22",
|
|
53
|
+
"-b:v",
|
|
54
|
+
"0",
|
|
55
|
+
"-pix_fmt",
|
|
56
|
+
"p010le",
|
|
57
|
+
"-c:a",
|
|
58
|
+
"copy",
|
|
59
|
+
"-c:s",
|
|
60
|
+
"copy",
|
|
61
|
+
"-c:t",
|
|
62
|
+
"copy",
|
|
63
|
+
"-map",
|
|
64
|
+
"0",
|
|
65
|
+
f"file:{newname}",
|
|
66
|
+
]
|
|
67
|
+
subprocess.run(cmd, check=True)
|
|
68
|
+
subprocess.run(["mv", oldname, "./old/"], check=True)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
main()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: reencode-hevc
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Add your description here
|
|
5
|
+
Requires-Python: >=3.14
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# reencode-hevc
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
```
|
|
12
|
+
reencode-hevc.py [pattern]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This will re-encode all files that match `*pattern*` to HEVC and .mkv
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/reencode_hevc/__init__.py
|
|
4
|
+
src/reencode_hevc.egg-info/PKG-INFO
|
|
5
|
+
src/reencode_hevc.egg-info/SOURCES.txt
|
|
6
|
+
src/reencode_hevc.egg-info/dependency_links.txt
|
|
7
|
+
src/reencode_hevc.egg-info/entry_points.txt
|
|
8
|
+
src/reencode_hevc.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
reencode_hevc
|