예제 #1
0
def test1():
  st=""" Test single live stream
  """
  pre=pre_mod+"test1 :"
  print(pre,st)
  
  livethread=LiveThread(
    name   ="live_thread",
    verbose=True
    )
  
  openglthread=OpenGLThread(
    name    ="mythread",
    n_1440p  =5,
    verbose =True
    )
  
  # now livethread and openglthread are running ..
  
  chain=BasicFilterchain1(
    openglthread=openglthread,
    slot=1
    )

  chain.setLiveContext("rtsp://*****:*****@192.168.1.41")
  
  livethread.registerStream   (chain.live_ctx)
  livethread.playStream       (chain.live_ctx)
  print("sleeping for some secs")
  time.sleep(5)
  livethread.stopStream       (chain.live_ctx)
  livethread.deregisterStream (chain.live_ctx)
  print("bye!")
예제 #2
0
def test3():
    st = """ Test ShmemFilterchain
  """
    pre = pre_mod + "test3 :"
    print(pre, st)

    livethread = LiveThread(name="live_thread", verbose=True)

    openglthread = OpenGLThread(name="mythread", n_1440p=5, verbose=True)

    # now livethread and openglthread are running ..

    chain = ShmemFilterchain1(
        openglthread=openglthread,
        slot=1,
        shmem_image_dimensions=(
            1920 // 4,
            1080 // 4),  # images passed over shmem are full-hd/4 reso
        shmem_image_interval=1000,  # .. passed every 1000 milliseconds
        shmem_ringbuffer_size=10  # size of the ringbuffer
    )

    chain.setLiveContext("rtsp://*****:*****@192.168.1.41")

    livethread.registerStream(chain.live_ctx)
    livethread.playStream(chain.live_ctx)
    print("sleeping for some secs")
    time.sleep(5)
    livethread.stopStream(chain.live_ctx)
    livethread.deregisterStream(chain.live_ctx)

    print("bye!")