Ejemplo n.º 1
0
def main():
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    p = ArgumentParser(description="livestream screenshare")
    p.add_argument(
        'websites',
        help='site to stream, e.g. localhost youtube periscope facebook twitch',
        nargs='+')
    p.add_argument('-i', '--ini', help='*.ini file with stream parameters')
    p.add_argument('-y',
                   '--yes',
                   help='no confirmation dialog',
                   action='store_true')
    p.add_argument('-t',
                   '--timeout',
                   help='stop streaming after --timeout seconds',
                   type=int)
    P = p.parse_args()

    S = pls.Screenshare(P.ini, P.websites, yes=P.yes, timeout=P.timeout)
    sites: List[str] = list(S.streams.keys())
    # %% Go live
    if P.yes:
        print('going live on', sites)
    else:
        input(f"Press Enter to go live on {sites}    Or Ctrl C to abort.")

    S.golive()
Ejemplo n.º 2
0
def main():
    signal.signal(signal.SIGINT, signal.SIG_DFL)

    p = ArgumentParser(description="livestream screenshare")
    p.add_argument('site',
                   help='site to stream: [youtube,periscope,facebook,twitch]',
                   nargs='?',
                   default='localhost')
    p.add_argument('-i',
                   '--ini',
                   help='*.ini file with stream parameters',
                   default=R / 'stream.ini')
    p.add_argument('-y',
                   '--yes',
                   help='no confirmation dialog',
                   action='store_true')
    P = p.parse_args()

    site = P.site.split()

    S = pls.Screenshare(P.ini, site, yes=P.yes)
    sites: List[str] = list(S.streams.keys())
    # %% Go live
    if P.yes:
        print('going live on', sites)
    else:
        input(f"Press Enter to go live on {sites}    Or Ctrl C to abort.")

    S.golive()
Ejemplo n.º 3
0
def test_props(periscope_kbps):
    S = pls.Screenshare(inifn=None, websites=sites, key="abc")
    for s in S.streams:
        assert "-re" not in S.streams[s].cmd
        assert S.streams[s].fps == approx(30.0)

        if s == "periscope":
            assert S.streams[s].video_kbps == periscope_kbps
        else:
            assert S.streams[s].video_kbps == 500
Ejemplo n.º 4
0
def test_props():
    S = pls.Screenshare(inifn=None, websites=sites, key='abc')
    for s in S.streams:
        assert '-re' not in S.streams[s].cmd
        assert S.streams[s].fps == approx(30.0)

        if s == 'periscope':
            assert S.streams[s].video_kbps == 800
        else:
            assert S.streams[s].video_kbps == 500
Ejemplo n.º 5
0
def test_screenshare():
    S = pls.Screenshare(inifn, sites)
    for s in S.streams:
        assert '-re' not in S.streams[s].cmd
        assert S.streams[s].fps == approx(30.)

        if s == 'periscope':
            assert S.streams[s].video_kbps == 800
        else:
            assert S.streams[s].video_kbps == 1800
Ejemplo n.º 6
0
def test_screenshare_stream(listener):
    global skip
    S = pls.Screenshare(inifn, 'localhost-test')

    ok = S.check_device()

    if not ok:
        skip = True
        pytest.skip(f'device not available: {S.streams.popitem()[1].checkcmd}')

    S.golive()
Ejemplo n.º 7
0
def test_stream():
    S = pls.Screenshare(inifn=None, websites="localhost", timeout=5, key="abc")

    S.golive()
Ejemplo n.º 8
0
def test_stream():
    S = pls.Screenshare(inifn=None, websites='localhost', timeout=5, key='abc')

    S.golive()