• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

New Here ,
Jan 13, 2014 Jan 13, 2014

Copy link to clipboard

Copied

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?

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines