# How to use RTSP server to stream h264 video files with the fastest frame rate possible

**URL:** <https://discourse.gstreamer.org/t/how-to-use-rtsp-server-to-stream-h264-video-files-with-the-fastest-frame-rate-possible/4197>\
**Category:** General Discussion\
**Created:** [February 26, 2025, 7:47am UTC](https://discourse.gstreamer.org/t/how-to-use-rtsp-server-to-stream-h264-video-files-with-the-fastest-frame-rate-possible/4197 "2025-02-26T07:47:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmed](https://discourse.gstreamer.org/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@ahmed](https://discourse.gstreamer.org/u/ahmed)\
**Post date:** [February 26, 2025, 7:47am UTC](https://discourse.gstreamer.org/t/how-to-use-rtsp-server-to-stream-h264-video-files-with-the-fastest-frame-rate-possible/4197/1 "2025-02-26T07:47:36Z")

</div>

I’m trying to stream a file with rtsp protocol using gstreamer rtsp server.

```auto
GMainLoop *loop;
GstRTSPServer *server;
GstRTSPMountPoints *mounts;
GstRTSPMediaFactory *factory;

gst_init(&argc, &argv);
loop = g_main_loop_new(NULL, FALSE);
server = gst_rtsp_server_new();
mounts = gst_rtsp_server_get_mount_points(server);
g_object_set(server, "service", "3000", NULL);
gst_rtsp_server_set_address(server, "0.0.0.0");
factory = gst_rtsp_media_factory_new();
gst_rtsp_media_factory_set_launch(factory, "( uridecodebin uri=file:///<location_on_desk> ! caps=video/x-h264 ! h264parse config-interval=-1 ! rtph264pay name=pay0 pt=96 )");
gst_rtsp_media_factory_set_shared(factory, false);

/* attach the test factory to the /test url */
gst_rtsp_mount_points_add_factory(mounts, "/test", factory);

/* don't need the ref to the mapper anymore */
g_object_unref(mounts);

/* attach the server to the default maincontext */
if (gst_rtsp_server_attach(server, NULL) == 0) goto failed;

/* add a timeout for the session cleanup */
g_timeout_add_seconds(30, (GSourceFunc)timeout, server);

/* start serving, this never stops */
g_print("stream ready at rtsp://127.0.0.1:3000/test\n");
g_main_loop_run(loop);

```

the RTSP stream server works. However, I want to be able to play the stream as fast as possible like if I’m using a sink with sync property set to false.

Note:  
I tried using

```auto
gst_rtsp_media_factory_set_clock(factory, NULL);

```

but no visual effect on the displayed stream
