示例#1
0
def main():
    from valkka.live.local import ValkkaLocalDir
    singleton.logs_dir = ValkkaLocalDir("live", "logs")
    singleton.ipc_dir = ValkkaLocalDir("live", "ipc")
    app = QtWidgets.QApplication(["test_app"])
    mg = MyGui()
    mg.show()
    app.exec_()
示例#2
0
def main():
  app=QtWidgets.QApplication(["test_app"])
  # mg=MyGui()
  # mg.show()
  mg=CopyToDialog("192.168.1.24", slot=4, max_slot=10)
  lis=mg.exec_()
  for l in lis:
      print(l)
示例#3
0
def main():
    parsed_args, unparsed_args = process_cl_args()

    #print(parsed_args, unparsed_args)
    #return

    #"""
    if len(unparsed_args) > 0:
        print("Unknown command-line argument", unparsed_args[0])
        return
    #"""

    if parsed_args.quiet:
        # core.setLogLevel_valkkafslogger(loglevel_debug)
        print("libValkka verbosity set to fatal messages only")
        core.fatal_log_all()

    if parsed_args.reset:
        singleton.config_dir.reMake()

    if parsed_args.playback:
        singleton.use_playback = True
    else:
        singleton.use_playback = False

    if parsed_args.load:
        singleton.load_layout = True
    else:
        singleton.load_layout = False

    if parsed_args.www:
        singleton.start_www = True
        singleton.www_module = web
    else:
        singleton.start_www = False

    #print(singleton.start_www)
    #return

    from valkka.live.gui import MyGui as MyGuiBase

    class MyGui(MyGuiBase):
        def __init__(self, parent=None):
            print("\n*** Welcome to Valkka Live ***\n")
            super().__init__(parent)

    setproctitle("valkka-live")
    app = QtWidgets.QApplication(["Valkka Live"])
    mg = MyGui()
    mg.show()
    app.exec_()
示例#4
0
def test_with_file(mvision_process_class,
                   mvision_class_names=["valkka.mvision"],
                   shmem_image_interval=1000,
                   shmem_image_dimensions=(1920 // 2, 1080 // 2),
                   init_filename=None):
    """Test the analyzer process with files

    :param mvision_process_class: Which class to test
    :param mvision_class_names: Namespaces to search for required master process classes

    Files must be encoded and muxed correctly, i.e., with:
    
    ::
    
        ffmpeg -i your_video_file -c:v h264 -an outfile.mkv
    
    """
    import time
    from valkka.mvision.file import FileGUI
    from valkka.live import tools

    ps = mvision_process_class()
    mp = None

    if hasattr(ps, "master"):
        # find master process if required .. a bit cumbersome..
        mvision_classes, mvision_client_classes, mvision_master_classes =\
            tools.scanMVisionClasses(
                mvision_class_names
            ) # scans for submodules in namespace valkka.mvision.*
        master_classes_by_tag = {}
        for cl in mvision_master_classes:
            master_classes_by_tag[cl.tag] = cl
        mp = master_classes_by_tag[ps.master]()

    app = QtWidgets.QApplication(["mvision test"])
    fg = FileGUI(mvision_process=ps,
                 mvision_master_process=mp,
                 shmem_name="test_studio_file",
                 shmem_image_dimensions=shmem_image_dimensions,
                 shmem_image_interval=shmem_image_interval,
                 shmem_ringbuffer_size=5,
                 init_filename=init_filename)
    fg.show()
    app.exec_()
    ps.stop()
    print("bye from app!")
示例#5
0
def main():
  app=QtWidgets.QApplication(["test_app"])
  mg=MyGui()
  mg.show()
  app.exec_()