FLIR Lepton Streaming from Pi Zero to Nano

Hi,
Please check if you can run this python code.
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov is a public link and please make sure you can successfully connect to it and see video playback. And then try to replace the string with udpsrc ! rtph264depay ! …

Hi @DaneLLL,

This does not work.

But I have RTSP streaming from my own security camera and this is what I use:(using nanocamerra from pypi)

I have already tried using the rtsp url for the raspberry pi in the hopes that nano cam should work with t too, but it doesn’t work. May be I should port forward the raspberry pi and see?

###########################################################################
import cv2

from nanocamera.NanoCam import Camera

import nanocamera as nano

if name == ‘main’:
# requires the RTSP location. Something like this: rtsp://localhost:8888/stream
# For RTSP camera, the camera_type=2.
# This only supports H.264 codec for now

# a location for the rtsp stream
rtsp_location = "192.168.0.168:554/HighResolutionVideo"
# Create the Camera instance
camera = nano.Camera(camera_type=2, source=rtsp_location, width=960, height=720, fps=21)
print('RTSP Camera is now ready')
while True:
    try:
        # read the camera image
        frame = camera.read()
        # display the frame
        cv2.imshow("Video Frame", frame)
        if cv2.waitKey(25) & 0xFF == ord('q'):
            break
    except KeyboardInterrupt:
        break

# close the camera instance
camera.release()

# remove camera object
del camera

#########################################################################

Thanks
Micky

Hi,
We test below case and it works fine.
[Linux PC]
Start the UDP server:

$ gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! x264enc ! h264parse ! rtph264pay ! udpsink host=10.19.107.174 port=5000 sync=0

[Jetson Nano with IP 10.19.107.174]

$ gst-launch-1.0 udpsrc port=5000 ! 'application/x-rtp,encoding-name=H264,payload=96' ! rtph264depay ! h264parse ! nvv4l2decoder ! nvoverlaysink

Maybe you can try to run the command of Linux PC on Pi Zero and check if Nano can receive it.

Hi @DaneLLL

When I execute this on the pi zero, it seems like it is good (test video, not the camera) because the gst clock seems to be set properly.

On the nano, after waiting almost 5 minutes, the test video did launch…extremely slow and the CLI also said that there is a time stamp error or the computer is too slow. Please see attached for the nano output.

What do you suggest next?

Thank you,
Micky

@DaneLLL

Please see the attached for nano output

The lepton camera only support BGR, RGB8, RGB16, GRAY8 etc…there seems to be no h264 support…does that even make sense? Or should we be able to encode the nvidia library?

Thanks,
Micky

Hi,
If the source is not in NV12 or I420, you would need to do conversion through videoconvert plugin. It will be like:

v4l2src ! videoconvert ! video/x-raw,format=NV12 ! nvvidconv ! x264enc ! ...

hi @DaneLLL

I got some help and finally got it to work perfectly. See attached for screenshot.

This is what worked:

###########################################################################
PIPELINES FOR LEPTON3.5/PURETHERMAL
###########################################################################
on NANO:

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=JPEG ! rtpjpegdepay ! jpegdec ! xvimagesink

on PI Zero:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=UYVY ! videoscale ! videoconvert ! video/x-raw,format=I420,width=640,height=480,framerate=9/1 ! jpegenc ! rtpjpegpay ! udpsink host=192.168.0.187 port=5000

Thank you for continuing to troubleshoot.

Micky

1 Like