Hi Sirs,
I meet a hang issue when I capture from camera and stream it out via gst-rtsp-server for three or four days. I can see the HDMI display is frozen, the usb mouse and usb keyboard can’t get response. My TX1 environment is L4T 23.1.
The following code is what I test.
#include <gst/gst.h>
#include <gst/rtsp-server/rtsp-server.h>
#define DEFAULT_RTSP_PORT "8554"
#undef WITH_AUTH
static char *port = (char *)DEFAULT_RTSP_PORT;
int main(int argc, char **argv)
{
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMountPoints *mounts;
GstRTSPMediaFactory *factory;
GOptionContext *optctx;
GError *error = NULL;
optctx = g_option_context_new("RTSP Server\n");
g_option_context_add_group(optctx, gst_init_get_option_group( ));
if(!g_option_context_parse(optctx, &argc, &argv, &error)) {
g_printerr("Error parsing options: %s\n", error->message);
return -1;
}
g_option_context_free(optctx);
loop = g_main_loop_new(NULL, FALSE);
server = gst_rtsp_server_new( );
g_object_set(server, "service", port, NULL);
mounts = gst_rtsp_server_get_mount_points(server);
factory = gst_rtsp_media_factory_new( );
gst_rtsp_media_factory_set_launch(factory, "( nvcamerasrc fpsRange=30.0 30.0 intent=3 ! nvvidconv flip-method=6 ! video/x-raw\(memory:NVMM\), width=640, height=480, format=I420, framerate=30/1 ! omxh264enc bitrate=8000000 ! video/x-h264, stream-format=byte-stream ! h264parse ! rtph264pay name=pay0 pt=96 )");
gst_rtsp_mount_points_add_factory(mounts, "/test", factory);
g_object_unref(mounts);
gst_rtsp_server_attach(server, NULL);
g_main_loop_run(loop);
g_main_loop_unref(loop);
return 0;
}