Skip to main content

an online player for video stream

Project description

Whishow

A python based online video streaming player

1. Install

pip install whishow

2. Usage

demo 1: Simple play

cmd:
    python -m whishow <video_path_or_url>
e.g. 
    python -m  whishow rtmp://mobliestream.c3tv.com:554/live/goodtv.sdp

demo 2: Multithreading based stream processing and frame playback in Python

    from whishow import STREAM,PLAY
    import keyboard
    import threading

    # init the stream reader, named stm.
    stm = STREAM()
    stm.init_state(url=url,
                    cache_size=10*60,
                    video_frame_quality=50)
                    
    # init the whishow player, and connect the audio/video stream of stm.
    ply = PLAY()
    ply.init_state(chunk_size=1,
                video_frame_shift=20,
                audio_fps=stm.AUDIO_FPS,
                video_fps=stm.VIDEO_FPS,
                Q_audio_play=stm.Q_audio_play,
                Q_video_play=stm.Q_video_play,
                asr_results=[])

    # esc for exit
    def engine():
        while 1:
            if keyboard.is_pressed('esc'):
                print("exit ..")
                break
            time.sleep(0.1)
        stm.running = False
        ply.running = False

    # stream reader
    def stream():
        stm.read(video_dst_frame_size=video_dst_frame_size,
                is_play=True,
                is_asr=False)

    # stream palyer
    def play():
        ply.run()

    p0 = threading.Thread(target=engine,args=())
    p1 = threading.Thread(target=stream,args=())
    p2 = threading.Thread(target=play,args=())

    p0.start()
    p1.start()
    p2.start()

    p0.join()
    p1.join()
    p2.join()

3. Contact us

605686962@qq.com coolEphemeroptera@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whishow-1.3.4-py2.py3-none-any.whl (9.8 MB view details)

Uploaded Python 2Python 3

File details

Details for the file whishow-1.3.4-py2.py3-none-any.whl.

File metadata

  • Download URL: whishow-1.3.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.8 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for whishow-1.3.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3c1c484bcbcf0c3208900556c28ced4b4becc7995a54b4a6d1507057015f68c4
MD5 068517b280a20bc66902d6e19a3f1f14
BLAKE2b-256 409aa4384ef193a052a56dba9ec7d28f6f713453d151b8ba900afacc065f5d79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page