change streaming protocol to udp

This commit is contained in:
2025-01-14 15:04:06 +01:00
parent 2448691e63
commit a4ba54161a

View File

@@ -299,7 +299,7 @@ void CapnSend() {
return;
}
VideoWriter out("appsrc ! videoconvert ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast bitrate=600 key-int-max=" + to_string(fps * 2) + " ! video/x-h264,profile=baseline ! rtspclientsink location=rtsp://localhost:8554/mystream",
VideoWriter out("appsrc ! videoconvert ! video/x-raw,format=I420 ! x264enc speed-preset=ultrafast bitrate=600 key-int-max=" + to_string(fps * 2) + " ! video/x-h264,profile=baseline ! mpegtsmux ! udpsink host=127.0.0.1 port=5000",
CAP_GSTREAMER, 0, fps, Size(width, height), true);
if (!out.isOpened()) {
cerr << "Error: Can't open video writer" << endl;
@@ -314,7 +314,7 @@ void CapnSend() {
continue;
}
// Write the frame to the RTSP stream
// Write the frame to the UDP stream
out.write(frame);
cout << "Sent image" << endl;