-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest_devices_dshow.py
More file actions
38 lines (31 loc) · 1.03 KB
/
test_devices_dshow.py
File metadata and controls
38 lines (31 loc) · 1.03 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
import logging, os
from ffmpegio.plugins.devices import dshow
from ffmpegio.path import check_version
from ffmpegio import devices
from packaging.version import Version
import pytest
@pytest.mark.skipif(os.name != "nt", reason="only run on windows")
def test_dshow():
if check_version("5.0"):
devices.scan()
try:
devs = devices.SOURCES["dshow"]["list"]
except:
print("no dshow device found")
return
else:
devs = dshow._scan()
for _, spec in devs.items():
print(dshow._resolve([spec]))
print(dshow._list_options(spec))
if devs:
print(dshow._resolve([dev for dev in devs.values()]))
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
import ffmpegio
# if ffmpegio.path.FFMPEG_VER!='5.0':
# v5 = r"C:\Users\tikuma\AppData\Local\Programs\ffmpeg-5.0\bin"
# ffmpegio.set_path(fr"{v5}\ffmpeg.exe", fr"{v5}\ffprobe.exe")
# print(ffmpegio.path.FFMPEG_VER)
print(os.name)
test_dshow()