videocap 0.0.1a1__py3-none-any.whl

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.
videocap/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ """videocap: unattended capture from analog video to a lossless master and an MP4, for whole collections."""
2
+ __version__ = "0.0.1a1" # 0.0.1 alpha
videocap/__main__.py ADDED
@@ -0,0 +1,33 @@
1
+ """python3 -m videocap [--conf FILE]: run the capture station (as root, usually from systemd)."""
2
+ import argparse
3
+ import os
4
+
5
+ from . import __version__
6
+
7
+
8
+ def main():
9
+ ap = argparse.ArgumentParser(prog="videocap", description="Unattended analog video capture station.")
10
+ ap.add_argument("--conf", help="settings file (default /etc/videocap/videocap.conf, or $VIDEOCAP_CONF)")
11
+ ap.add_argument("--check", action="store_true", help="print the settings in effect and what's plugged in, then exit")
12
+ ap.add_argument("--version", action="version", version="videocap " + __version__)
13
+ a = ap.parse_args()
14
+ if a.conf:
15
+ os.environ["VIDEOCAP_CONF"] = a.conf
16
+ from . import config, hardware # after VIDEOCAP_CONF is set
17
+ if a.check:
18
+ conf = config.load(a.conf)
19
+ for k in sorted(conf):
20
+ print("%s=%s" % (k, conf[k]))
21
+ for k in config.unknown_keys(conf):
22
+ print("# unknown setting: %s" % k)
23
+ dev = hardware.find_video(conf)
24
+ print("# capture device:", dev and "%s (%s)" % (dev[2], dev[0]) or "none found")
25
+ print("# audio:", (dev and hardware.find_audio(conf, dev[1])) or "none found")
26
+ return
27
+ os.makedirs(config.RUN, exist_ok=True)
28
+ from .app import App
29
+ App(a.conf).run()
30
+
31
+
32
+ if __name__ == "__main__":
33
+ main()