Skip to content

Commit b33d80c

Browse files
committed
new test assets and their generator
1 parent 6b9533f commit b33d80c

21 files changed

Lines changed: 51 additions & 178 deletions

tests/_create_assets.py

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,43 @@
22
from os import path
33
from pprint import pprint
44

5+
from ffmpegio import image
6+
from matplotlib import pyplot as plt
57

6-
url = "tests/assets/testvideo-5m.mp4"
7-
if not path.isfile(url):
8-
ffmpeg.run_sync(
9-
{
10-
"inputs": [("testsrc=r=30000/1001:d=300", {"f": "lavfi"})],
11-
"outputs": [(url, None)],
12-
"global_options": {"y": None},
13-
}
14-
)
15-
pprint(probe.full_details(url))
8+
command_list = (
9+
{
10+
"inputs": [("testsrc=r=30000/1001:d=60", {"f": "lavfi"})],
11+
"outputs": [("tests/assets/testvideo-1m.mp4", None)],
12+
"global_options": {"y": None},
13+
},
14+
{
15+
"inputs": [
16+
(
17+
"aevalsrc = '0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)':d=60",
18+
{"f": "lavfi"},
19+
)
20+
],
21+
"outputs": [("tests/assets/testaudio-1m.mp3", None)],
22+
"global_options": {"y": None},
23+
},
24+
{
25+
"inputs": [
26+
("testsrc=r=30000/1001:d=60", {"f": "lavfi"}),
27+
(
28+
"aevalsrc = '0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)':d=60",
29+
{"f": "lavfi"},
30+
),
31+
("testsrc2=d=60", {"f": "lavfi"}),
32+
("anoisesrc=d=60:c=pink:r=44100:a=0.5:d=60", {"f": "lavfi"}),
33+
],
34+
"outputs": [("tests/assets/testmulti-1m.mp4", {"map": (0, 1, 2, 3)})],
35+
"global_options": {"y": None},
36+
},
37+
)
1638

1739

18-
url = "tests/assets/testvideo-5m.mpg"
19-
if not path.isfile(url):
20-
ffmpeg.run_sync(
21-
{
22-
"inputs": [("testsrc2=r=30000/1001:d=60", {"f": "lavfi"})],
23-
"outputs": [
24-
(
25-
"tests/assets/testvideo-5m.mpg",
26-
{
27-
"flags": "+ildct+ilme",
28-
"vf": "interlace=lowpass=0:scan=tff",
29-
"c:v": "mpeg2video",
30-
},
31-
)
32-
],
33-
"global_options": {"y": None},
34-
}
35-
)
36-
pprint(probe.full_details(url))
40+
for cfg in command_list:
41+
url = cfg["outputs"][0][0]
42+
if not path.isfile(url):
43+
ffmpeg.run_sync(cfg)
44+
pprint(probe.full_details(url))

tests/assets/desktop.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[ViewState]
2+
Mode=
3+
Vid=
4+
FolderType=Generic

tests/assets/testaudio-1m.mp3

937 KB
Binary file not shown.

tests/assets/testaudio-one.wav

-86.2 KB
Binary file not shown.

tests/assets/testaudio-three.wav

-86.2 KB
Binary file not shown.

tests/assets/testaudio-two.wav

-86.2 KB
Binary file not shown.

tests/assets/testmulti-1m.mp4

3.09 MB
Binary file not shown.

tests/assets/testvideo-169.avi

-79.7 KB
Binary file not shown.

tests/assets/testvideo-1m.mp4

293 KB
Binary file not shown.

tests/assets/testvideo-43.avi

-76.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)