Tried to run but failed to show the RTSP result on flask website

Please provide complete information as applicable to your setup.

Hardware Platform (Jetson / GPU)
Jetson NX

• DeepStream Version

• JetPack Version (valid for Jetson only)

• TensorRT Version

• Issue Type( questions, new requirements, bugs)
After correctly running

python3 -i ../../../samples/streams/sample_720p.h264 

Basically, there should be a rtsp stream on rtsp://localhost:8554/ds-test , is that righht?

And I am trying that output the rtsp stream on website with cv2 and flask. The code that I use is

from flask import Flask, render_template, Response
import cv2
from gevent.pywsgi import WSGIServer
import os

app = Flask(__name__)

os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transort;udp"

camera = cv2.VideoCapture('rtsp://myusername:mypassword@localhost:8554/ds-test', cv2.CAP_FFMPEG)  # use 0 for web camera
#  for cctv camera use 
# for local webcam use cv2.VideoCapture(0)

def gen_frames():  # generate frame by frame from camera
    while True:
        # Capture frame-by-frame
        success, frame =  # read the camera frame
        if not success:
            ret, buffer = cv2.imencode('.jpg', frame)
            frame = buffer.tobytes()
            yield (b'--frame\r\n'
                   b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')  # concat frame one by one and show result

def video_feed():
    #Video streaming route. Put this in the src attribute of an img tag
    return Response(gen_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')

def index():
    """Video streaming home page."""
    return render_template('index.html')

if __name__ == '__main__':
    app.debug = True
    http_server = WSGIServer(('', 8888), app)

but got the error,

[rtsp @ 0x5597e22600] method DESCRIBE failed: 503 Service Unavailable
rtsp://localhost:8554/ds-test: Server returned 5XX Server Error reply

Any comments on this? Please share with me!

Do you run the python script in the same device as the deepstream app? Why do you set username and password?


Yes, I set the script in the same device (NX), I had also tried


it printed the same error message.

Have you installed ffmpeg in your board? Can you see rtsp://localhost:8554/ds-test with ffmpeg in your board directly?


Yes, ffmpeg already installed. What’s the commad to use ffmpeg to see rtsp?

ffmpeg Documentation