How to stream captured video from opencv to a RTSP Url of azure live stream via python?

Tejesh Defect Scanner 0 Reputation points
2023-07-03T15:30:38.25+00:00

I am capturing frames from a RTSP url using opencv

cap = cv2.VideoCapture(input_rtsp_url)

Now I want to stream these captured frames to another RTSP Url "Output_rtsp_url". I will be performing YOLOv5s object detection on the frame and drawing bounding boxes on it before sending it to another RTSP url which is connected to Azure live stream media. However im not able to figure out how stream these frames back to Azure live stream media using the second RTSP url. Can anyone help me with a code on how to stream these frames to an RTSP url using python?

Let me know if any additional details are required! Thanks in advance !

I have tried using FFMPEG, Gstream, PyCurl etc which I could gather from online resources and AI models. However none of them seem to work without giving a magnitude of errors. Im expecting a code that will send these frames to the output url as needed. Thankyou!

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
313 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,059 questions
{count} votes