-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path_create_assets.py
More file actions
55 lines (51 loc) · 1.67 KB
/
_create_assets.py
File metadata and controls
55 lines (51 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from ffmpegio import ffmpegprocess, probe
from os import path
from pprint import pprint
from ffmpegio import image
from matplotlib import pyplot as plt
command_list = (
{
"inputs": [("testsrc=r=30000/1001:d=60", {"f": "lavfi"})],
"outputs": [("tests/assets/testvideo-1m.mp4", None)],
"global_options": {"n": None},
},
{
"inputs": [("testsrc=r=30000/1001:d=60", {"f": "lavfi"})],
"outputs": [("tests/assets/testvideo-1m-lowres.mp4", {"crf": 25})],
"global_options": {"n": None},
},
{
"inputs": [
(
"aevalsrc = '0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)':d=60",
{"f": "lavfi"},
)
],
"outputs": [("tests/assets/testaudio-1m.mp3", None)],
"global_options": {"n": None},
},
{
"inputs": [
("testsrc=r=30000/1001:d=60", {"f": "lavfi"}),
(
"aevalsrc = '0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)':d=60",
{"f": "lavfi"},
),
("testsrc2=d=60", {"f": "lavfi"}),
("anoisesrc=d=60:c=pink:r=44100:a=0.5:d=60", {"f": "lavfi"}),
],
"outputs": [("tests/assets/testmulti-1m.mp4", {"map": (0, 1, 2, 3)})],
"global_options": {"n": None},
},
{
"inputs": [("testsrc=r=1:d=5", {"f": "lavfi"})],
"outputs": [("tests/assets/imgs/testimage-%d.png", None)],
"global_options": {"n": None},
},
)
for cfg in command_list:
url = cfg["outputs"][0][0]
if not path.isfile(url):
ffmpegprocess.run(cfg)
url = url.replace("%d", "1")
pprint(probe.full_details(url))