0 Replies Latest reply: Jan 13, 2014 1:58 PM by MrCybin RSS

    Create a python client using numpy arrays, as images, to read and write data to FMS.

    MrCybin

      Hi,

       

      I want to send images, as numpy arrays, from my Raspberry Pi to FMS in order to work with OpenCV in python.

       

      Here is what i have so far...... but it is still quite lacking.

       

      (https://pypi.python.org/pypi/python-librtmp)

       

      librtmp-python

       

      import librtmp

      import numpy

      # Create a connection

      conn = librtmp.RTMP("rtmp://localhost:1935/myapp/file1", live=false)

      # Attempt to connect

      conn.connect()

      #packet = conn.read_packet()

      #print packet.body

      # Get a file-like object to access to the stream

      stream = conn.create_stream()

      # Read 1024 bytes of data

      data = stream.read(1024)

      print data

       

      # Create a connection

      conn2 = librtmp.RTMP("rtmp://localhost:1935/myapp/file2.flv", live=True)

      # Attempt to connect

      conn2.connect()

      # Get a file-like object to access to the stream

      stream = conn2.create_stream()

      # Read 1024 bytes of data

      stream.write(numpy.zeros((10,10),numpy.uint8))

       

      What other approaches could be employed to achieve this?