Skip navigation
MrCybin
Currently Being Moderated

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

Jan 13, 2014 1:58 PM

Tags: #rtmp #python

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?

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points